
<div id="<%= dom_id success_criterion %>" class="card mb-3">
  <%== render partial: "success_criteria/header", locals: { success_criterion: success_criterion } %>
  
  <div class="collapse show" id="collapseSuccessCriterion_<%= success_criterion.id %>">
    <div class="card-body">
      <%= bootstrap_form_with(model: success_criterion.persisted? ? success_criterion : [:element, success_criterion]) do |form| %>
        <div class="row">
          <div class="col">
            <div class="btn-group" role="group" aria-label="Resultat">
              <%= form.radio_button_without_bootstrap :result, :passed, class: "btn-check", autocomplete: "off" %>
              <label class="btn btn-outline-success" for="success_criterion_result_passed">
                Bestanden
              </label>
              <%= form.radio_button_without_bootstrap :result, :failed, class: "btn-check", autocomplete: "off" %>
              <label class="btn btn-outline-danger" for="success_criterion_result_failed">
                Durchgefallen
              </label>
              <%= form.radio_button_without_bootstrap :result, :not_applicable, class: "btn-check", autocomplete: "off" %>
              <label class="btn btn-outline-secondary" for="success_criterion_result_not_applicable">
                Nicht anwendbar
              </label>
            </div>
            <%# form.collection_select :result, SuccessCriterion.results.map{ |k, v| [k, t("activerecord.attributes.success_criterion.results/#{k}")] }, :first, :second, include_blank: true, hide_label: true %>
            <%# form.select :category, SuccessCriterion.categories.keys  %>
          </div>
          <div class="col">
            <%= form.select :level, SuccessCriterion.levels.keys, hide_label: true %>
          </div>
        </div>
        <%= form.text_field :title %>
        <%= form.rich_text_area :quick_criterion %>
        <%= form.rich_text_area :quick_fail %>
        <%= form.rich_text_area :quick_fix %>
        <%= form.rich_text_area :test_comment %>
        <%= form.submit class: "btn btn-warning" %>
        <%= link_to "Abbrechen", success_criterion.persisted? ? success_criterion : success_criterion.element, class: "btn btn-outline-secondary" %>
      <% end %>
    </div>
  </div>
  <%# <%= link_to "edit", url_for([:edit, success_criterion]) %>
</div>
