]> source.dussan.org Git - redmine.git/commitdiff
Moved ProjectsController#list to ProjectsController#index.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 26 May 2008 20:10:32 +0000 (20:10 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 26 May 2008 20:10:32 +0000 (20:10 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1464 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/controllers/projects_controller.rb
app/views/projects/index.rhtml [new file with mode: 0644]
app/views/projects/list.rhtml [deleted file]
test/functional/projects_controller_test.rb

index 07b29fa2543b9593064ab627c4401ef079f2960e..320def41b94d3087dba97ae9b1706f5559da0981 100644 (file)
@@ -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 (file)
index 0000000..b8bb62e
--- /dev/null
@@ -0,0 +1,25 @@
+<div class="contextual">
+    <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> |
+    <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%>
+</div>
+
+<h2><%=l(:label_project_plural)%></h2>
+
+<% @project_tree.keys.sort.each do |project| %>
+<h3><%= link_to h(project.name), {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %></h3>
+<%= textilizable(project.short_description, :project => project) %>
+
+<% if @project_tree[project].any? %>
+    <p><%= 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(', ') %></p>
+<% end %>
+<% end %>
+
+<% if User.current.logged? %>
+<div class="contextual">
+<span class="icon icon-fav"><%= l(:label_my_projects) %></span>
+</div>
+<% 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 (file)
index b8bb62e..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-<div class="contextual">
-    <%= link_to l(:label_issue_view_all), { :controller => 'issues' } %> |
-    <%= link_to l(:label_overall_activity), { :controller => 'projects', :action => 'activity' }%>
-</div>
-
-<h2><%=l(:label_project_plural)%></h2>
-
-<% @project_tree.keys.sort.each do |project| %>
-<h3><%= link_to h(project.name), {:action => 'show', :id => project}, :class => (User.current.member_of?(project) ? "icon icon-fav" : "") %></h3>
-<%= textilizable(project.short_description, :project => project) %>
-
-<% if @project_tree[project].any? %>
-    <p><%= 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(', ') %></p>
-<% end %>
-<% end %>
-
-<% if User.current.logged? %>
-<div class="contextual">
-<span class="icon icon-fav"><%= l(:label_my_projects) %></span>
-</div>
-<% end %>
-
-<% html_title(l(:label_project_plural)) -%>
index 82b5bdeb66d8140761e349771054e97037899686..d4ce97dc24cfc99b2b62e4afbbff8ef05f7099fe 100644 (file)
@@ -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))