openaustralia/publicwhip

View on GitHub
app/views/policies/edit.html.haml

Summary

Maintainability
Test Coverage
- content_for :title, "Editing “#{@policy.name_with_for}”"

.page-header.row
  %nav.header-actions.col-md-3
    = link_to "History of edits", history_policy_path(@policy)
  %h1.col-md-9
    = yield :title

%h2 Policy title and text

= simple_form_for @policy do |f|
  = f.error_notification
  .form-group= f.input :name, label: 'If you are for'
  .form-group= f.input :description, label: 'you believe that', hint: 'From the text, everyone should be able to agree which way the policy votes in each division'
  .checkbox
    %label
      %input#provisional{name: "provisional", type: "checkbox", value: "provisional", checked: @policy.provisional?}
      Draft policy
    %p.help-block
      'draft' means the policy is not yet complete or consistent enough to display publicly
  %input.submit-policy.btn.btn-primary{accesskey: "S", name: "submit", type: "submit", value: "Save title and text"}/
  = link_to "Cancel", :back, class: "btn btn-default"

%h2 Votes related to this policy
= render 'division_edit_instructions'