Merged r11509 and r11512 from trunk (#13309).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/2.3-stable@11514 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
parent
2293a5d3f4
commit
5bb2f5e211
|
@ -954,7 +954,7 @@ class Issue < ActiveRecord::Base
|
||||||
|
|
||||||
# Returns a string of css classes that apply to the issue
|
# Returns a string of css classes that apply to the issue
|
||||||
def css_classes
|
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 << ' closed' if closed?
|
||||||
s << ' overdue' if overdue?
|
s << ' overdue' if overdue?
|
||||||
s << ' child' if child?
|
s << ' child' if child?
|
||||||
|
|
|
@ -253,9 +253,9 @@ RAW
|
||||||
|
|
||||||
def test_redmine_links
|
def test_redmine_links
|
||||||
issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
|
issue_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3},
|
||||||
:class => 'issue status-1 priority-4 priority-lowest overdue', :title => 'Error 281 when updating a recipe (New)')
|
:class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
|
||||||
note_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'},
|
note_link = link_to('#3', {:controller => 'issues', :action => 'show', :id => 3, :anchor => 'note-14'},
|
||||||
:class => 'issue status-1 priority-4 priority-lowest overdue', :title => 'Error 281 when updating a recipe (New)')
|
:class => Issue.find(3).css_classes, :title => 'Error 281 when updating a recipe (New)')
|
||||||
|
|
||||||
changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
|
changeset_link = link_to('r1', {:controller => 'repositories', :action => 'revision', :id => 'ecookbook', :rev => 1},
|
||||||
:class => 'changeset', :title => 'My very first commit')
|
:class => 'changeset', :title => 'My very first commit')
|
||||||
|
@ -745,7 +745,7 @@ RAW
|
||||||
|
|
||||||
expected = <<-EXPECTED
|
expected = <<-EXPECTED
|
||||||
<p><a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a></p>
|
<p><a href="/projects/ecookbook/wiki/CookBook_documentation" class="wiki-page">CookBook documentation</a></p>
|
||||||
<p><a href="/issues/1" class="issue status-1 priority-4 priority-lowest" title="Can't print recipes (New)">#1</a></p>
|
<p><a href="/issues/1" class="#{Issue.find(1).css_classes}" title="Can't print recipes (New)">#1</a></p>
|
||||||
<pre>
|
<pre>
|
||||||
[[CookBook documentation]]
|
[[CookBook documentation]]
|
||||||
|
|
||||||
|
|
|
@ -1910,6 +1910,12 @@ class IssueTest < ActiveSupport::TestCase
|
||||||
assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
|
assert_equal [Journal.find(1), Journal.find(2)], Issue.find(1).journals_after('')
|
||||||
end
|
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
|
def test_css_classes_should_include_priority
|
||||||
issue = Issue.new(:priority => IssuePriority.find(8))
|
issue = Issue.new(:priority => IssuePriority.find(8))
|
||||||
classes = issue.css_classes.split(' ')
|
classes = issue.css_classes.split(' ')
|
||||||
|
|
Loading…
Reference in New Issue