]> source.dussan.org Git - redmine.git/commitdiff
Add "behind-schedule" CSS class to issues (#31881).
authorGo MAEDA <maeda@farend.jp>
Thu, 9 Jul 2020 00:45:19 +0000 (00:45 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 9 Jul 2020 00:45:19 +0000 (00:45 +0000)
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@19868 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/issue.rb
test/unit/issue_test.rb

index a89f23dd8d395f9139ffb46ac177bb773e52e6be..0c691f3556749f184d3bbdcf9cf8a4beeddb19c4 100644 (file)
@@ -1390,6 +1390,7 @@ class Issue < ActiveRecord::Base
     s << ' child' if child?
     s << ' parent' unless leaf?
     s << ' private' if is_private?
+    s << ' behind-schedule' if behind_schedule?
     if user.logged?
       s << ' created-by-me' if author_id == user.id
       s << ' assigned-to-me' if assigned_to_id == user.id
index d82f6e0795571590af096e22eec5e0372e7dfd3c..940825a4a9b7ad29a5683fea59149f9447344885 100644 (file)
@@ -3021,6 +3021,11 @@ class IssueTest < ActiveSupport::TestCase
     assert_include 'assigned-to-me', issue2.css_classes(user)
   end
 
+  def test_css_classes_behind_schedule
+    assert_include 'behind-schedule', Issue.find(1).css_classes.split(' ')
+    assert_not_include 'behind-schedule', Issue.find(2).css_classes.split(' ')
+  end
+
   def test_save_attachments_with_hash_should_save_attachments_in_keys_order
     set_tmp_attachments_directory
     issue = Issue.generate!