]> source.dussan.org Git - redmine.git/commitdiff
Adds more css classes to the roadmap issues (#3214).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 25 Apr 2009 11:28:48 +0000 (11:28 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 25 Apr 2009 11:28:48 +0000 (11:28 +0000)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2694 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
app/helpers/issues_helper.rb
app/models/issue.rb
app/views/common/_calendar.rhtml
app/views/issues/_list.rhtml
app/views/issues/_list_simple.rhtml
app/views/issues/show.rhtml

index 479b2a293c663e708e02ddff2dc40acc4f7e1a55..b7865ecdebc8e6e9eb3855170897430aca3529d3 100644 (file)
@@ -54,9 +54,7 @@ module ApplicationHelper
   end
 
   def link_to_issue(issue, options={})
-    options[:class] ||= ''
-    options[:class] << ' issue'
-    options[:class] << ' closed' if issue.closed?
+    options[:class] ||= issue.css_classes
     link_to "#{issue.tracker.name} ##{issue.id}", {:controller => "issues", :action => "show", :id => issue}, options
   end
 
index 7eae3314c31e18c1243425fb646ec36fede7ee56..a85a83a23af0211f47274aa7bb77425f32ba5299 100644 (file)
@@ -33,16 +33,6 @@ 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 << ' closed' if issue.closed?
-    s << ' overdue' if issue.overdue?
-    s << ' created-by-me' if User.current.logged? && issue.author_id == User.current.id
-    s << ' assigned-to-me' if User.current.logged? && issue.assigned_to_id == User.current.id
-    s
-  end
-  
   def sidebar_queries
     unless @sidebar_queries
       # User can see public queries and his own queries
index c3627ddb217e5090f7a32c48cc57e87c4974abf8..23035b92729145e24ddf99f2cc7a7eb1c2a11ea8 100644 (file)
@@ -269,6 +269,16 @@ class Issue < ActiveRecord::Base
     "#{tracker} ##{id}: #{subject}"
   end
   
+  # Returns a string of css classes that apply to the issue
+  def css_classes
+    s = "issue status-#{status.position} priority-#{priority.position}"
+    s << ' closed' if closed?
+    s << ' overdue' if overdue?
+    s << ' created-by-me' if User.current.logged? && author_id == User.current.id
+    s << ' assigned-to-me' if User.current.logged? && assigned_to_id == User.current.id
+    s
+  end
+  
   private
   
   # Callback on attachment deletion
index f3d02d433ec42b7a63d33ed535dd7d802758b88c..d8a7f408853ad33cc7e08a5139184fca88f369cd 100644 (file)
@@ -11,7 +11,7 @@ while day <= calendar.enddt %>
 <p class="day-num"><%= day.day %></p>  
 <% calendar.events_on(day).each do |i| %>
   <% if i.is_a? Issue %>
-  <div class="<%= css_issue_classes(i) %> tooltip">
+  <div class="<%= i.css_classes %> tooltip">
   <%= if day == i.start_date && day == i.due_date
         image_tag('arrow_bw.png')
       elsif day == i.start_date
index 93267601552db7684ca6583edda2a85277dd6bdc..b19e1d7191eafa166e963247d7f219370e8c21b8 100644 (file)
@@ -11,7 +11,7 @@
        </tr></thead>
        <tbody>
        <% issues.each do |issue| -%>
-       <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= css_issue_classes(issue) %>">
+       <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
            <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 3391e0735aabe8ff5babdf18e666a98d35eb4d02..f57b19e844ec6fe3cbf0b6057a5f0e54129743ba 100644 (file)
@@ -9,7 +9,7 @@
                </tr></thead>
                <tbody> 
                <% for issue in issues %>
-               <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= css_issue_classes(issue) %>">
+               <tr id="issue-<%= issue.id %>" class="hascontextmenu <%= cycle('odd', 'even') %> <%= issue.css_classes %>">
                        <td class="id">
                          <%= check_box_tag("ids[]", issue.id, false, :style => 'display:none;') %>
                                <%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %>
index ed14fe3f857c4746e4f8c6a6ae7537c18d49c9f3..bd0eec41fe7f5fb5b08ce4b33eb33a292316522c 100644 (file)
@@ -9,7 +9,7 @@
 
 <h2><%= @issue.tracker.name %> #<%= @issue.id %></h2>
 
-<div class="<%= css_issue_classes(@issue) %> details">
+<div class="<%= @issue.css_classes %> details">
         <%= avatar(@issue.author, :size => "64") %>
         <h3><%=h @issue.subject %></h3>
         <p class="author">