redmine_issue_colors_and_icons_v5.diff

Patch for issue colors - Version 5 - Daniel Felix, 2013-04-23 12:05

Download (22.7 KB)

View differences:

app/helpers/application_helper.rb
1031 1031
        (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : ''.html_safe) +
1032 1032
        (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
1033 1033
        (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
1034
      ), :class => 'progress', :style => "width: #{width};").html_safe +
1034
      ), :class => "progress progress-#{pcts[0]}", :style => "width: #{width};").html_safe +
1035 1035
      content_tag('p', legend, :class => 'percent').html_safe
1036 1036
  end
1037 1037

  
app/models/issue.rb
961 961

  
962 962
  # Returns a string of css classes that apply to the issue
963 963
  def css_classes
964
    s = "issue tracker-#{tracker_id} status-#{status_id} #{priority.try(:css_classes)}"
964
    s = "issue tracker-#{tracker_id} tracker-#{tracker.name.downcase} status-#{status_id} status-#{status.name.downcase} #{priority.try(:css_classes)}"
965
    s << ' open' unless closed?
965 966
    s << ' closed' if closed?
967
    s << ' timed' unless due_date.blank?
966 968
    s << ' overdue' if overdue?
967 969
    s << ' child' if child?
968 970
    s << ' parent' unless leaf?
app/views/issues/show.html.erb
1 1
<%= render :partial => 'action_menu' %>
2 2

  
3
<h2><%= issue_heading(@issue) %></h2>
3
<h2 class="<%= 'tracker tracker-'+@issue.tracker_id.to_s+' tracker-'+@issue.tracker.name.downcase %>"><%= issue_heading(@issue) %></h2>
4 4

  
5 5
<div class="<%= @issue.css_classes %> details">
6 6
  <% if @prev_issue_id || @next_issue_id %>
......
21 21

  
22 22
  <%= avatar(@issue.author, :size => "50") %>
23 23

  
24
<div class="subject">
25
<%= render_issue_subject_with_tree(@issue) %>
26
</div>
27
        <p class="author">
28
        <%= authoring @issue.created_on, @issue.author %>.
29
        <% if @issue.created_on != @issue.updated_on %>
30
        <%= l(:label_updated_time, time_tag(@issue.updated_on)).html_safe %>.
31
        <% end %>
32
        </p>
33

  
34
<table class="attributes">
35
<%= issue_fields_rows do |rows|
36
  rows.left l(:field_status), h(@issue.status.name), :class => 'status'
37
  rows.left l(:field_priority), h(@issue.priority.name), :class => 'priority'
38

  
39
  unless @issue.disabled_core_fields.include?('assigned_to_id')
40
    rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
41
  end
42
  unless @issue.disabled_core_fields.include?('category_id')
43
    rows.left l(:field_category), h(@issue.category ? @issue.category.name : "-"), :class => 'category'
44
  end
45
  unless @issue.disabled_core_fields.include?('fixed_version_id')
46
    rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version'
47
  end
48

  
49
  unless @issue.disabled_core_fields.include?('start_date')
50
    rows.right l(:field_start_date), format_date(@issue.start_date), :class => 'start-date'
51
  end
52
  unless @issue.disabled_core_fields.include?('due_date')
53
    rows.right l(:field_due_date), format_date(@issue.due_date), :class => 'due-date'
54
  end
55
  unless @issue.disabled_core_fields.include?('done_ratio')
56
    rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%"), :class => 'progress'
57
  end
58
  unless @issue.disabled_core_fields.include?('estimated_hours')
59
    unless @issue.estimated_hours.nil?
60
      rows.right l(:field_estimated_hours), l_hours(@issue.estimated_hours), :class => 'estimated-hours'
61
    end
62
  end
63
  if User.current.allowed_to?(:view_time_entries, @project)
64
    rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? link_to(l_hours(@issue.total_spent_hours), project_issue_time_entries_path(@project, @issue)) : "-"), :class => 'spent-time'
65
  end
66
end %>
67
<%= render_custom_fields_rows(@issue) %>
68
<%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
69
</table>
70

  
71
<% if @issue.description? || @issue.attachments.any? -%>
72
<hr />
73
<% if @issue.description? %>
74
<div class="description">
75
  <div class="contextual">
76
  <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
24
  <div class="subject">
25
    <%= render_issue_subject_with_tree(@issue) %>
