diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-12-16 21:11:37 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-12-16 21:11:37 +0000 |
commit | 02c2a8349472928408ad8dda779362f2f1f3c1aa (patch) | |
tree | abc6b4f669c2b06fc2700111246ff9df4e26c3f3 | |
parent | 7cea286c2344ee20560437c4a785bf2ce2b9091f (diff) | |
download | redmine-02c2a8349472928408ad8dda779362f2f1f3c1aa.tar.gz redmine-02c2a8349472928408ad8dda779362f2f1f3c1aa.zip |
Adds a helper that returns issues css classes.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2139 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/helpers/issues_helper.rb | 6 | ||||
-rw-r--r-- | app/views/issues/_list.rhtml | 2 | ||||
-rw-r--r-- | app/views/issues/_list_simple.rhtml | 2 | ||||
-rw-r--r-- | app/views/issues/show.rhtml | 2 |
4 files changed, 9 insertions, 3 deletions
diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 43acabd19..afc8b8559 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -33,6 +33,12 @@ module IssuesHelper "<strong>#{@cached_label_priority}</strong>: #{issue.priority.name}" end + # Returns a string of css classes that apply to the given issue + def css_issue_classes(issue) + s = "issue status-#{issue.status.position} priority-#{issue.priority.position}" + s + end + def sidebar_queries unless @sidebar_queries # User can see public queries and his own queries diff --git a/app/views/issues/_list.rhtml b/app/views/issues/_list.rhtml index b42357894..cbdd4fd72 100644 --- a/app/views/issues/_list.rhtml +++ b/app/views/issues/_list.rhtml @@ -11,7 +11,7 @@ </tr></thead> <tbody> <% issues.each do |issue| -%> - <tr id="issue-<%= issue.id %>" class="issue hascontextmenu <%= cycle('odd', 'even') %> <%= "status-#{issue.status.position} priority-#{issue.priority.position}" %>"> + <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= css_issue_classes(issue) %>"> <td class="checkbox"><%= check_box_tag("ids[]", issue.id, false, :id => nil) %></td> <td><%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %></td> <% query.columns.each do |column| %><%= content_tag 'td', column_content(column, issue), :class => column.name %><% end %> diff --git a/app/views/issues/_list_simple.rhtml b/app/views/issues/_list_simple.rhtml index 8900b7359..e401a4a2a 100644 --- a/app/views/issues/_list_simple.rhtml +++ b/app/views/issues/_list_simple.rhtml @@ -8,7 +8,7 @@ </tr></thead> <tbody> <% for issue in issues %> - <tr id="issue-<%= issue.id %>" class="issue hascontextmenu <%= cycle('odd', 'even') %> <%= "status-#{issue.status.position} priority-#{issue.priority.position}" %>"> + <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= css_issue_classes(issue) %>"> <td class="id"> <%= check_box_tag("ids[]", issue.id, false, :style => 'display:none;') %> <%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %> diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index 5c174e05b..d5babe331 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -9,7 +9,7 @@ <h2><%= @issue.tracker.name %> #<%= @issue.id %></h2> -<div class="issue <%= "status-#{@issue.status.position} priority-#{@issue.priority.position}" %>"> +<div class="<%= css_issue_classes(@issue) %>"> <%= avatar(@issue.author, :size => "64") %> <h3><%=h @issue.subject %></h3> <p class="author"> |