Feature #31756 » 31756-v3.patch
app/views/issue_statuses/_form.html.erb | ||
---|---|---|
4 | 4 |
<p><%= f.text_field :name, :required => true %></p> |
5 | 5 |
<p><%= f.text_area :description, :rows => 4 %></p> |
6 | 6 |
<% if Issue.use_status_for_done_ratio? %> |
7 |
<p><%= f.select :default_done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :include_blank => true, :label => :field_done_ratio %></p>
|
|
7 |
<p><%= f.select :default_done_ratio, ((0..100).step(Setting.issue_done_ratio_step_size.to_i).to_a.collect {|r| ["#{r} %", r]}), :include_blank => true, :label => :field_done_ratio %></p>
|
|
8 | 8 |
<% end %> |
9 | 9 |
<p><%= f.check_box :is_closed %></p> |
10 | 10 |
app/views/issues/_attributes.html.erb | ||
---|---|---|
88 | 88 |
<% end %> |
89 | 89 | |
90 | 90 |
<% if @issue.safe_attribute?('done_ratio') && Issue.use_field_for_done_ratio? %> |
91 |
<p><%= f.select :done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :required => @issue.required_attribute?('done_ratio') %></p>
|
|
91 |
<p><%= f.select :done_ratio, ((0..100).step(Setting.issue_done_ratio_step_size.to_i).to_a.collect {|r| ["#{r} %", r]}), :required => @issue.required_attribute?('done_ratio') %></p>
|
|
92 | 92 |
<% end %> |
93 | 93 |
</div> |
94 | 94 |
</div> |
app/views/issues/bulk_edit.html.erb | ||
---|---|---|
178 | 178 |
<% if @safe_attributes.include?('done_ratio') && Issue.use_field_for_done_ratio? %> |
179 | 179 |
<p> |
180 | 180 |
<label for='issue_done_ratio'><%= l(:field_done_ratio) %></label> |
181 |
<%= select_tag 'issue[done_ratio]', options_for_select([[l(:label_no_change_option), '']] + (0..10).to_a.collect {|r| ["#{r*10} %", r*10] }, @issue_params[:done_ratio]) %>
|
|
181 |
<%= select_tag 'issue[done_ratio]', options_for_select([[l(:label_no_change_option), '']] + (0..100).step(Setting.issue_done_ratio_step_size.to_i).to_a.collect {|r| ["#{r} %", r]}, @issue_params[:done_ratio]) %>
|
|
182 | 182 |
</p> |
183 | 183 |
<% end %> |
184 | 184 |
</div> |
app/views/settings/_issues.html.erb | ||
---|---|---|
17 | 17 | |
18 | 18 |
<p><%= setting_select :issue_done_ratio, Issue::DONE_RATIO_OPTIONS.collect {|i| [l("setting_issue_done_ratio_#{i}"), i]} %></p> |
19 | 19 | |
20 |
<p><%= setting_select :issue_done_ratio_step_size, [5, 10].collect {|i| ["#{i} %", i]} %></p> |
|
21 | ||
20 | 22 |
<p><%= setting_multiselect :non_working_week_days, (1..7).map {|d| [day_name(d), d.to_s]}, :inline => true %></p> |
21 | 23 | |
22 | 24 |
<p><%= setting_text_field :issues_export_limit, :size => 6 %></p> |
app/views/settings/_repositories.html.erb | ||
---|---|---|
114 | 114 |
<%= select_tag("settings[commit_update_keywords][done_ratio][]", |
115 | 115 |
options_for_select( |
116 | 116 |
[["", ""]] + |
117 |
(0..10).to_a.collect {|r| ["#{r*10} %", "#{r*10}"] },
|
|
117 |
(0..100).step(Setting.issue_done_ratio_step_size.to_i).to_a.collect {|r| ["#{r} %", r]},
|
|
118 | 118 |
rule['done_ratio']), |
119 | 119 |
:id => nil |
120 | 120 |
) %> |
config/locales/en.yml | ||
---|---|---|
477 | 477 |
setting_default_projects_modules: Default enabled modules for new projects |
478 | 478 |
setting_issue_done_ratio: Calculate the issue done ratio with |
479 | 479 |
setting_issue_done_ratio_issue_field: Use the issue field |
480 |
setting_issue_done_ratio_step_size: Done ratio options step size |
|
480 | 481 |
setting_issue_done_ratio_issue_status: Use the issue status |
481 | 482 |
setting_start_of_week: Start calendars on |
482 | 483 |
setting_rest_api_enabled: Enable REST web service |
config/settings.yml | ||
---|---|---|
256 | 256 |
default: '' |
257 | 257 |
issue_done_ratio: |
258 | 258 |
default: 'issue_field' |
259 |
issue_done_ratio_step_size: |
|
260 |
format: int |
|
261 |
default: 10 |
|
259 | 262 |
default_projects_public: |
260 | 263 |
default: 1 |
261 | 264 |
default_projects_modules: |
test/functional/issues_controller_test.rb | ||
---|---|---|
8736 | 8736 |
end |
8737 | 8737 |
end |
8738 | 8738 |
end |
8739 | ||
8740 |
def test_get_new_with_issue_field_five_percent_increments |
|
8741 |
with_settings :issue_done_ratio => 'issue_field', :issue_done_ratio_step_size => 5 do |
|
8742 |
@request.session[:user_id] = 1 |
|
8743 |
get :new |
|
8744 |
assert_response :success |
|
8745 | ||
8746 |
assert_select 'select#issue_done_ratio' do |
|
8747 |
assert_select 'option', count: 21 |
|
8748 |
assert_select 'option:nth-of-type(1)', text: '0 %' |
|
8749 |
assert_select 'option:nth-of-type(2)', text: '5 %' |
|
8750 |
assert_select 'option:nth-of-type(21)', text: '100 %' |
|
8751 |
end |
|
8752 |
end |
|
8753 |
end |
|
8739 | 8754 |
end |
- « Previous
- 1
- …
- 6
- 7
- 8
- Next »