mysociety/alaveteli

View on GitHub
app/views/comment/_comment_form.html.erb

Summary

Maintainability
Test Coverage
<%= form_for(
    @comment,
    :url => new_comment_path(:type => "request", :url_title => @info_request.url_title),
    :html => { :id => 'comment_form' }
  ) do |f| %>
  <p>
    <%= f.text_area :body, :rows => 10, :cols => 55 %>
  </p>

  <% if !TrackThing.find_existing(@user, track_thing) && (!@user || @info_request.user != @user) %>
    <p>
      <%= check_box_tag 'subscribe_to_request', "1", params[:subscribe_to_request] %> <label for="subscribe_to_request"><%= _('Email me future updates to this request') %></label>
    </p>
  <% end %>

  <p>
    <%= hidden_field_tag 'submitted_comment', 1 %>
    <%= hidden_field_tag 'preview', 1 %>
    <%= submit_tag _('Preview your annotation') %>
    <%= _(' (<strong>no ranty</strong> politics, read our <a href="{{url}}">moderation policy</a>)', :url => (help_requesting_path+'#moderation').html_safe) %>
  </p>
<% end %>