<% settings = Setting.plugin_redmine_ux_toolkit || {} %>
<% show_my_work_top_menu = settings.fetch('show_my_work_top_menu', '0').to_s == '1' %>
<% default_dashboard_blocks = UxToolkitUserPreference.default_dashboard_block_keys(settings) %>

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

<p>
  <%= hidden_field_tag 'settings[show_my_work_top_menu]', '0', id: nil %>
  <%= check_box_tag 'settings[show_my_work_top_menu]',
                    '1',
                    show_my_work_top_menu,
                    id: 'settings_show_my_work_top_menu' %>
  <%= label_tag 'settings_show_my_work_top_menu',
                l(:label_ux_toolkit_show_my_work_top_menu) %>
  <em class="info"><%= l(:text_ux_toolkit_show_my_work_top_menu_help) %></em>
</p>

<p>
  <strong><%= l(:label_ux_toolkit_default_my_work_dashboard_blocks) %></strong>
  <em class="info"><%= l(:text_ux_toolkit_default_my_work_dashboard_blocks_help) %></em>
</p>

<%= hidden_field_tag 'settings[default_my_work_dashboard_blocks][]', '', id: nil %>
<% UxToolkitUserPreference::DASHBOARD_BLOCKS.each do |block| %>
  <p>
    <%= check_box_tag 'settings[default_my_work_dashboard_blocks][]',
                      block,
                      default_dashboard_blocks.include?(block),
                      id: "settings_default_my_work_dashboard_block_#{block}" %>
    <%= label_tag "settings_default_my_work_dashboard_block_#{block}",
                  l(UxToolkitUserPreference.dashboard_block_label_key(block)) %>
  </p>
<% end %>
