Browse Source

Adds "tracker-[id]" CSS class to issues (#13309).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@11509 e93f8b46-1217-0410-a6f0-8f06a7374b81
tags/2.4.0
Jean-Philippe Lang 11 years ago
parent
commit
a140a03a35
2 changed files with 7 additions and 1 deletions
  1. 1
    1
      app/models/issue.rb
  2. 6
    0
      test/unit/issue_test.rb

+ 1
- 1
app/models/issue.rb View File

@@ -955,7 +955,7 @@ class Issue < ActiveRecord::Base

# Returns a string of css classes that apply to the issue
def css_classes
s = "issue status-#{status_id} #{priority.try(:css_classes)}"
s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}"
s << ' closed' if closed?
s << ' overdue' if overdue?
s << ' child' if child?

+ 6
- 0
test/unit/issue_test.rb View File

@@ -1913,6 +1913,12 @@ class IssueTest < ActiveSupport::TestCase
assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
end

def test_css_classes_should_include_tracker
issue = Issue.new(:tracker => Tracker.find(2))
classes = issue.css_classes.split(' ')
assert_include 'tracker-2', classes
end

def test_css_classes_should_include_priority
issue = Issue.new(:priority => IssuePriority.find(8))
classes = issue.css_classes.split(' ')

Loading…
Cancel
Save