<commit_before><% content_for(:page_title) { "Create a new e-petition - e-petitions" } %>
<% content_for :title do %>
<div class="title_block">
  <h1>Create a new e-petition</h1>
</div>
<% end %>

<%= form_for @petition, :url => create_petition_path, :html => {:class => 'wizard_form new_petition_form'} do |f| %>
  <div class="form_pagination">
    <ul>
      <li class="step_1 pagination_tab"><span class="step_no">1</span>e-petition<br/>details</li>
      <li class="step_2 pagination_tab"><span class="step_no">2</span>Your details</li>
      <li class="step_3 pagination_tab"><span class="step_no">3</span>Sponsor emails</li>
      <li class="step_4 pagination_tab"><span class="step_no">4</span>Submit<br/>e-petition</li>
    </ul>
  </div>

  <% if @petition.errors.any? -%>
    <div id='errorExplanation' class='errorExplanation'>
      <h2>We couldn't create this petition</h2>
      <p>Please fix the following errors:</p>
      <ul>
        <% @petition.errors.each do |key, error| -%>
          <li><%= error %></li>
        <% end -%>
      </ul>
    </div>
  <% end -%>

  <fieldset>
    <legend>Petition Details</legend>

    <%= form_row :for => [@petition, :title] do %>
      <%= f.label :title, 'e-petition title' %>
      <%= f.text_field :title, :tabindex => increment(5), :maxlength => 150 %>
      <%= error_messages_for_field @petition, :title %>
      <div class="tip">
        <div class="arrow"></div>
        <p>Keep your title short and include key words that describe your petition, eg. Reduce the rate of fuel duty.</p>
      </div>
      <p>Maximum 150 Characters</p>
    <% end %>

    <%= form_row :class => 'department_row', :for => [@petition, :department] do %>
      <%= f.label :department_id, raw("Department that looks after your issue#{info_link_to "#department_info", :class => "expandable_link", :tabindex => increment}") %>
      <%= f.select :department_id, options_from_collection_for_select(@departments, :id, :name, :selected => (@petition.department.nil?) ? nil : @petition.department.id), { :include_blank => 'Please select...' }, :tabindex => increment  %>
      <%= error_messages_for_field @petition, :department %>
      <%= new_window_link_to 'Which department does what?', info_departments_path, :tabindex => increment, :target => '_blank' %>

      <div class="expandable_content" id="department_info">
        <p>You must choose the government department that you believe owns the issue you are raising in your <span class="nowrap">e-petition</span>. This will help us to get it to the right person as quickly as possible.</p>
      </div>
    <% end %>

    <%= form_row :for => [@petition, :description] do %>
      <%= f.label :description, 'e-petition details' %>
      <%= f.text_area :description, :tabindex => increment %>
      <%= error_messages_for_field @petition, :description %>
      <p>Maximum 1000 Characters</p>
      <div class="tip">
        <div class="arrow"></div>
        <p>Keep your petition details short and to the point. You must say what action you want the government to take.</p>
      </div>
    <% end %>

    <%= form_row :class => 'department_row', :for => [@petition, :duration] do %>
      <%= f.label :duration, 'Time to collect signatures' %>
      <%= f.select :duration, options_for_select(petition_durations, :selected => (@petition.duration.nil?) ? nil : @petition.duration), {}, :tabindex => increment  %>
      <%= error_messages_for_field @petition, :duration %>
    <% end %>
  </fieldset>

  <fieldset>
    <% increment(2) # Skip 2 tabindexes for next/back buttons -%>
    <legend>Your Details</legend>
    <%= f.fields_for :creator_signature do |csf| %>
      <%= render :partial => 'signatures/form', :locals => { :f => csf, :signature => @petition.creator_signature } %>
    <% end %>
  </fieldset>

  <fieldset>
    <% increment(2) # Skip 2 tabindexes for next/back buttons -%>
    <legend>Sponsor email adresses</legend>
    <div class="strap_block">
      <p>Please add between 5 and 20 email adresses (one email address per line)</p>

      <%= text_area_tag 'sponsor_emails' %>
      
    </div>


  </fieldset>

  <fieldset id="petition_submit_section">
    <% increment(2) # Skip 2 tabindexes for next/back buttons -%>
    <legend>Submit Petition</legend>

    <div class="strap_block">
      <p>Here's your chance to review your e-petition. Once you press 'submit', you can't go back.
      This is how it will appear on the website. If you like what you see, press 'submit'.
      If you want to make changes, press 'back'.</p>
    </div>
    <div class="generic_block" id="petition_summary_block">
      <h2 id="title_summary_field"></h2>
      <p id="department_summary_field"></p>
      <p id="description_summary_field"></p>
    </div>
<commit_msg>Add petition signatures to view<commit_after><% content_for(:page_title) { "Create a new e-petition - e-petitions" } %>
<% content_for :title do %>
<div class="title_block">
  <h1>Create a new e-petition</h1>
</div>
<% end %>

<%= form_for @petition, :url => create_petition_path, :html => {:class => 'wizard_form new_petition_form'} do |f| %>
  <div class="form_pagination">
    <ul>
      <li class="step_1 pagination_tab"><span class="step_no">1</span>e-petition<br/>details</li>
      <li class="step_2 pagination_tab"><span class="step_no">2</span>Your details</li>
      <li class="step_3 pagination_tab"><span class="step_no">3</span>Sponsor emails</li>
      <li class="step_4 pagination_tab"><span class="step_no">4</span>Submit<br/>e-petition</li>
    </ul>
  </div>

  <% if @petition.errors.any? -%>
    <div id='errorExplanation' class='errorExplanation'>
      <h2>We couldn't create this petition</h2>
      <p>Please fix the following errors:</p>
      <ul>
        <% @petition.errors.each do |key, error| -%>
          <li><%= error %></li>
        <% end -%>
      </ul>
    </div>
  <% end -%>

  <fieldset>
    <legend>Petition Details</legend>

    <%= form_row :for => [@petition, :title] do %>
      <%= f.label :title, 'e-petition title' %>
      <%= f.text_field :title, :tabindex => increment(5), :maxlength => 150 %>
      <%= error_messages_for_field @petition, :title %>
      <div class="tip">
        <div class="arrow"></div>
        <p>Keep your title short and include key words that describe your petition, eg. Reduce the rate of fuel duty.</p>
      </div>
      <p>Maximum 150 Characters</p>
    <% end %>

    <%= form_row :class => 'department_row', :for => [@petition, :department] do %>
      <%= f.label :department_id, raw("Department that looks after your issue#{info_link_to "#department_info", :class => "expandable_link", :tabindex => increment}") %>
      <%= f.select :department_id, options_from_collection_for_select(@departments, :id, :name, :selected => (@petition.department.nil?) ? nil : @petition.department.id), { :include_blank => 'Please select...' }, :tabindex => increment  %>
      <%= error_messages_for_field @petition, :department %>
      <%= new_window_link_to 'Which department does what?', info_departments_path, :tabindex => increment, :target => '_blank' %>

      <div class="expandable_content" id="department_info">
        <p>You must choose the government department that you believe owns the issue you are raising in your <span class="nowrap">e-petition</span>. This will help us to get it to the right person as quickly as possible.</p>
      </div>
    <% end %>

    <%= form_row :for => [@petition, :description] do %>
      <%= f.label :description, 'e-petition details' %>
      <%= f.text_area :description, :tabindex => increment %>
      <%= error_messages_for_field @petition, :description %>
      <p>Maximum 1000 Characters</p>
      <div class="tip">
        <div class="arrow"></div>
        <p>Keep your petition details short and to the point. You must say what action you want the government to take.</p>
      </div>
    <% end %>

    <%= form_row :class => 'department_row', :for => [@petition, :duration] do %>
      <%= f.label :duration, 'Time to collect signatures' %>
      <%= f.select :duration, options_for_select(petition_durations, :selected => (@petition.duration.nil?) ? nil : @petition.duration), {}, :tabindex => increment  %>
      <%= error_messages_for_field @petition, :duration %>
    <% end %>
  </fieldset>

  <fieldset>
    <% increment(2) # Skip 2 tabindexes for next/back buttons -%>
    <legend>Your Details</legend>
    <%= f.fields_for :creator_signature do |csf| %>
      <%= render :partial => 'signatures/form', :locals => { :f => csf, :signature => @petition.creator_signature } %>
    <% end %>
  </fieldset>

  <fieldset>
    <% increment(2) # Skip 2 tabindexes for next/back buttons -%>
    <legend>Sponsor email adresses</legend>
    <div class="strap_block">
     <%= form_row :for => [@petition, :sponsor_emails] do %>
      <%= f.label :sponsor_emails, 'Sponsor emails' %>
      <%= f.text_area :sponsor_emails, :tabindex => increment, :value => @petition.sponsor_emails.join("\n") %>
      <%= error_messages_for_field @petition, :sponsor_emails %>
      <p>Enter 5-20 sponsor emails, one email per row</p>
      <div class="tip">
        <div class="arrow"></div>
        <p>Enter 5-20 sponsor emails, one email per row</p>
      </div>
    <% end %>
      
    </div>


  </fieldset>

  <fieldset id="petition_submit_section">
    <% increment(2) # Skip 2 tabindexes for next/back buttons -%>
    <legend>Submit Petition</legend>

    <div class="strap_block">
      <p>Here's your chance to review your e-petition. Once you press 'submit', you can't go back.
      This is how it will appear on the website. If you like what you see, press 'submit'.
      If you want to make changes, press 'back'.</p>
    </div>
    <div class="generic_block" id="petition_summary_block">
      <h2 id="title_summary_field"></h2>
      <p id="department_summary_field"></p>
      <p id="description_summary_field"></p>
    </div>

{'fraction_non_alphanumeric': 0.16623010276042716, 'fraction_numerical': 0.007152931694539593, 'mean_word_length': 3.4535666218034993, 'pattern_counts': {'":': 0, '<': 265, '<?xml version=': 0, '>': 318, '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': '4490028', 'n_tokens_mistral': 3486, 'n_tokens_neox': 3147, 'n_words': 835}