<commit_before><%= form_for(@recipe, html: { class: 'pure-form pure-form-aligned' }) do |f| %>
  <%= invisible_captcha %>
  <%= hidden_field_tag :clear_search, true %>
  <% if @recipe.errors.any? %>
    <div id="error_explanation">
      <h2><%= I18n.t(:'activerecord.errors.models.recipe.header', count: @recipe.errors.count) %></h2>

      <ul>
      <% @recipe.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <% if @event&.official? %>
    <%= render 'shared/event_plate' %>
  <% end %>

  <fieldset>
    <div class="field pure-control-group">
      <%= f.label :beerxml %>
      <%= f.file_field :beerxml, accept: 'application/xml,.xml', required: @recipe.new_record? %>
    </div>
    <div class="field pure-control-group">
      <%= f.label :name %>
      <%= f.text_field :name, placeholder: I18n.t(:'activerecord.attributes.recipe.name') %>
      <em>(<%= I18n.t(:'recipes.name_not_needed') %>)</em>
    </div>
    <div class="field pure-control-group">
      <%= f.label :description, class: 'large-group' %>
      <div class="quill-wrapper">
        <%= f.text_area :description, placeholder: I18n.t(:'activerecord.attributes.recipe.description'), class: 'quill_container' %>
      </div>
    </div>
    <% unless @recipe.persisted? %>
      <% if @event&.official? %>
        <%= hidden_field_tag :event, @event.id %>
      <% else %>
        <div class="field pure-control-group">
            <%= label_tag :event, t(:'common.exhibited_at_event') %>
            <%= select_tag :event, grouped_options_for_select(Event.event_options, @event&.id),
                  class: 'pure-input-1-4',
                  include_blank: t(:'common.no_event') %>
        </div>
      <% end %>
    <% end %>
    <div class="actions pure-controls">
      <%= f.label :public, class: 'pure-checkbox' do %>
        <%= f.check_box :public %> <%= I18n.t(:'activerecord.attributes.recipe.public') %>
      <% end %>
      <br>

      <%= f.submit I18n.t(:'recipes.save'), class: 'pure-button pure-button-primary' %>
    </div>
  </fieldset>
<% end %><commit_msg>Always display event plate when adding recipe to event, even if it is not an official event.<commit_after><%= form_for(@recipe, html: { class: 'pure-form pure-form-aligned' }) do |f| %>
  <%= invisible_captcha %>
  <%= hidden_field_tag :clear_search, true %>
  <% if @recipe.errors.any? %>
    <div id="error_explanation">
      <h2><%= I18n.t(:'activerecord.errors.models.recipe.header', count: @recipe.errors.count) %></h2>

      <ul>
      <% @recipe.errors.full_messages.each do |message| %>
        <li><%= message %></li>
      <% end %>
      </ul>
    </div>
  <% end %>

  <% if @event&.present? %>
    <%= render 'shared/event_plate' %>
  <% end %>

  <fieldset>
    <div class="field pure-control-group">
      <%= f.label :beerxml %>
      <%= f.file_field :beerxml, accept: 'application/xml,.xml', required: @recipe.new_record? %>
    </div>
    <div class="field pure-control-group">
      <%= f.label :name %>
      <%= f.text_field :name, placeholder: I18n.t(:'activerecord.attributes.recipe.name') %>
      <em>(<%= I18n.t(:'recipes.name_not_needed') %>)</em>
    </div>
    <div class="field pure-control-group">
      <%= f.label :description, class: 'large-group' %>
      <div class="quill-wrapper">
        <%= f.text_area :description, placeholder: I18n.t(:'activerecord.attributes.recipe.description'), class: 'quill_container' %>
      </div>
    </div>
    <% unless @recipe.persisted? %>
      <% if @event&.present? %>
        <%= hidden_field_tag :event, @event.id %>
      <% else %>
        <div class="field pure-control-group">
            <%= label_tag :event, t(:'common.exhibited_at_event') %>
            <%= select_tag :event, grouped_options_for_select(Event.event_options, @event&.id),
                  class: 'pure-input-1-4',
                  include_blank: t(:'common.no_event') %>
        </div>
      <% end %>
    <% end %>
    <div class="actions pure-controls">
      <%= f.label :public, class: 'pure-checkbox' do %>
        <%= f.check_box :public %> <%= I18n.t(:'activerecord.attributes.recipe.public') %>
      <% end %>
      <br>

      <%= f.submit I18n.t(:'recipes.save'), class: 'pure-button pure-button-primary' %>
    </div>
  </fieldset>
<% end %>
{'fraction_non_alphanumeric': 0.2017038913193645, 'fraction_numerical': 0.007368178678332949, 'mean_word_length': 2.764298093587522, 'pattern_counts': {'":': 0, '<': 119, '<?xml version=': 0, '>': 119, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 8}, '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': '1341882', 'n_tokens_mistral': 1676, 'n_tokens_neox': 1485, 'n_words': 268}