From e63bf1d5970cec0e63029dd1deb36539fc844dae Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 20 Mar 2016 08:02:21 +0000 Subject: Additional CSS class for version status (#21434). git-svn-id: http://svn.redmine.org/redmine/trunk@15270 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- app/models/version.rb | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'app/models/version.rb') diff --git a/app/models/version.rb b/app/models/version.rb index dfa8af1ee..ad3d816fb 100644 --- a/app/models/version.rb +++ b/app/models/version.rb @@ -197,6 +197,13 @@ class Version < ActiveRecord::Base end end + def css_classes + [ + completed? ? 'version-completed' : 'version-incompleted', + "version-#{status}" + ].join(' ') + end + def self.fields_for_order_statement(table=nil) table ||= table_name ["(CASE WHEN #{table}.effective_date IS NULL THEN 1 ELSE 0 END)", "#{table}.effective_date", "#{table}.name", "#{table}.id"] -- cgit v1.2.3