From: Jean-Philippe Lang Date: Mon, 26 May 2008 20:10:32 +0000 (+0000) Subject: Moved ProjectsController#list to ProjectsController#index. X-Git-Tag: 0.8.0-RC1~509 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=744d8669260b63a94f5cd41c6b79b8396dd47df3;p=redmine.git Moved ProjectsController#list to ProjectsController#index. git-svn-id: http://redmine.rubyforge.org/svn/trunk@1464 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 07b29fa25..320def41b 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -44,13 +44,8 @@ class ProjectsController < ApplicationController include RepositoriesHelper include ProjectsHelper - def index - list - render :action => 'list' unless request.xhr? - end - # Lists visible projects - def list + def index projects = Project.find :all, :conditions => Project.visible_by(User.current), :include => :parent diff --git a/app/views/projects/index.rhtml b/app/views/projects/index.rhtml new file mode 100644 index 000000000..b8bb62ebb --- /dev/null +++ b/app/views/projects/index.rhtml @@ -0,0 +1,25 @@ +
+ <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> | + <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%> +
+ +

<%=l(:label_project_plural)%>

+ +<% @project_tree.keys.sort.each do |project| %> +

<%= link_to h(project.name), {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %>

+<%= textilizable(project.short_description, :project => project) %> + +<% if @project_tree[project].any? %> +

<%= l(:label_subproject_plural) %>: + <%= @project_tree[project].sort.collect {|subproject| + link_to(h(subproject.name), {:action => 'show', :id => subproject}, :class => (User.current.member_of?(subproject) ? "icon icon-fav" : ""))}.join(', ') %>

+<% end %> +<% end %> + +<% if User.current.logged? %> +
+<%= l(:label_my_projects) %> +
+<% end %> + +<% html_title(l(:label_project_plural)) -%> diff --git a/app/views/projects/list.rhtml b/app/views/projects/list.rhtml deleted file mode 100644 index b8bb62ebb..000000000 --- a/app/views/projects/list.rhtml +++ /dev/null @@ -1,25 +0,0 @@ -
- <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> | - <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%> -
- -

<%=l(:label_project_plural)%>

- -<% @project_tree.keys.sort.each do |project| %> -

<%= link_to h(project.name), {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %>

-<%= textilizable(project.short_description, :project => project) %> - -<% if @project_tree[project].any? %> -

<%= l(:label_subproject_plural) %>: - <%= @project_tree[project].sort.collect {|subproject| - link_to(h(subproject.name), {:action => 'show', :id => subproject}, :class => (User.current.member_of?(subproject) ? "icon icon-fav" : ""))}.join(', ') %>

-<% end %> -<% end %> - -<% if User.current.logged? %> -
-<%= l(:label_my_projects) %> -
-<% end %> - -<% html_title(l(:label_project_plural)) -%> diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 82b5bdeb6..d4ce97dc2 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -35,13 +35,7 @@ class ProjectsControllerTest < Test::Unit::TestCase def test_index get :index assert_response :success - assert_template 'list' - end - - def test_list - get :list - assert_response :success - assert_template 'list' + assert_template 'index' assert_not_nil assigns(:project_tree) # Root project as hash key assert assigns(:project_tree).has_key?(Project.find(1))