<%= f.label :name %>
<%= f.text_field :name, class: "form-control" %>
<%= f.label :description %>
<%= f.text_area :description, placeholder: "Optional", style: "height: 80px;", class: "form-control" %>
<%- if @assignees.any? -%>
<%= f.label :assignees %>
<%= f.collection_select :assignee_ids, @assignees, :first, :last, {}, { placeholder: "Assignees", style: "height: 80px;", class: "form-control", multiple: true } %>
<%- end -%>
<%= f.submit "For Enter Press", class: "hide" %>
<% if @query.persisted? %>
<%= link_to "Delete", query_path(@query), method: :delete, "data-confirm" => "Are you sure?", class: "btn btn-danger" %>
<%= f.submit "Fork", class: "btn btn-info" %>
<% end %>
<%= f.submit @query.persisted? ? "Update" : "Create", class: "btn btn-success" %>
<% if @query.persisted? %>
<% dashboards_count = @query.dashboards.count %>
<% checks_count = @query.checks.count %>
<% words = [] %>
<% words << pluralize(dashboards_count, "dashboard") if dashboards_count > 0 %>
<% words << pluralize(checks_count, "check") if checks_count > 0 %>
<% if words.any? %>
Part of <%= words.to_sentence %>. Be careful when editing.
<% end %>
<% end %>
<%= render partial: "tips" %>