<% settings = Setting.plugin_redmine_ux_toolkit || {} %>
<% prevent_closing_with_open_checklist_items_enabled = settings.fetch('prevent_closing_with_open_checklist_items', '0').to_s == '1' %>
<% prevent_closing_with_open_subtasks_enabled = settings.fetch('prevent_closing_with_open_subtasks', '0').to_s == '1' %>

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

<p>
  <%= hidden_field_tag 'settings[prevent_closing_with_open_checklist_items]', '0', id: nil %>
  <%= check_box_tag 'settings[prevent_closing_with_open_checklist_items]',
                    '1',
                    prevent_closing_with_open_checklist_items_enabled,
                    id: 'settings_prevent_closing_with_open_checklist_items' %>
  <%= label_tag 'settings_prevent_closing_with_open_checklist_items',
                l(:label_ux_toolkit_prevent_closing_with_open_checklist_items) %>
  <em class="info"><%= l(:text_ux_toolkit_prevent_closing_with_open_checklist_items_help) %></em>
</p>

<p>
  <%= hidden_field_tag 'settings[prevent_closing_with_open_subtasks]', '0', id: nil %>
  <%= check_box_tag 'settings[prevent_closing_with_open_subtasks]',
                    '1',
                    prevent_closing_with_open_subtasks_enabled,
                    id: 'settings_prevent_closing_with_open_subtasks' %>
  <%= label_tag 'settings_prevent_closing_with_open_subtasks',
                l(:label_ux_toolkit_prevent_closing_with_open_subtasks) %>
  <em class="info"><%= l(:text_ux_toolkit_prevent_closing_with_open_subtasks_help) %></em>
</p>
