diff options
-rw-r--r-- | app/views/issues/_issue_status_description.html.erb | 22 | ||||
-rw-r--r-- | db/migrate/20230818020734_add_status_description.rb | 9 |
2 files changed, 31 insertions, 0 deletions
diff --git a/app/views/issues/_issue_status_description.html.erb b/app/views/issues/_issue_status_description.html.erb new file mode 100644 index 000000000..4b67d3d82 --- /dev/null +++ b/app/views/issues/_issue_status_description.html.erb @@ -0,0 +1,22 @@ +<% if issue_statuses.any? {|s| s.description.present? } %> + <div class="modal" id="issue_statuses_description"> + <h3 class="title"><%= l(:label_issue_statuses_description) %></h3> + <dl> + <% issue_statuses.each do |issue_status| %> + <% if issue_status.description.present? %> + <dt><%= content_tag 'a', issue_status.name, :onclick => "selectIssueStatus('#{issue_status.id}'); return false;", :href => '#', :title => l(:text_select_apply_issue_status) %></dt> + <dd><%= issue_status.description %></dd> + <% end %> + <% end %> + </dl> + </div> +<% end %> +<%= javascript_tag do %> + function selectIssueStatus(id) { + var target = $('#issue_status_id'); + target.attr("selected", false); + target.find('option[value="' + id + '"]').prop('selected', true); + target.trigger('change'); + hideModal('#issue_statuses_description h3'); + } +<% end %> diff --git a/db/migrate/20230818020734_add_status_description.rb b/db/migrate/20230818020734_add_status_description.rb new file mode 100644 index 000000000..be1b1429b --- /dev/null +++ b/db/migrate/20230818020734_add_status_description.rb @@ -0,0 +1,9 @@ +class AddStatusDescription < ActiveRecord::Migration[6.1] + def up + add_column :issue_statuses, :description, :string, :after => :name + end + + def down + remove_column :issue_statuses, :description + end +end |