]> source.dussan.org Git - redmine.git/commitdiff
Add missing files in r22289 (#2568).
authorGo MAEDA <maeda@farend.jp>
Thu, 31 Aug 2023 23:30:11 +0000 (23:30 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 31 Aug 2023 23:30:11 +0000 (23:30 +0000)
git-svn-id: https://svn.redmine.org/redmine/trunk@22290 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/views/issues/_issue_status_description.html.erb [new file with mode: 0644]
db/migrate/20230818020734_add_status_description.rb [new file with mode: 0644]

diff --git a/app/views/issues/_issue_status_description.html.erb b/app/views/issues/_issue_status_description.html.erb
new file mode 100644 (file)
index 0000000..4b67d3d
--- /dev/null
@@ -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 (file)
index 0000000..be1b142
--- /dev/null
@@ -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