77 26
  </div>
27
  
28
  <p class="author">
29
    <%= authoring @issue.created_on, @issue.author %>.
30
    <% if @issue.created_on != @issue.updated_on %>
31
    <%= l(:label_updated_time, time_tag(@issue.updated_on)).html_safe %>.
32
    <% end %>
33
  </p>
34

  
35
  <table class="attributes">
36
    <%= issue_fields_rows do |rows|
37
      rows.left l(:field_status), h(@issue.status.name), :class => 'status status-'+@issue.status.name.downcase+' status-'+@issue.status_id.to_s
38
      rows.left l(:field_priority), h(@issue.priority.name), :class => 'priority priority-'+@issue.priority.name.downcase+' priority-'+@issue.priority_id.to_s
39

  
40
      unless @issue.disabled_core_fields.include?('assigned_to_id')
41
        rows.left l(:field_assigned_to), avatar(@issue.assigned_to, :size => "14").to_s.html_safe + (@issue.assigned_to ? link_to_user(@issue.assigned_to) : "-"), :class => 'assigned-to'
42
      end
43
      unless @issue.disabled_core_fields.include?('category_id')
44
        rows.left l(:field_category), h(@issue.category ? @issue.category.name : "-"), :class => 'category'
45
      end
46
      unless @issue.disabled_core_fields.include?('fixed_version_id')
47
        rows.left l(:field_fixed_version), (@issue.fixed_version ? link_to_version(@issue.fixed_version) : "-"), :class => 'fixed-version'
48
      end
49

  
50
      unless @issue.disabled_core_fields.include?('start_date')
51
        rows.right l(:field_start_date), format_date(@issue.start_date), :class => 'start-date'
52
      end
53
      unless @issue.disabled_core_fields.include?('due_date')
54
        rows.right l(:field_due_date), format_date(@issue.due_date), :class => 'due-date'
55
      end
56
      unless @issue.disabled_core_fields.include?('done_ratio')
57
        rows.right l(:field_done_ratio), progress_bar(@issue.done_ratio, :width => '80px', :legend => "#{@issue.done_ratio}%"), :class => 'progress'
58
      end
59
      unless @issue.disabled_core_fields.include?('estimated_hours')
60
        unless @issue.estimated_hours.nil?
61
          rows.right l(:field_estimated_hours), l_hours(@issue.estimated_hours), :class => 'estimated-hours'
62
        end
63
      end
64
      if User.current.allowed_to?(:view_time_entries, @project)
65
        rows.right l(:label_spent_time), (@issue.total_spent_hours > 0 ? link_to(l_hours(@issue.total_spent_hours), project_issue_time_entries_path(@project, @issue)) : "-"), :class => 'spent-time'
66
      end
67
    end %>
68
    <%= render_custom_fields_rows(@issue) %>
69
    <%= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
70
  </table>
71

  
72
  <% if @issue.description? || @issue.attachments.any? -%>
73
  <hr />
74
  <% if @issue.description? %>
75
  <div class="description">
76
    <div class="contextual">
77
      <%= link_to l(:button_quote), quoted_issue_path(@issue), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %>
78
    </div>
78 79

  
79
  <p><strong><%=l(:field_description)%></strong></p>
80
  <div class="wiki">
81
  <%= textilizable @issue, :description, :attachments => @issue.attachments %>
80
    <p><strong><%=l(:field_description)%></strong></p>
81
    <div class="wiki">
82
      <%= textilizable @issue, :description, :attachments => @issue.attachments %>
83
    </div>
82 84
  </div>
83
</div>
84
<% end %>
85
<%= link_to_attachments @issue, :thumbnails => true %>
85
  <% end %>
86
  <%= link_to_attachments @issue, :thumbnails => true %>
86 87
<% end -%>
87 88

  
88 89
<%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %>
......
155 156
    <%= auto_discovery_link_tag(:atom, {:format => 'atom', :key => User.current.rss_key}, :title => "#{@issue.project} - #{@issue.tracker} ##{@issue.id}: #{@issue.subject}") %>
156 157
<% end %>
157 158

  
158
<%= context_menu issues_context_menu_path %>
159
<%= context_menu issues_context_menu_path %>
app/views/versions/index.html.erb
20 20
    <% issues.each do |issue| -%>
21 21
      <tr class="hascontextmenu">
