From: Jean-Philippe Lang Date: Sat, 25 Apr 2009 11:28:48 +0000 (+0000) Subject: Adds more css classes to the roadmap issues (#3214). X-Git-Tag: 0.9.0~502 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=32c09fd5cfe4a5973cc52b298d7cd193e3981240;p=redmine.git Adds more css classes to the roadmap issues (#3214). git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2694 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 479b2a293..b7865ecde 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/helpers/issues_helper.rb b/app/helpers/issues_helper.rb index 7eae3314c..a85a83a23 100644 --- a/app/helpers/issues_helper.rb +++ b/app/helpers/issues_helper.rb @@ -33,16 +33,6 @@ module IssuesHelper "#{@cached_label_priority}: #{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 diff --git a/app/models/issue.rb b/app/models/issue.rb index c3627ddb2..23035b927 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -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 diff --git a/app/views/common/_calendar.rhtml b/app/views/common/_calendar.rhtml index f3d02d433..d8a7f4088 100644 --- a/app/views/common/_calendar.rhtml +++ b/app/views/common/_calendar.rhtml @@ -11,7 +11,7 @@ while day <= calendar.enddt %>

<%= day.day %>

<% calendar.events_on(day).each do |i| %> <% if i.is_a? Issue %> -
+
<%= if day == i.start_date && day == i.due_date image_tag('arrow_bw.png') elsif day == i.start_date diff --git a/app/views/issues/_list.rhtml b/app/views/issues/_list.rhtml index 932676015..b19e1d719 100644 --- a/app/views/issues/_list.rhtml +++ b/app/views/issues/_list.rhtml @@ -11,7 +11,7 @@ <% issues.each do |issue| -%> - + <%= check_box_tag("ids[]", issue.id, false, :id => nil) %> <%= link_to issue.id, :controller => 'issues', :action => 'show', :id => issue %> <% 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 3391e0735..f57b19e84 100644 --- a/app/views/issues/_list_simple.rhtml +++ b/app/views/issues/_list_simple.rhtml @@ -9,7 +9,7 @@ <% for issue in issues %> - + <%= 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 ed14fe3f8..bd0eec41f 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -9,7 +9,7 @@

<%= @issue.tracker.name %> #<%= @issue.id %>

-
+
<%= avatar(@issue.author, :size => "64") %>

<%=h @issue.subject %>