<%= turbo_frame_tag(dom_id(success_criterion, :frame)) do %>
  <% expanded = false unless defined?(expanded) %>
  <div id="<%= dom_id success_criterion %>" class="card">
    <%== render partial: "success_criteria/header", locals: {success_criterion: success_criterion } %>
    
    <div class="collapse<%= " show" if expanded %>" id="collapseSuccessCriterion_<%= success_criterion.id %>">
      <div class="card-body">
        <%= bootstrap_form_with(model: success_criterion, data: { controller: "autosubmit" }) do |form| %>
          <div class="row mb-3">
            <div class="col">
              <div class="btn-group" role="group" aria-label="Resultat">
                <%= form.radio_button_without_bootstrap :result, :passed, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_passed) %>
                <label class="btn btn-outline-success" for="<%= dom_id(success_criterion, :result_passed) %>">
                  Bestanden
                </label>
                <%= form.radio_button_without_bootstrap :result, :failed, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_failed)  %>
                <label class="btn btn-outline-danger" for="<%= dom_id(success_criterion, :result_failed) %>">
                  Durchgefallen
                </label>
                <%= form.radio_button_without_bootstrap :result, :not_applicable, class: "btn-check", autocomplete: "off", id: dom_id(success_criterion, :result_not_applicable)  %>
                <label class="btn btn-outline-secondary" for="<%= dom_id(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>
        <% end %>
        <div class="mb-2">
          <%= success_criterion.quick_criterion %>
        </div>
        <div class="mb-2">
          <%= success_criterion.quick_fail %>
        </div>
        <div class="">
          <%= success_criterion.quick_fix %>
        </div>
        <% if success_criterion.test_comment.present? %>
          <div class="comment mt-2 mb-0"><%= success_criterion.test_comment %></div>
        <% end %>
      </div>
    </div>
  </div>
<% end %>