]> source.dussan.org Git - redmine.git/commitdiff
Adds a helper that returns issues css classes.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 16 Dec 2008 21:11:37 +0000 (21:11 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Tue, 16 Dec 2008 21:11:37 +0000 (21:11 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2139 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/issues_helper.rb
app/views/issues/_list.rhtml
app/views/issues/_list_simple.rhtml
app/views/issues/show.rhtml

index 43acabd19d7977459ed2f634f81852a70346f03b..afc8b8559a19221e5eb0cd722b9fbe8df1c637c0 100644 (file)
@@ -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
index b423578940b4d94a9c2f2774f0704eecb0a5d386..cbdd4fd72558edb618f0c1756dfcb59b1196fa69 100644 (file)
@@ -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 %>
index 8900b7359ee80861cf92b8070063b2990aaac265..e401a4a2af90893005a39bdfad5aec447b96a7f5 100644 (file)
@@ -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 %>
index 5c174e05b4e2905b6ce7389e7312a4a008a0280a..d5babe331c6894bce10a301a3b7e2434852bbd8c 100644 (file)
@@ -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">