<commit_before><%= gather_form_for(reservation,
      url: reservation.new_record? ? reservations_path : reservation_path(reservation)) do |f| %>

  <%= f.hidden_field :resource_id %>
  <%= f.input :resource do %>
    <%= image_tag(resource.photo.url(:thumb)) %><br/>
    <%= resource.name_with_prefix %>
  <% end %>

  <% reservation.rules(rule_name: :pre_notice, kind: :any).each do |rule| %>
    <%# Include rule kinds as data attrib so these can be shown/hidden appropriately. %>
    <% data = rule.kinds.present? ? {kinds: rule.kinds.map { |k| "{#{k}}" }.join} : nil %>
    <%= f.input :pre_notice, label: "", wrapper_html: {data: data} do %>
      <%= Reservations::Rules::PreNoticeRuleDecorator.new(rule).alert_tag %>
    <% end %>
  <% end %>

  <% unless reservation.meal? %>
    <%= f.input :name, maxlength: Reservations::Reservation::NAME_MAX_LENGTH %>
  <% end %>

  <% if policy(reservation).choose_reserver? %>
    <%= f.input :reserver_id, as: :assoc_select2, context: reservation.reserver_select2_context %>
  <% end %>

  <%= f.input :starts_at, as: :datetime_picker, include_day_of_week: true,
    wrapper_html: { class: reservation.fixed_start_time? ? "no-time-picker" : "" } %>

  <%= f.input :ends_at, as: :datetime_picker, include_day_of_week: true,
    wrapper_html: { class: reservation.fixed_end_time? ? "no-time-picker" : "" } %>

  <% unless reservation.meal? %>
    <% if @kinds.present? && reservation.requires_kind? %>
      <%= f.input :kind, collection: @kinds, required: true %>
    <% end %>

    <% if reservation.access_level(current_community) == "sponsor" %>
      <%= f.input :sponsor_id, as: :assoc_select2, context: "res_sponsor", required: true %><commit_msg>Fix sponsor field on reservation form<commit_after><%= gather_form_for(reservation,
      url: reservation.new_record? ? reservations_path : reservation_path(reservation)) do |f| %>

  <%= f.hidden_field :resource_id %>
  <%= f.input :resource do %>
    <%= image_tag(resource.photo.url(:thumb)) %><br/>
    <%= resource.name_with_prefix %>
  <% end %>

  <% reservation.rules(rule_name: :pre_notice, kind: :any).each do |rule| %>
    <%# Include rule kinds as data attrib so these can be shown/hidden appropriately. %>
    <% data = rule.kinds.present? ? {kinds: rule.kinds.map { |k| "{#{k}}" }.join} : nil %>
    <%= f.input :pre_notice, label: "", wrapper_html: {data: data} do %>
      <%= Reservations::Rules::PreNoticeRuleDecorator.new(rule).alert_tag %>
    <% end %>
  <% end %>

  <% unless reservation.meal? %>
    <%= f.input :name, maxlength: Reservations::Reservation::NAME_MAX_LENGTH %>
  <% end %>

  <% if policy(reservation).choose_reserver? %>
    <%= f.input :reserver_id, as: :assoc_select2, context: reservation.reserver_select2_context %>
  <% end %>

  <%= f.input :starts_at, as: :datetime_picker, include_day_of_week: true,
    wrapper_html: { class: reservation.fixed_start_time? ? "no-time-picker" : "" } %>

  <%= f.input :ends_at, as: :datetime_picker, include_day_of_week: true,
    wrapper_html: { class: reservation.fixed_end_time? ? "no-time-picker" : "" } %>

  <% unless reservation.meal? %>
    <% if @kinds.present? && reservation.requires_kind? %>
      <%= f.input :kind, collection: @kinds, required: true %>
    <% end %>

    <% if reservation.access_level(current_user.community) == "sponsor" %>
      <%= f.input :sponsor_id, as: :assoc_select2, context: "res_sponsor", required: true %>
{'fraction_non_alphanumeric': 0.17914360617535682, 'fraction_numerical': 0.001747742499271774, 'mean_word_length': 4.17948717948718, 'pattern_counts': {'":': 0, '<': 59, '<?xml version=': 0, '>': 59, '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': '6713849', 'n_tokens_mistral': 1325, 'n_tokens_neox': 1153, 'n_words': 229}