diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 3cac90d..475e57b 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -488,6 +488,7 @@ module ApplicationHelper css << 'theme-' + theme.name end + css << 'project-'+@project.identifier if @project css << 'controller-' + controller_name css << 'action-' + action_name css.join(' ') @@ -1061,7 +1062,7 @@ module ApplicationHelper (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : ''.html_safe) + (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) + (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe) - ), :class => 'progress', :style => "width: #{width};").html_safe + + ), :class => 'progress progress-#{pcts[0]}', :style => "width: #{width};").html_safe + content_tag('p', legend, :class => 'percent').html_safe end diff --git a/app/models/issue.rb b/app/models/issue.rb index d04f5bd..ae2b59d 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -744,6 +744,11 @@ class Issue < ActiveRecord::Base !relations_to.detect {|ir| ir.relation_type == 'blocks' && !ir.issue_from.closed?}.nil? end + # Returns true if this issue has a relation to another preceding issue, which is still open + def follows? + !relations_to.detect {|ir| ir.relation_type == 'precedes' && !ir.issue_from.closed?}.nil? + end + # Returns an array of statuses that user is able to apply def new_statuses_allowed_to(user=User.current, include_default=false) if new_record? && @copied_from @@ -1073,8 +1078,9 @@ class Issue < ActiveRecord::Base # Returns a string of css classes that apply to the issue def css_classes(user=User.current) - s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}" + s = "issue tracker-#{tracker_id} tracker-#{tracker.name.downcase} status-#{status_id} status-#{status.name.downcase} #{priority.try(:css_classes)}" s << ' closed' if closed? + s << ' timed' unless due_date.blank? s << ' overdue' if overdue? s << ' child' if child? s << ' parent' unless leaf? @@ -1084,6 +1090,10 @@ class Issue < ActiveRecord::Base s << ' assigned-to-me' if assigned_to_id == user.id s << ' assigned-to-my-group' if user.groups.any? {|g| g.id = assigned_to_id} end + rel = 'blocked' if blocked? + rel ||= ' follows' if follows? + rel ||= ' free' + s << rel s end diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 83b4f56..8a51e4a 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,6 +1,6 @@ <%= render :partial => 'action_menu' %> -