Project

General

Profile

Feature #34340 » 34340.patch

Yuichi HARADA, 2020-12-11 02:18

View differences:

app/helpers/application_helper.rb
409 409
          end
410 410
        end
411 411
        classes = (ancestors.empty? ? 'root' : 'child')
412
        s << "<li class='#{classes}'><div class='#{classes}'>"
412
        s << "<li class='#{classes}'><div class='#{classes}#{' archived' if project.archived?}'>"
413 413
        s << h(block_given? ? capture(project, &block) : project.name)
414 414
        s << "</div>\n"
415 415
        ancestors << project
public/stylesheets/application.css
660 660
ul.projects ul {padding-left:1.6em;}
661 661
ul.projects.root {margin:0; padding:0;}
662 662
ul.projects li.root, ul.projects li.child {list-style-type:none;}
663
ul.projects li.root div.archived, ul.projects li.child div.archived {color: #aaa;}
663 664
ul.projects div.description li {list-style-type:initial;}
664 665

  
665 666
#projects-index {
test/functional/trackers_controller_test.rb
54 54
    end
55 55
  end
56 56

  
57
  def test_new_with_archived_projects_should_display_greyed_out
58
    project = Project.find(2)
59
    project.update_attribute(:status, Project::STATUS_ARCHIVED)
60

  
61
    get :new
62
    assert_response :success
63
    assert_select '#tracker_project_ids ul li' do
64
      assert_select('> div[class*="archived"] input[name=?]', 'tracker[project_ids][]', 1) do
65
        assert_select ':match("value", ?)', project.id.to_s
66
      end
67
      assert_select '> div:not([class*="archived"]) input[name=?]', 'tracker[project_ids][]', Project.count - 1
68
    end
69
  end
70

  
57 71
  def test_new_with_copy
58 72
    core_fields = ['assigned_to_id', 'category_id', 'fixed_version_id', 'parent_issue_id', 'start_date', 'due_date']
59 73
    custom_field_ids = custom_field_ids = [1, 2, 6]
(3-3/4)