<commit_before><% page_title "Email alert subscription" %>
<% page_class "email-signup-show" %>

<header class="block email-header">
  <div class="inner-block">
    <h1>Email alert subscription</h1>
    <h2>Use the filters to subscribe to email alerts</h2>
    <p>(You can subscribe to multiple alerts by clicking &lsquo;Add another alert&rsquo;)</p>
  </div>
</header>

<div class="block">
  <div class="inner-block">
    <%= form_for @email_signup, html: { class: "signup-form js-email-signup" } do |form| %>
      <% form.object.alerts.each do |alert| %>
        <fieldset class="notification">
          <div class="fieldset-inner">
            <%= form.fields_for :alerts, alert, index: nil do |alert_form| %>
              <div class="field"><div class="field-inner">
                <%= alert_form.label :document_type, 'I want' %>
                <%= alert_form.select :document_type, document_type_options_for_email_signup %>
              </div></div>
              <div class="field"><div class="field-inner">
                <%= alert_form.label :topic, 'about' %>
                <%= alert_form.select :topic, topic_options_for_email_signup %>
              </div></div>
              <div class="field"><div class="field-inner">
                <%= alert_form.label :organisation, 'by' %>
                <%= alert_form.select :organisation, organisation_options_for_email_signup %>
              </div></div>
              <div class="field info4local"><div class="field-inner">
                <%= alert_form.check_box :info_for_local, label_text: ' Only include results relevant to local government' %>
                <p>This replaces info4local</p>
              </div></div>
            <% end %>
          </div>
        </fieldset>
      <% end %>
      <div class="duplicate-fields">
        <%= submit_tag 'Add another alert', name: 'duplicate', class: 'js-duplicate' %>
      </div>

      <div class="submit">
        <%= button_tag 'Create subscription' %>
        <p>You can enter your email address on the next page to complete the subscription</p>
      </div>
    <% end %>
  </div>
</div>


<commit_msg>Tweak the form elements for the alert objects<commit_after><% page_title "Email alert subscription" %>
<% page_class "email-signup-show" %>

<header class="block email-header">
  <div class="inner-block">
    <h1>Email alert subscription</h1>
    <h2>Use the filters to subscribe to email alerts</h2>
    <p>(You can subscribe to multiple alerts by clicking &lsquo;Add another alert&rsquo;)</p>
  </div>
</header>

<div class="block">
  <div class="inner-block">
    <%= form_for @email_signup, html: { class: "signup-form js-email-signup" } do |form| %>
      <%= form.errors %>
      <% form.object.alerts.each.with_index do |alert, idx| %>
        <fieldset class="notification">
          <div class="fieldset-inner">
            <%= form.fields_for :alerts, alert, index: idx do |alert_form| %>
              <%= alert_form.errors %>
              <div class="field"><div class="field-inner">
                <%= alert_form.label :document_type, 'I want' %>
                <%= alert_form.select :document_type, document_type_options_for_email_signup(alert_form.object.document_type) %>
              </div></div>
              <div class="field"><div class="field-inner">
                <%= alert_form.label :topic, 'about' %>
                <%= alert_form.select :topic, topic_options_for_email_signup(alert_form.object.topic) %>
              </div></div>
              <div class="field"><div class="field-inner">
                <%= alert_form.label :organisation, 'by' %>
                <%= alert_form.select :organisation, organisation_options_for_email_signup(alert_form.object.organisation) %>
              </div></div>
              <div class="field info4local"><div class="field-inner">
                <%= alert_form.check_box :info_for_local, label_text: ' Only include results relevant to local government' %>
                <p>This replaces info4local</p>
              </div></div>
            <% end %>
          </div>
        </fieldset>
      <% end %>
      <div class="duplicate-fields">
        <%= submit_tag 'Add another alert', name: 'duplicate', class: 'js-duplicate' %>
      </div>

      <div class="submit">
        <%= button_tag 'Create subscription' %>
        <p>You can enter your email address on the next page to complete the subscription</p>
      </div>
    <% end %>
  </div>
</div>



{'fraction_non_alphanumeric': 0.15071556350626117, 'fraction_numerical': 0.0026833631484794273, 'mean_word_length': 2.456723338485317, 'pattern_counts': {'":': 0, '<': 123, '<?xml version=': 0, '>': 123, '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': '6629971', 'n_tokens_mistral': 1415, 'n_tokens_neox': 1307, 'n_words': 308}