<commit_before><% page_heading 'Verleihen' %>

<div class="warning">
  <span class="pull-right">×</span>
  Bitte erinnere den Studenten daran, dass die Ordner nur zum Kopieren gedacht sind und nach 2 Werktagen zurückgebracht
  werden sollen.
</div>


<%= form_for @old_lend_out, url: lending_action_path, html: {class: 'pure-form pure-form-aligned ausleihe-form', role: 'form'} do |f| %>
    <% if @old_lend_out.errors.any? %>
        <div id="error_explanation full-width">
          <h2>Fehler beim Ausleihen:</h2>
          <ul>
            <% @old_lend_out.errors.full_messages.each do |msg| %>
                <li><%= msg %></li>
            <% end %>
          </ul>
        </div>
    <% end %>

    <div class="pure-control-group">
      <%= f.label :folders, 'Ordner', :class => 'control-label' %>
      <ul id="folders">
        <% @old_lend_out.old_folder_instances.each do |i| %>
            <li>
              <%= i.barcodeId %>, <%= i.old_folder.title %>
              <%= hidden_field_tag 'old_folder_instances[]', i.id %>
            </li>
        <% end %>
      </ul>
    </div>


    <div class="pure-control-group">
      <%= f.label :weigth, 'Gewicht der Ordner', :class => 'control-label' %>
      <%= f.number_field :weigth, required: true, min: 1, :class => 'form-control', autofocus: true %>
    </div>

    <div class="pure-control-group">
      <%= f.label 'IMT-Login des Studenten', :class => 'control-label' %>
      <%= f.text_field :imt, required: true, :class => 'form-control' %>
      <span id="realname"></span>
    </div>

    <div class="pure-control-group">
      <%= f.label 'Raus von:', :class => 'control-label' %>
      <%= f.text_field :lender, required: true, list: 'lenders-and-receivers', :class => 'form-control' %>
      <datalist id="lenders-and-receivers">
        <% lenders_and_receivers.each do |name| %>
            <option value="<%= name %>"></option>
        <% end %>
      </datalist>
    </div>

    <div class="pure-control-group">
      <%= f.label 'Pfand', :class => 'control-label' %>
      <%= f.text_field :deposit, required: true, list: 'deposits', :class => 'form-control' %>
      <datalist id="deposits">
        <% deposits.each do |deposit| %>
            <option value="<%= deposit %>"></option>
        <% end %>
      </datalist>
    </div>


    <div class="pull-right">
      <div class="pure-control-group">
        <div class="col-sm-2">
          <%= f.submit '(W)eiter', class: 'pure-button pure-button-primary', :accesskey => 'w', :autocomplete => 'off' %>
        </div>
      </div><commit_msg>Removed unused code<commit_after><% page_heading 'Verleihen' %>

<div class="warning">
  <span class="pull-right">×</span>
  Bitte erinnere den Studenten daran, dass die Ordner nur zum Kopieren gedacht sind und nach 2 Werktagen zurückgebracht
  werden sollen.
</div>


<%= form_for @old_lend_out, url: lending_action_path, html: {class: 'pure-form pure-form-aligned ausleihe-form', role: 'form'} do |f| %>
    <% if @old_lend_out.errors.any? %>
        <div id="error_explanation full-width">
          <h2>Fehler beim Ausleihen:</h2>
          <ul>
            <% @old_lend_out.errors.full_messages.each do |msg| %>
                <li><%= msg %></li>
            <% end %>
          </ul>
        </div>
    <% end %>

    <div class="pure-control-group">
      <%= f.label :folders, 'Ordner', :class => 'control-label' %>
      <ul id="folders">
        <% @old_lend_out.old_folder_instances.each do |i| %>
            <li>
              <%= i.barcodeId %>, <%= i.old_folder.title %>
              <%= hidden_field_tag 'old_folder_instances[]', i.id %>
            </li>
        <% end %>
      </ul>
    </div>


    <div class="pure-control-group">
      <%= f.label :weigth, 'Gewicht der Ordner', :class => 'control-label' %>
      <%= f.number_field :weigth, required: true, min: 1, :class => 'form-control', autofocus: true %>
    </div>

    <div class="pure-control-group">
      <%= f.label 'IMT-Login des Studenten', :class => 'control-label' %>
      <%= f.text_field :imt, required: true, :class => 'form-control' %>
      <span id="realname"></span>
    </div>

    <div class="pure-control-group">
      <%= f.label 'Raus von:', :class => 'control-label' %>
      <%= f.text_field :lender, required: true, list: 'lenders-and-receivers', :class => 'form-control' %>
      <datalist id="lenders-and-receivers">
        <% lenders_and_receivers.each do |name| %>
            <option value="<%= name %>"></option>
        <% end %>
      </datalist>
    </div>

    <div class="pure-control-group">
      <%= f.label 'Pfand', :class => 'control-label' %>
      <%= f.text_field :deposit, required: true, list: 'deposits', :class => 'form-control' %>
      <datalist id="deposits">
        <% deposits.each do |deposit| %>
            <option value="<%= deposit %>"></option>
        <% end %>
      </datalist>
    </div>


    <div class="pull-right">
      <div class="pure-control-group">
        <div class="col-sm-2">
          <%= f.submit '(W)eiter', class: 'pure-button pure-button-primary', :accesskey => 'w' %>
        </div>
      </div>
{'fraction_non_alphanumeric': 0.19307123394316855, 'fraction_numerical': 0.001946282600233554, 'mean_word_length': 2.458277254374159, 'pattern_counts': {'":': 0, '<': 141, '<?xml version=': 0, '>': 162, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2875766', 'n_tokens_mistral': 1929, 'n_tokens_neox': 1767, 'n_words': 377}