Skip to content
Browse files

Merge pull request #5 from gierschv/master

REST API : Call "GET /projects.json" fails
  • Loading branch information...
2 parents 4f6ab58 + f79a44e commit 4f409a64ab1d2a31d3d0fa2a8c2e225fe99f8017 @kikito kikito committed Apr 2, 2012
View
16 app/views/projects/index.api.rsb
@@ -0,0 +1,16 @@
+api.array :projects, api_meta(:total_count => @project_count, :offset => @offset, :limit => @limit) do
+ @projects.each do |project|
+ api.project do
+ api.id project.id
+ api.name project.name
+ api.identifier project.identifier
+ api.description project.description
+ api.parent(:id => project.parent.id, :name => project.parent.name) if project.parent && project.parent.visible?
+
+ render_api_custom_values project.visible_custom_field_values, api
+
+ api.created_on project.created_on
+ api.updated_on project.updated_on
+ end
+ end
+end
View
2 app/views/projects/index.rhtml
@@ -6,7 +6,7 @@
<div class="contextual">
<%= link_to(l(:label_project_new), {:controller => 'projects', :action => 'new'}, :class => 'icon icon-add') + ' |' if User.current.allowed_to?(:add_project, nil, :global => true) %>
<%= link_to(l(:label_issue_view_all), { :controller => 'issues' }) + ' |' if User.current.allowed_to?(:view_issues, nil, :global => true) %>
- <%= link_to(l(:label_overall_spent_time), { :controller => 'time_entries' }) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
+ <%= link_to(l(:label_overall_spent_time), { :controller => 'timelog' }) + ' |' if User.current.allowed_to?(:view_time_entries, nil, :global => true) %>
<%= link_to l(:label_overall_activity), { :controller => 'activities', :action => 'index' }%>
</div>
View
2 lib/redmine_project_filtering/patches/projects_controller_patch.rb
@@ -29,7 +29,7 @@ def calculate_project_filtering_settings
def index_with_project_filtering
respond_to do |format|
- format.any(:html, :xml) {
+ format.any(:html, :xml, :api) {
calculate_filtered_projects
}
format.js {

0 comments on commit 4f409a6

Please sign in to comment.
Something went wrong with that request. Please try again.