<commit_before><%= simple_form_for @app_config, html: { multipart: true, class: 'form-horizontal' } do |f| %>

  <%= f.error_notification %>

  <fieldset>
    <legend>General</legend>
    <%= f.input :site_title, hint: "The Site Title is displayed in the title bar / tab in the browser, as well as in the navigation bar." %>
    <%= f.input :admin_email %>
    <%= f.input :department_name %>
    <%= f.input :home_link_text %>
    <%= f.input :home_link_location %>
    <%= f.input :contact_link_location, label: 'Contact Email', hint:
    'The email to which contact form submissions will be sent.' %>
    <%= f.input :default_per_cat_page, label: 'Items per page', hint:
    'Default number of items to display per page in the Catalog.' %>
    <%# Paperclip inline error fix %>
    <%= f.input :favicon, label: 'Custom Favicon', hint:
    "Displayed in the tab and address bar of most browsers. Must be <em>*.ico</em> #{current_favicon_and_options}".html_safe, wrapper_html: {class: paperclip_field_error(f, :favicon_content_type)} do %>
      <%= f.input_field :favicon, as: :file %>
      <%= f.error :favicon_content_type %>
    <% end %>

    <% if @app_config.favicon.present? %>
      <div class='control-group'>
        <div class="controls">
          <%= label_tag 'restore_favicon' do %>
            <%= check_box_tag 'restore_favicon', nil, false %>
            <%= 'Restore default favicon?' %>
          <% end %>
        </div>
      </div>
    <% end %>
  </fieldset>

  <fieldset>
    <legend>Unregistered Users</legend>
    <%= f.input :enable_new_users, label: 'Enable User Creation', hint: 'Allow people to create user accounts.' %>
    <%= f.input :enable_guests, label: 'Enable Guest Access', hint: 'Allow people to browse the catalog without signing in.' %>
  </fieldset>

  <fieldset>
    <legend>Additional Permissions for Checkout Persons</legend>
    <%= f.input :checkout_persons_can_edit, label: 'Edit reservations', hint: 'Allow checkout persons to edit reservations.' %>
    <%= f.input :override_on_create, label: 'Override on create', hint: 'Give checkout persons admin-level override capability when creating a reservation. For example, they would be able to create a reservation on a blackout date, or for a period longer than the permitted length for that item.' %>
    <%= f.input :override_at_checkout, label: 'Override at checkout', hint: 'Give checkout persons admin-level override capability when checking out. For example, they would be able to checkout equipment to someone with an overdue reservation.' %>
    <%= f.input :require_phone, label: 'Are users required to provide a phone number?' %>
  </fieldset>

  <fieldset>
    <legend>Reservation requests</legend><br />
    <%= f.input :request_text, label: 'Reservation request text', input_html: {rows: 10},
      hint: 'This message will be displayed to users who are about to file a reservation request for invalid reservations.
             You can use markdown in this field' %>
    <%= render partial: 'shared/markdown_button' %>
  </fieldset>

  <fieldset>
    <legend>Renewals</legend>
    <%= f.input :enable_renewals, label: 'Enable renewals', hint: 'Allow users to renew reservations.' %>
  </fieldset>

  <fieldset>
    <legend>Emails</legend><br />
    <p>
      Configure notifications that will be sent to users.
    </p>
    <p>
      Emails make use of variables; variables are placeholders that are automatically replaced with user- and reservation- specific information.<br />
      You can use the following variables in each email:
    </p>
    <dl>
      <dt>@user@</dt><dd>The full name of the user.</dd>
      <dt>@equipment_list@</dt><dd>The list of equipment that user either has reserved, missed, overdue, or checked out.</dd>
      <dt>@reservation_id@</dt><dd>The id number of the reservation.</dd>
      <dt>@department_name@</dt><dd>The department name set above.</dd>
      <dt>@start_date@</dt><dd>The start date for the reservation.</dd>
      <dt>@return_date@</dt><dd>The due date for the reservation.</dd>
      <dt>@late_fee@</dt><dd>The daily late fee for the equipment model in the reservation.</dd>
      <dt>@replacement_fee@</dt><dd>The replacement fee for the equipment model in the reservation</dd>
      <dt>@tos@</dt><dd>The terms of service</dd>
    </dl>
    <hr />
    <%= f.input :upcoming_checkin_email_active, label: 'Send equipment check-in reminders?',
                hint: 'When enabled, patrons will get an email reminding them that reservation(s) are due.' %>
    <%= f.input :upcoming_checkin_email_body, input_html: {rows: 10} %>
    <hr />

    <%= f.input :overdue_checkin_email_active, label: 'Send overdue check-in reminders?',
                hint: 'When enabled, patrons who have overdue equipment will get an email informing them about late fees and other consequences.' %>
    <%= f.input :overdue_checkin_email_body, input_html: {rows: 10} %>
    <hr />
    <%= f.input :res_exp_time, label: 'Days to keep missed reservations',
        hint: 'Missed reservations a certain number of days old can be automatically deleted. Leave blank to keep all missed reservations forever.' %>
    <%= f.input :send_notifications_for_deleted_missed_reservations, label: 'Send notifications?',
                hint: 'When enabled, patrons will be notified that their reservations were deleted.' %>
    <%= f.input :deleted_missed_reservation_email_body, input_html: {rows: 10} %>
    <hr />

    <%#= f.input :reservation_confirmation_email_active, label: 'Enable reservation confirmation?',
                hint: 'When enabled, patrons will get an email confirmation containing the details of their reservation.' %>
    <hr />


  </fieldset>
  <fieldset>
    <legend>Terms of Service</legend>
    <%= f.input :terms_of_service, input_html: {rows: 20} %>
    <% unless params[:controller] == "application_setup" %>
      <%= f.input :reset_tos_for_users, input_html: {type: 'checkbox', value: '1'} , label: "Force all patrons to accept the TOS again?", :hint => "i.e., if patrons need to be aware that the terms of service have changed." %>
    <% end %><commit_msg>Remove deprecated AppConfig input<commit_after><%= simple_form_for @app_config, html: { multipart: true, class: 'form-horizontal' } do |f| %>

  <%= f.error_notification %>

  <fieldset>
    <legend>General</legend>
    <%= f.input :site_title, hint: "The Site Title is displayed in the title bar / tab in the browser, as well as in the navigation bar." %>
    <%= f.input :admin_email %>
    <%= f.input :department_name %>
    <%= f.input :home_link_text %>
    <%= f.input :home_link_location %>
    <%= f.input :contact_link_location, label: 'Contact Email', hint:
    'The email to which contact form submissions will be sent.' %>
    <%= f.input :default_per_cat_page, label: 'Items per page', hint:
    'Default number of items to display per page in the Catalog.' %>
    <%# Paperclip inline error fix %>
    <%= f.input :favicon, label: 'Custom Favicon', hint:
    "Displayed in the tab and address bar of most browsers. Must be <em>*.ico</em> #{current_favicon_and_options}".html_safe, wrapper_html: {class: paperclip_field_error(f, :favicon_content_type)} do %>
      <%= f.input_field :favicon, as: :file %>
      <%= f.error :favicon_content_type %>
    <% end %>

    <% if @app_config.favicon.present? %>
      <div class='control-group'>
        <div class="controls">
          <%= label_tag 'restore_favicon' do %>
            <%= check_box_tag 'restore_favicon', nil, false %>
            <%= 'Restore default favicon?' %>
          <% end %>
        </div>
      </div>
    <% end %>
  </fieldset>

  <fieldset>
    <legend>Unregistered Users</legend>
    <%= f.input :enable_new_users, label: 'Enable User Creation', hint: 'Allow people to create user accounts.' %>
    <%= f.input :enable_guests, label: 'Enable Guest Access', hint: 'Allow people to browse the catalog without signing in.' %>
  </fieldset>

  <fieldset>
    <legend>Additional Permissions for Checkout Persons</legend>
    <%= f.input :checkout_persons_can_edit, label: 'Edit reservations', hint: 'Allow checkout persons to edit reservations.' %>
    <%= f.input :override_on_create, label: 'Override on create', hint: 'Give checkout persons admin-level override capability when creating a reservation. For example, they would be able to create a reservation on a blackout date, or for a period longer than the permitted length for that item.' %>
    <%= f.input :override_at_checkout, label: 'Override at checkout', hint: 'Give checkout persons admin-level override capability when checking out. For example, they would be able to checkout equipment to someone with an overdue reservation.' %>
    <%= f.input :require_phone, label: 'Are users required to provide a phone number?' %>
  </fieldset>

  <fieldset>
    <legend>Reservation requests</legend><br />
    <%= f.input :request_text, label: 'Reservation request text', input_html: {rows: 10},
      hint: 'This message will be displayed to users who are about to file a reservation request for invalid reservations.
             You can use markdown in this field' %>
    <%= render partial: 'shared/markdown_button' %>
  </fieldset>

  <fieldset>
    <legend>Renewals</legend>
    <%= f.input :enable_renewals, label: 'Enable renewals', hint: 'Allow users to renew reservations.' %>
  </fieldset>

  <fieldset>
    <legend>Emails</legend><br />
    <p>
      Configure notifications that will be sent to users.
    </p>
    <p>
      Emails make use of variables; variables are placeholders that are automatically replaced with user- and reservation- specific information.<br />
      You can use the following variables in each email:
    </p>
    <dl>
      <dt>@user@</dt><dd>The full name of the user.</dd>
      <dt>@equipment_list@</dt><dd>The list of equipment that user either has reserved, missed, overdue, or checked out.</dd>
      <dt>@reservation_id@</dt><dd>The id number of the reservation.</dd>
      <dt>@department_name@</dt><dd>The department name set above.</dd>
      <dt>@start_date@</dt><dd>The start date for the reservation.</dd>
      <dt>@return_date@</dt><dd>The due date for the reservation.</dd>
      <dt>@late_fee@</dt><dd>The daily late fee for the equipment model in the reservation.</dd>
      <dt>@replacement_fee@</dt><dd>The replacement fee for the equipment model in the reservation</dd>
      <dt>@tos@</dt><dd>The terms of service</dd>
    </dl>
    <hr />
    <%= f.input :upcoming_checkin_email_active, label: 'Send equipment check-in reminders?',
                hint: 'When enabled, patrons will get an email reminding them that reservation(s) are due.' %>
    <%= f.input :upcoming_checkin_email_body, input_html: {rows: 10} %>
    <hr />

    <%= f.input :overdue_checkin_email_active, label: 'Send overdue check-in reminders?',
                hint: 'When enabled, patrons who have overdue equipment will get an email informing them about late fees and other consequences.' %>
    <%= f.input :overdue_checkin_email_body, input_html: {rows: 10} %>
    <hr />
    <%= f.input :res_exp_time, label: 'Days to keep missed reservations',
        hint: 'Missed reservations a certain number of days old can be automatically deleted. Leave blank to keep all missed reservations forever.' %>
    <%= f.input :send_notifications_for_deleted_missed_reservations, label: 'Send notifications?',
                hint: 'When enabled, patrons will be notified that their reservations were deleted.' %>
    <%= f.input :deleted_missed_reservation_email_body, input_html: {rows: 10} %>
    <hr />

  </fieldset>
  <fieldset>
    <legend>Terms of Service</legend>
    <%= f.input :terms_of_service, input_html: {rows: 20} %>
    <% unless params[:controller] == "application_setup" %>
      <%= f.input :reset_tos_for_users, input_html: {type: 'checkbox', value: '1'} , label: "Force all patrons to accept the TOS again?", :hint => "i.e., if patrons need to be aware that the terms of service have changed." %>
    <% end %>
{'fraction_non_alphanumeric': 0.1287639327898852, 'fraction_numerical': 0.0018299783729828648, 'mean_word_length': 3.581935975609756, 'pattern_counts': {'":': 0, '<': 249, '<?xml version=': 0, '>': 251, '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': '6488190', 'n_tokens_mistral': 3855, 'n_tokens_neox': 3516, 'n_words': 1219}