<%= error_messages_for 'rule' %>

<div class="box tabular">
  <p>
    <%= f.check_box :enabled %>
  </p>

  <p>
    <%= f.select :project_id,
                 options_from_collection_for_select(@projects, :id, :name, @rule.project_id),
                 required: true %>
  </p>

  <p>
    <%= f.select :tracker_id,
                 options_from_collection_for_select(@trackers, :id, :name, @rule.tracker_id),
                 required: true %>
  </p>

  <p><%= f.text_field :subject, required: true, size: 80, maxlength: 255 %></p>
  <p><%= f.text_area :description, cols: 80, rows: 8 %></p>

  <p>
    <%= f.select :priority_id,
                 options_from_collection_for_select(@priorities, :id, :name, @rule.priority_id),
                 required: true %>
  </p>

  <p>
    <%= f.select :assigned_to_id,
                 options_from_collection_for_select(@assignable_users, :id, :name, @rule.assigned_to_id),
                 include_blank: true %>
  </p>

  <p>
    <%= f.select :category_id,
                 options_from_collection_for_select(@categories, :id, :name, @rule.category_id),
                 include_blank: true %>
  </p>

  <p>
    <%= f.select :interval,
                 UxToolkitRecurringIssueRule::INTERVALS.map {|interval| [l(UxToolkitRecurringIssueRule.interval_label_key(interval)), interval] },
                 required: true %>
  </p>

  <p><%= f.text_field :next_run_on, required: true, size: 10 %><%= calendar_for('ux_toolkit_recurring_issue_rule_next_run_on') if respond_to?(:calendar_for) %></p>
</div>

<p>
  <%= submit_tag l(:button_save) %>
  <%= link_to l(:button_cancel), ux_toolkit_recurring_issue_rules_path %>
</p>
