34340-v2.patch

Go MAEDA, 2020-12-20 08:45

Download (2.14 KB)

View differences:

app/helpers/application_helper.rb
420 420
          end
421 421
        end
422 422
        classes = (ancestors.empty? ? 'root' : 'child')
423
        classes += ' archived' if project.archived?
423 424
        s << "<li class='#{classes}'><div class='#{classes}'>"
424 425
        s << h(block_given? ? capture(project, &block) : project.name)
425 426
        s << "</div>\n"
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_should_set_archived_class_for_archived_projects
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]