From e63bf1d5970cec0e63029dd1deb36539fc844dae Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 20 Mar 2016 08:02:21 +0000 Subject: [PATCH] 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 +++++++ app/views/versions/index.html.erb | 2 +- app/views/versions/show.html.erb | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) 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"] diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb index 6a3f6f977..53b70b0c7 100644 --- a/app/views/versions/index.html.erb +++ b/app/views/versions/index.html.erb @@ -10,7 +10,7 @@ <% else %>
<% @versions.each do |version| %> -
+

<%= link_to_version version, :name => version_anchor(version) %>

diff --git a/app/views/versions/show.html.erb b/app/views/versions/show.html.erb index 0a45b9c84..27e70aab4 100644 --- a/app/views/versions/show.html.erb +++ b/app/views/versions/show.html.erb @@ -7,7 +7,7 @@

<%= @version.name %>

-
+
<%= render :partial => 'versions/overview', :locals => {:version => @version} %> <%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %> -- 2.39.5