mysociety/alaveteli

View on GitHub
app/views/public_body_change_requests/new.html.erb

Summary

Maintainability
Test Coverage
<h1><%= @title %></h1>

<%= foi_error_messages_for :change_request %>

<%= form_for(@change_request, :url => change_request_path)  do |f| %>
  <% if not @user %>
    <p>
      <label class="form_label" for="user_name">
        <%= _("Your name:") %>
      </label>
      <%= f.text_field :user_name %>
      <%= _('(or <a href="{{url}}">sign in</a>)',
            :url => signin_path(:r => request.fullpath)) %>
    </p>

    <p>
      <label class="form_label" for="user_email">
        <%= _("Your email:") %>
      </label>
      <%= f.text_field :user_email %>
    </p>
  <% end %>

  <% if @change_request.public_body %>
    <%= f.hidden_field :public_body_id %>
  <% else %>
    <p>
      <label class="form_label" for="public_body_name">
        <%= _("Authority:") %>
      </label>
      <%= f.text_field :public_body_name %>
    </p>
  <% end %>

  <p>
    <label class="form_label" for="public_body_email">
      <%= _("Authority email:") %>
    </label>
    <%= f.text_field :public_body_email %>
    <div class="form_item_note">
      <%= _("The contact email address for FOI requests to the authority.") %>
    </div>
  </p>

  <p>
    <label class="form_label" for="source_url">
      <%= _("Source URL:") %>
    </label>
    <%= f.text_field :source_url %>
    <div class="form_item_note">
      <%= _("The URL where you found the email address. This field is " \
            "optional, but it would help us a lot if you can provide a link " \
            "to a specific page on the authority's website that gives this " \
            "address, as it will make it much easier for us to check.") %>
    </div>
  </p>

  <p>
    <label class="form_label" for="notes">
      <%= _("Notes:") %>
    </label>
    <%= f.text_area :notes, :rows => 10, :cols => 60 %>
  </p>

  <% if @render_recaptcha %>
    <%= recaptcha_tags %>
  <% end %>

  <p style="display:none;">
    <%= label_tag 'public_body_change_request[comment]', _('Do not fill in this field') %>
    <%= text_field_tag 'public_body_change_request[comment]' %>
  </p>

  <div class="form_button">
    <%= submit_tag _("Submit request") %>
  </div>

<% end %>