mirror of
https://github.com/redmine/redmine.git
synced 2026-05-07 19:16:22 +02:00
Add description for issue statuses and display them in issue new/edit form (#2568).
Patch by Takenori TAKAKI. git-svn-id: https://svn.redmine.org/redmine/trunk@22288 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -31,6 +31,7 @@ class IssueStatus < ActiveRecord::Base
|
||||
validates_presence_of :name
|
||||
validates_uniqueness_of :name, :case_sensitive => true
|
||||
validates_length_of :name, :maximum => 30
|
||||
validates_length_of :description, :maximum => 255
|
||||
validates_inclusion_of :default_done_ratio, :in => 0..100, :allow_nil => true
|
||||
|
||||
scope :sorted, lambda {order(:position)}
|
||||
@@ -38,6 +39,7 @@ class IssueStatus < ActiveRecord::Base
|
||||
|
||||
safe_attributes(
|
||||
'name',
|
||||
'description',
|
||||
'is_closed',
|
||||
'position',
|
||||
'default_done_ratio')
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
<div class="box tabular">
|
||||
<p><%= f.text_field :name, :required => true %></p>
|
||||
<p><%= f.text_area :description, :rows => 4 %></p>
|
||||
<% if Issue.use_status_for_done_ratio? %>
|
||||
<p><%= f.select :default_done_ratio, ((0..10).to_a.collect {|r| ["#{r*10} %", r*10] }), :include_blank => true, :label => :field_done_ratio %></p>
|
||||
<% end %>
|
||||
|
||||
@@ -4,6 +4,7 @@ api.array :issue_statuses do
|
||||
api.id status.id
|
||||
api.name status.name
|
||||
api.is_closed status.is_closed
|
||||
api.description status.description
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<th><%=l(:field_done_ratio)%></th>
|
||||
<% end %>
|
||||
<th><%=l(:field_is_closed)%></th>
|
||||
<th><%=l(:field_description)%></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr></thead>
|
||||
@@ -23,6 +24,7 @@
|
||||
<td><%= status.default_done_ratio %></td>
|
||||
<% end %>
|
||||
<td><%= checked_image status.is_closed? %></td>
|
||||
<td class="description"><%= status.description %></td>
|
||||
<td>
|
||||
<% unless WorkflowTransition.where('old_status_id = ? OR new_status_id = ?', status.id, status.id).exists? %>
|
||||
<span class="icon icon-warning">
|
||||
|
||||
@@ -5,11 +5,14 @@
|
||||
<% if @issue.safe_attribute?('status_id') && @allowed_statuses.present? %>
|
||||
<p>
|
||||
<%= f.select :status_id, (@allowed_statuses.collect {|p| [p.name, p.id]}), {:required => true},
|
||||
:onchange => "updateIssueFrom('#{escape_javascript(update_issue_form_path(@project, @issue))}', this)" %>
|
||||
:onchange => "updateIssueFrom('#{escape_javascript(update_issue_form_path(@project, @issue))}', this)",
|
||||
:title => @issue.status.description %>
|
||||
<%= content_tag 'a', l(:label_open_issue_statuses_description), :class => 'icon-only icon-help', :title => l(:label_open_issue_statuses_description), :onclick => "showModal('issue_statuses_description', '500px'); return false;", :href => '#' if @allowed_statuses.any? {|s| s.description.present? } %>
|
||||
<% if @issue.transition_warning %>
|
||||
<span class="icon-only icon-warning" title="<%= @issue.transition_warning %>"><%= @issue.transition_warning %></span>
|
||||
<% end %>
|
||||
</p>
|
||||
<%= render partial: 'issues/issue_status_description', locals: { issue_statuses: @allowed_statuses } %>
|
||||
<%= hidden_field_tag 'was_default_status', @issue.status_id, :id => nil if @issue.status == @issue.default_status %>
|
||||
<% else %>
|
||||
<p><label><%= l(:field_status) %></label> <%= @issue.status %></p>
|
||||
|
||||
Reference in New Issue
Block a user