From: Go MAEDA Date: Wed, 30 Dec 2020 01:35:24 +0000 (+0000) Subject: Make archived projects visually distinguishable in nested projects lists (#34340). X-Git-Tag: 4.2.0~129 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=d504120cf42cbe2f0d0f18bd7e9c66ba05f64013;p=redmine.git Make archived projects visually distinguishable in nested projects lists (#34340). Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@20699 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 394f9b666..45ce68988 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -420,6 +420,7 @@ module ApplicationHelper end end classes = (ancestors.empty? ? 'root' : 'child') + classes += ' archived' if project.archived? s << "
  • " s << h(block_given? ? capture(project, &block) : project.name) s << "
    \n" diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 70911e4f6..126993048 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -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 { diff --git a/test/functional/trackers_controller_test.rb b/test/functional/trackers_controller_test.rb index a6e9e71b1..bab412784 100644 --- a/test/functional/trackers_controller_test.rb +++ b/test/functional/trackers_controller_test.rb @@ -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]