]> source.dussan.org Git - redmine.git/commitdiff
Make archived projects visually distinguishable in nested projects lists (#34340).
authorGo MAEDA <maeda@farend.jp>
Wed, 30 Dec 2020 01:35:24 +0000 (01:35 +0000)
committerGo MAEDA <maeda@farend.jp>
Wed, 30 Dec 2020 01:35:24 +0000 (01:35 +0000)
Patch by Yuichi HARADA.

git-svn-id: http://svn.redmine.org/redmine/trunk@20699 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
public/stylesheets/application.css
test/functional/trackers_controller_test.rb

index 394f9b666ec3a3ca87a85f02f8ee793b0c07ef07..45ce689880c3a99be3a3e3fa9847fccca5517007 100644 (file)
@@ -420,6 +420,7 @@ module ApplicationHelper
           end
         end
         classes = (ancestors.empty? ? 'root' : 'child')
+        classes += ' archived' if project.archived?
         s << "<li class='#{classes}'><div class='#{classes}'>"
         s << h(block_given? ? capture(project, &block) : project.name)
         s << "</div>\n"
index 70911e4f6ff4440094fecc44a12ad11e4fc22487..1269930481c01dec98bb170baef50967f4b67dbf 100644 (file)
@@ -660,6 +660,7 @@ ul.projects {margin:0; padding-left:1em;}
 ul.projects ul {padding-left:1.6em;}
 ul.projects.root {margin:0; padding:0;}
 ul.projects li.root, ul.projects li.child {list-style-type:none;}
+ul.projects li.root div.archived, ul.projects li.child div.archived {color: #aaa;}
 ul.projects div.description li {list-style-type:initial;}
 
 #projects-index {
index a6e9e71b134da8f2651860eab241a9f926897b99..bab41278469b7d8d5233356e7258631661354377 100644 (file)
@@ -54,6 +54,20 @@ class TrackersControllerTest < Redmine::ControllerTest
     end
   end
 
+  def test_new_should_set_archived_class_for_archived_projects
+    project = Project.find(2)
+    project.update_attribute(:status, Project::STATUS_ARCHIVED)
+
+    get :new
+    assert_response :success
+    assert_select '#tracker_project_ids ul li' do
+      assert_select('> div[class*="archived"] input[name=?]', 'tracker[project_ids][]', 1) do
+        assert_select ':match("value", ?)', project.id.to_s
+      end
+      assert_select '> div:not([class*="archived"]) input[name=?]', 'tracker[project_ids][]', Project.count - 1
+    end
+  end
+
   def test_new_with_copy
     core_fields = ['assigned_to_id', 'category_id', 'fixed_version_id', 'parent_issue_id', 'start_date', 'due_date']
     custom_field_ids = custom_field_ids = [1, 2, 6]