<% issue = local_assigns[:issue] || @issue %>
<% new_issue_notice_text = (Setting.plugin_redmine_ux_toolkit || {})['global_new_issue_notice_text'].to_s %>
<% project_notice_text = UxToolkitProjectSetting.notice_text_for(issue&.project).to_s %>
<% tracker_notice_text = UxToolkitTrackerNotice.notice_text_for(issue&.tracker).to_s %>
<% notice_count = [new_issue_notice_text, project_notice_text, tracker_notice_text].count(&:present?) %>

<% if issue&.new_record? %>
  <% if new_issue_notice_text.present? %>
    <div class="box ux-toolkit-new-issue-notice ux-toolkit-new-issue-notice-global">
      <% if notice_count > 1 %>
        <h3><%= l(:label_ux_toolkit_general_instructions) %></h3>
      <% end %>
      <%= textilizable(new_issue_notice_text) %>
    </div>
  <% end %>

  <% if project_notice_text.present? %>
    <div class="box ux-toolkit-new-issue-notice ux-toolkit-new-issue-notice-project">
      <% if notice_count > 1 %>
        <h3><%= l(:label_ux_toolkit_project_instructions) %></h3>
      <% end %>
      <%= simple_format(h(project_notice_text)) %>
    </div>
  <% end %>
<% end %>
