Project

General

Profile

Patch #21497 » tool-tip-on-progress-bar.diff

patch - Go MAEDA, 2015-12-13 04:38

View differences:

app/helpers/application_helper.rb (working copy)
1108 1108
    pcts = pcts.collect(&:round)
1109 1109
    pcts[1] = pcts[1] - pcts[0]
1110 1110
    pcts << (100 - pcts[1] - pcts[0])
1111
    titles = options[:titles].to_a
1112
    titles[0] = "#{pcts[0]}%" if titles[0].blank?
1111 1113
    legend = options[:legend] || ''
1112 1114
    content_tag('table',
1113 1115
      content_tag('tr',
1114
        (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed') : ''.html_safe) +
1115
        (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done') : ''.html_safe) +
1116
        (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo') : ''.html_safe)
1116
        (pcts[0] > 0 ? content_tag('td', '', :style => "width: #{pcts[0]}%;", :class => 'closed', :title => titles[0]) : ''.html_safe) +
1117
        (pcts[1] > 0 ? content_tag('td', '', :style => "width: #{pcts[1]}%;", :class => 'done', :title => titles[1]) : ''.html_safe) +
1118
        (pcts[2] > 0 ? content_tag('td', '', :style => "width: #{pcts[2]}%;", :class => 'todo', :title => titles[2]) : ''.html_safe)
1117 1119
      ), :class => "progress progress-#{pcts[0]}").html_safe +
1118 1120
      content_tag('p', legend, :class => 'percent').html_safe
1119 1121
  end
app/views/versions/_overview.html.erb (working copy)
16 16

  
17 17
<% if version.issues_count > 0 %>
18 18
    <%= progress_bar([version.closed_percent, version.completed_percent],
19
                     :titles =>
20
                       ["%s: %0.0f%" % [l(:label_closed_issues_plural), version.closed_percent],
21
                        "%s: %0.0f%" % [l(:label_done_ratio), version.completed_percent]],
19 22
                     :legend => ('%0.0f%' % version.completed_percent)) %>
20 23
    <p class="progress-info">
21 24
      <%= link_to(l(:label_x_issues, :count => version.issues_count),
config/locales/en.yml (working copy)
975 975
  label_create_missing_values: Create missing values
976 976
  label_api: API
977 977
  label_field_format_enumeration: Key/value list
978
  label_done_ratio: "Done ratio"
978 979

  
979 980
  button_login: Login
980 981
  button_submit: Submit
(1-1/3)