<%= f.select :data_source, Blazer.data_sources.map { |_, ds| [ds.name, ds.id] }, {}, class: ("hide" if Blazer.data_sources.size <= 1), style: "width: 140px;" %>
Run
Cancel
<%= 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" %>
<%= 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 %>