<commit_before><%= form_with model: medium, html: { id: 'medium-form' } do |f| %>
<div class="row px-4 py-2 mt-2">
  <div class="col-3">
    <h4 class="pl-2">
      <span class="badge badge-secondary">
        Medium
      </span>
      <% unless new_medium %>
        <%= medium.local_info %>
      <% end %>
    </h4>
  </div>
  <div class="col-5">
    <div id="medium-basics-warning">
      Achtung, ungespeicherte Änderungen!
      <%= f.submit "Speichern", class: "btn btn-primary" %>
      <button type="button" class="btn btn-secondary ml-2"
              id="medium-basics-cancel">
        verwerfen
      </button>
    </div>
  </div>
  <div class="col-3 text-center">
    <% unless new_medium %>
      <%= link_to 'Ansehen', inspect_medium_path(medium),
                  class: 'btn btn-primary my-1' %>
    <% end %>
    <%= link_to 'zur Medienübersicht', media_catalog_path,
                class: 'btn btn-primary' %>
    <% if !new_medium && medium.irrelevant? %>
      <%= link_to 'Medium löschen', medium_path, method: :delete,
                  data: { confirm: 'Bist Du sicher?' },
                  class: 'btn btn-danger' %>
    <% end %>
  </div>
</div>
  <div class="row mt-3 p-2">
    <div class="col-4">
      <div class="card bg-mdb-color-lighten-5">
        <div class="card-header bg-mdb-color-lighten-3">
          Basisdaten
        </div>
        <div class="card-body">
          <div class="form-group">
            <%= f.label :sort, 'Typ' %>
            <%= f.select :sort,
                         options_for_select(Medium.sort_enum.map { |s| [s, s] },
                                            medium.sort),
                         {}, { class: 'form-control' }%>
          </div>
          <div class="form-group">
            <%= f.label :teachable, 'assoziiert zu' %>
            <%= f.select :teachable,
                         options_for_select([['auswählen', '']] + all_teachables_selection(current_user),
                                            medium.teachable.present? ? medium.teachable_select : nil),
                         {}, { class: 'selectize' } %>
            <div class="invalid-feedback" id="medium-teachable-error">
            </div>
          </div>
          <!-- <div class="form-group">
            <%= f.label :editor_ids, 'Editoren' %>
            <%= f.select :editor_ids,
                         options_for_select(User.select_editors,
                                            medium.editors.map(&:id)),
                         {}, { multiple: true, class: 'selectize' } %>
            <div class="invalid-feedback" id="medium-editors-error">
            </div>
          </div> -->
          <div class="form-group">
            <%= f.label :description, 'Beschreibung' %>
            <%= f.text_field :description, class: 'form-control' %>
            <div class="invalid-feedback" id="medium-description-error">
            </div>
          </div>
          <div class="form-group">
            <%= f.label :tag_ids, 'Verknüpfte Begriffe' %><commit_msg>undo previous commit<commit_after><%= form_with model: medium, html: { id: 'medium-form' } do |f| %>
<div class="row px-4 py-2 mt-2">
  <div class="col-3">
    <h4 class="pl-2">
      <span class="badge badge-secondary">
        Medium
      </span>
      <% unless new_medium %>
        <%= medium.local_info %>
      <% end %>
    </h4>
  </div>
  <div class="col-5">
    <div id="medium-basics-warning">
      Achtung, ungespeicherte Änderungen!
      <%= f.submit "Speichern", class: "btn btn-primary" %>
      <button type="button" class="btn btn-secondary ml-2"
              id="medium-basics-cancel">
        verwerfen
      </button>
    </div>
  </div>
  <div class="col-3 text-center">
    <% unless new_medium %>
      <%= link_to 'Ansehen', inspect_medium_path(medium),
                  class: 'btn btn-primary my-1' %>
    <% end %>
    <%= link_to 'zur Medienübersicht', media_catalog_path,
                class: 'btn btn-primary' %>
    <% if !new_medium && medium.irrelevant? %>
      <%= link_to 'Medium löschen', medium_path, method: :delete,
                  data: { confirm: 'Bist Du sicher?' },
                  class: 'btn btn-danger' %>
    <% end %>
  </div>
</div>
  <div class="row mt-3 p-2">
    <div class="col-4">
      <div class="card bg-mdb-color-lighten-5">
        <div class="card-header bg-mdb-color-lighten-3">
          Basisdaten
        </div>
        <div class="card-body">
          <div class="form-group">
            <%= f.label :sort, 'Typ' %>
            <%= f.select :sort,
                         options_for_select(Medium.sort_enum.map { |s| [s, s] },
                                            medium.sort),
                         {}, { class: 'form-control' }%>
          </div>
          <div class="form-group">
            <%= f.label :teachable, 'assoziiert zu' %>
            <%= f.select :teachable,
                         options_for_select([['auswählen', '']] + all_teachables_selection(current_user),
                                            medium.teachable.present? ? medium.teachable_select : nil),
                         {}, { class: 'selectize' } %>
            <div class="invalid-feedback" id="medium-teachable-error">
            </div>
          </div>
          <div class="form-group">
            <%= f.label :editor_ids, 'Editoren' %>
            <%= f.select :editor_ids,
                         options_for_select(User.select_editors,
                                            medium.editors.map(&:id)),
                         {}, { multiple: true, class: 'selectize' } %>
            <div class="invalid-feedback" id="medium-editors-error">
            </div>
          </div>
          <div class="form-group">
            <%= f.label :description, 'Beschreibung' %>
            <%= f.text_field :description, class: 'form-control' %>
            <div class="invalid-feedback" id="medium-description-error">
            </div>
          </div>
          <div class="form-group">
            <%= f.label :tag_ids, 'Verknüpfte Begriffe' %>
{'fraction_non_alphanumeric': 0.16310072416063198, 'fraction_numerical': 0.005266622778143515, 'mean_word_length': 1.654871122761031, 'pattern_counts': {'":': 0, '<': 120, '<?xml version=': 0, '>': 120, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5604377', 'n_tokens_mistral': 1966, 'n_tokens_neox': 1852, 'n_words': 362}