summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-20 08:02:21 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-03-20 08:02:21 +0000
commite63bf1d5970cec0e63029dd1deb36539fc844dae (patch)
tree90b2502251ac4afb433f74f11c8502593d186cad /app
parent09197a22e2f6305c8115be959eb87323697d6ec2 (diff)
downloadredmine-e63bf1d5970cec0e63029dd1deb36539fc844dae.tar.gz
redmine-e63bf1d5970cec0e63029dd1deb36539fc844dae.zip
Additional CSS class for version status (#21434).
git-svn-id: http://svn.redmine.org/redmine/trunk@15270 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'app')
-rw-r--r--app/models/version.rb7
-rw-r--r--app/views/versions/index.html.erb2
-rw-r--r--app/views/versions/show.html.erb2
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 %>
<div id="roadmap">
<% @versions.each do |version| %>
- <article class="version-article <%= version.completed? ? 'version-completed' : 'version-incompleted' %>">
+ <article class="version-article <%= version.css_classes %>">
<header>
<h3 class="version"><%= link_to_version version, :name => version_anchor(version) %></h3>
</header>
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 @@
<h2><%= @version.name %></h2>
-<div id="roadmap">
+<div id="roadmap" class="<%= @version.css_classes %>">
<%= render :partial => 'versions/overview', :locals => {:version => @version} %>
<%= render(:partial => "wiki/content", :locals => {:content => @version.wiki_page.content}) if @version.wiki_page %>