22 22
        <td class="checkbox"><%= check_box_tag 'ids[]', issue.id, false, :id => nil %></td>
23
        <td><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
23
        <td class="issue"><%= link_to_issue(issue, :project => (@project != issue.project)) %></td>
24 24
      </tr>
25 25
    <% end -%>
26 26
    </table>
......
65 65

  
66 66
<% html_title(l(:label_roadmap)) %>
67 67

  
68
<%= context_menu issues_context_menu_path %>
68
<%= context_menu issues_context_menu_path %>
public/stylesheets/application.css
121 121

  
122 122
a#toggle-completed-versions {color:#999;}
123 123
/***** Tables *****/
124
table.list { border: 1px solid #e4e4e4;  border-collapse: collapse; width: 100%; margin-bottom: 4px; }
124
table.list { border: 1px solid #e4e4e4; border-collapse: collapse; table-layout:fixed; min-width:100%; width:auto; margin-bottom: 4px; }
125
table.list tr a{ white-space:nowrap; }
125 126
table.list th {  background-color:#EEEEEE; padding: 4px; white-space:nowrap; }
126 127
table.list td { vertical-align: top; padding-right:10px; }
127
table.list td.id { width: 2%; text-align: center;}
128
table.list td, table.list tr:hover td{border:1px solid #d7d7d7;}
129
table.list td.id { text-align: center;}
128 130
table.list td.checkbox { width: 15px; padding: 2px 0 0 0; }
129 131
table.list td.checkbox input {padding:0px;}
130 132
table.list td.buttons { width: 15%; white-space:nowrap; text-align: right; }
......
165 167
tr.issue.idnt-8 td.subject {padding-left: 11em;}
166 168
tr.issue.idnt-9 td.subject {padding-left: 12.5em;}
167 169

  
170
/* Issue priority colors */
171
/* default */
172
tr.issue.odd td, tr.issue.even td{color:#484848; padding: 5px;}
173
tr.issue.context-menu-selection.odd td, tr.issue.context-menu-selection.even td{color:#F8F8F8; padding: 5px;}
174
/* special color fields */
175
tr.issue.odd td.priority, tr.issue.even td.priority,
176
tr.issue.odd td.status, tr.issue.even td.status{color:#484848;}
177

  
178
/* low */
179
tr.issue.odd.priority-1 td.priority{background-color:#d6ffd0;border-color: #a5d690;}
180
tr.issue.even.priority-1 td.priority{background-color:#e2ffde;border-color: #a5d690;}
181
/* normal */
182
tr.issue.odd.priority-2 td.priority{background-color:#eaf7ff;border-color: #add7f3;}
183
tr.issue.even.priority-2 td.priority{background-color:#f2faff;border-color: #add7f3;}
184
/* high */
185
tr.issue.odd.priority-3 td.priority{background-color:#fffbca;border-color: #d7d290;}
186
tr.issue.even.priority-3 td.priority{background-color:#fffcdb;border-color: #d7d290;}
187
/* urgent */
188
tr.issue.odd.priority-4 td.priority{background-color:#FF7777;border-color:#FF8888;}
189
tr.issue.even.priority-4 td.priority{background-color: #FF9999;border-color:#FFA0A0;}
190
/* immediate */
191
tr.issue.odd.priority-5 td.priority{background-color:#FF7777;border-color: #FF8888;}
192
tr.issue.even.priority-5 td.priority{background-color:#FF9999;border-color: #FFA0A0;}
193

  
194
/* Issue status colors */
195
/* new */
196
tr.issue.odd.status-1 td.status{background-color:#eaf7ff;border-color:#add7f3;font-weight:bold;}
197
tr.issue.even.status-1 td.status{background-color:#f2faff;border-color:#add7f3;font-weight:bold;}
198
/* in progress */
199
tr.issue.odd.status-2 td.status{background-color:#fffbca;border-color:#d7d290;}
200
tr.issue.even.status-2 td.status{background-color:#fffcdb;border-color:#d7d290;}
201
/* resolved */ 
202
tr.issue.odd.status-3 td.status{background-color:#d6ffd0;border-color:#a5d690;font-style: italic;}
203
tr.issue.even.status-3 td.status{background-color:#e2ffde;border-color:#a5d690;font-style: italic;}
204
/* feedback */
205
tr.issue.odd.status-4 td.status{background-color:#d6ffd0;border-color:#a5d690;}
206
tr.issue.even.status-4 td.status{background-color:#e2ffde;border-color:#a5d690;}
207
/* closed */
208
tr.issue.odd.status-5 td.status{background-color:#d6ffd0;border-color:#a5d690;}
209
tr.issue.even.status-5 td.status{background-color:#e2ffde;border-color:#a5d690;}
210
/* rejected */
211
tr.issue.odd.status-6 td.status{background-color:#FF9999;border-color:#FF8888;}
212
tr.issue.even.status-6 td.status{background-color:#FFA5A5;border-color:#FFA0A0;}
213

  
214
/* issue tracker icons */
215
/* default */
216
tr.issue td.tracker:before, table.related-issues td.issue a:before,
217
h2.tracker:before{content:"";display:-moz-inline-box;display:inline-block;width:16px;height:16px;margin:0 2px 0 5px;}
218
h2.tracker:before{margin:4px 2px 0 0;}
219
select#issue_tracker_id option{padding-left:20px;}
220
tr.issue td.tracker:before, table.related-issues td.issue a:before,
221
h2.tracker:before,select#issue_tracker_id option{background:url("../images/page_white.png") no-repeat;}
222

  
223
/* bug */
224
tr.issue.tracker-1 td.tracker:before, table.related-issues td.issue a.tracker-1:before,
225
h2.tracker.tracker-1:before,select#issue_tracker_id option[value="1"]{background:url("../images/bug.png") no-repeat;}
226
/* feature */
227
tr.issue.tracker-2 td.tracker:before, table.related-issues td.issue a.tracker-2:before,
228
h2.tracker.tracker-2:before,select#issue_tracker_id option[value="2"]{background:url("../images/brick_add.png") no-repeat;}
229
/* support */
230
tr.issue.tracker-3 td.tracker:before, table.related-issues td.issue a.tracker-3:before,
231
h2.tracker.tracker-3:before,select#issue_tracker_id option[value="3"]{background:url("../images/shield.png") no-repeat;}
232

  
233
/* issue assigned_to */
234
tr.issue td.assigned_to a:before{content:"";display:-moz-inline-box;display:inline-block;width:16px;height:16px;margin:0 2px 0 5px;}
235
tr.issue td.assigned_to a:after{content:"";display:-moz-inline-box;display:inline-block;width:16px;height:16px;margin:0 5px 0 2px;}
236
tr.issue.created-by-me td.assigned_to a:before{background:url("../images/created_by_me.png") no-repeat;}
237
tr.issue.assigned-to-me td.assigned_to a:after{background:url("../images/assigned_to_me.png") no-repeat;}
238

  
239
/* issue due_date */
240
tr.issue td.id:before{content:"";display:-moz-inline-box;display:inline-block;width:16px;height:16px;margin-right:2px;background:url("../images/issue.png") no-repeat;}
241
tr.issue.open.timed td.id:before{background:url("../images/clock.png") no-repeat;}
242
tr.issue.open.overdue td.id:before{background:url("../images/clock_red.png") no-repeat;}
243
tr.issue.open.overdue td.id a,tr.issue.open.overdue td.due_date{color:#FF3333;}
244
tr.issue.private td.id:before{background:url("../images/private.png") no-repeat;}
245
tr.issue.closed td.id:before{background:url("../images/lock.png") no-repeat;}
246

  
247
body.admin #header{background-color:#628DB6;background-repeat:repeat;background-size:15px 15px;background-image:linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);}
248

  
168 249
tr.entry { border: 1px solid #f8f8f8; }
169 250
tr.entry td { white-space: nowrap; }
170 251
tr.entry td.filename { width: 30%; }
......
279 360
span.search_for_watchers, span.add_attachment {font-size:80%; line-height:2.5em;}
280 361
span.search_for_watchers a, span.add_attachment a {padding-left:16px; background: url(../images/bullet_add.png) no-repeat 0 50%; }
281 362

  
282

  
283 363
.highlight { background-color: #FCFD8D;}
284 364
.highlight.token-1 { background-color: #faa;}
285 365
.highlight.token-2 { background-color: #afa;}
......
318 398
acronym  { border-bottom: 1px dotted; cursor: help; }
319 399
textarea.wiki-edit {width:99%; resize:vertical;}
320 400
li p {margin-top: 0;}
321
div.issue {background:#ffffdd; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
401
div.issue {background:#F8F8F8; padding:6px; margin-bottom:6px;border: 1px solid #d7d7d7;}
322 402
p.breadcrumb { font-size: 0.9em; margin: 4px 0 4px 0;}
323 403
p.subtitle { font-size: 0.9em; margin: -6px 0 12px 0; font-style: italic; }
324 404
p.footnote { font-size: 0.9em; margin-top: 0px; margin-bottom: 0px; }
......
327 407
div.issue div.subject p {margin: 0; margin-bottom: 0.1em; font-size: 90%; color: #999;}
328 408
div.issue div.subject>div>p { margin-top: 0.5em; }
329 409
div.issue div.subject h3 {margin: 0; margin-bottom: 0.1em;}
330
div.issue span.private { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
410
div.issue span.private { position:relative; bottom: 2px; text-transform: uppercase; background: #d22; color: #fff; font-weight:bold; padding: 0px 2px; font-size: 60%; margin-right: 2px; border-radius: 2px;}
331 411
div.issue .next-prev-links {color:#999;}
332 412
div.issue table.attributes th {width:22%;}
333 413
div.issue table.attributes td {width:28%;}
334

  
414
/* Highlight for priority and status in issue#show */
415
div.issue td.priority,div.issue td.status{display:inline;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius: 5px;padding: 2px 5px;color:#484848;}
416
div.issue td.status-1{background-color:#eaf7ff;}
417
div.issue td.status-2{background-color:#fffbca;}
418
div.issue td.status-3{background-color:#d6ffd0;}
419
div.issue td.status-4{background-color:#d6ffd0;}
420
div.issue td.status-5{background-color:#d6ffd0;}
421
div.issue td.status-6{background-color:#FF9999;}
422
div.issue td.priority-1{background-color:#d6ffd0;}
423
div.issue td.priority-2{background-color:#eaf7ff;}
424
div.issue td.priority-3{background-color:#fffbca;}
425
div.issue td.priority-4{background-color:#FF9999;}
426
div.issue td.priority-5{background-color:#FF9999;}
427
r
335 428
#issue_tree table.issues, #relations table.issues { border: 0; }
336 429
#issue_tree td.checkbox, #relations td.checkbox {display:none;}
337 430
#relations td.buttons {padding:0;}
......
692 785
}
693 786

  
694 787
/***** Progress bar *****/
695
table.progress {
696
  border-collapse: collapse;
697
  border-spacing: 0pt;
698
  empty-cells: show;
699
  text-align: center;
700
  float:left;
701
  margin: 1px 6px 1px 0px;
702
}
703

  
704
table.progress td { height: 1em; }
705
table.progress td.closed { background: #BAE0BA none repeat scroll 0%; }
706
table.progress td.done { background: #D3EDD3 none repeat scroll 0%; }
707
table.progress td.todo { background: #eee none repeat scroll 0%; }
788
table.progress{border-collapse:collapse;border-spacing:0pt;empty-cells:show;text-align:center;float:left;margin:1px 6px 1px 0px;}
789

  
790
table.progress td{height:5px;}
791
table.progress td.closed{background-color:#628DB6}
792
table.progress.progress-10 td.closed{background-color:#ec0a0a}
793
table.progress.progress-20 td.closed{background-color:#ec650a}
794
table.progress.progress-30 td.closed{background-color:#ecb00a}
795
table.progress.progress-40 td.closed{background-color:#ddec0a}
796
table.progress.progress-50 td.closed{background-color:#7bec0a}
797
table.progress.progress-60 td.closed{background-color:#21ec0a}
798
table.progress.progress-70 td.closed{background-color:#43ec0a}
799
table.progress.progress-80 td.closed{background-color:#09c7a5}
800
table.progress.progress-90 td.closed{background-color:#51b5d7}
801
table.progress.progress-100 td.closed{background-color:#628DB6}
802

  
803
table.progress td.done{background-color:#7CB2E6}
804
table.progress td.todo{background-color:#EEE}
708 805
p.percent {font-size: 80%;}
709 806
p.progress-info {clear: left; font-size: 80%; margin-top:-4px; color:#777;}
710 807

  
......
1151 1248
  width:1px;
1152 1249
  height:1px;
1153 1250
  overflow:hidden;
1154
}
1251
}