<% settings = Setting.plugin_redmine_ux_toolkit || {} %>

<p>
  <strong><%= l(:label_ux_toolkit_new_issue_notice) %></strong>
</p>

<p>
  <%= label_tag 'settings_global_new_issue_notice_text',
                l(:label_ux_toolkit_global_new_issue_notice_text) %>
  <%= text_area_tag 'settings[global_new_issue_notice_text]',
                    settings['global_new_issue_notice_text'],
                    id: 'settings_global_new_issue_notice_text',
                    class: 'wiki-edit',
                    data: list_autofill_data_attributes,
                    rows: 8,
                    cols: 80 %>
  <%= wikitoolbar_for 'settings_global_new_issue_notice_text' %>
  <em class="info"><%= l(:text_ux_toolkit_global_new_issue_notice_help) %></em>
  <em class="info"><%= l(:text_ux_toolkit_notice_security_hint) %></em>
</p>

<p>
  <strong><%= l(:label_ux_toolkit_tracker_new_issue_notices) %></strong>
</p>

<p>
  <em class="info"><%= l(:text_ux_toolkit_tracker_new_issue_notice_help) %></em>
  <em class="info"><%= l(:text_ux_toolkit_notice_security_hint) %></em>
</p>

<table class="list ux-toolkit-tracker-notices">
  <thead>
    <tr>
      <th><%= l(:label_tracker) %></th>
      <th><%= l(:label_ux_toolkit_tracker_new_issue_notice_text) %></th>
    </tr>
  </thead>
  <tbody>
    <% Tracker.sorted.each do |tracker| %>
      <% tracker_notice = UxToolkitTrackerNotice.find_by(tracker_id: tracker.id) %>
      <tr>
        <td><%= h(tracker.name) %></td>
        <td>
          <%= text_area_tag "ux_toolkit_tracker_notices[#{tracker.id}][new_issue_notice_text]",
                            tracker_notice&.new_issue_notice_text,
                            id: "ux_toolkit_tracker_notice_#{tracker.id}",
                            rows: 4,
                            cols: 80 %>
        </td>
      </tr>
    <% end %>
  </tbody>
</table>
