openaustralia/planningalerts

View on GitHub
app/views/contact_messages/_form.html.haml

Summary

Maintainability
Test Coverage
= semantic_form_for contact_message do |f|
  = f.inputs do
    - if current_user.nil?
      = f.input :name, hint: t("formtastic.hints.contact_message.name", link: new_user_session_path)
      = f.input :email
    = f.input :reason, collection: ContactMessage::REASONS_LONG, prompt: "-- Select closest relevant --"
    = f.input :details, input_html: { rows: 8 }
    = f.input :attachments, as: :file, input_html: { multiple: true, data: { direct_upload_url: rails_direct_uploads_url } }
    - if current_user.nil? && Rails.application.credentials[:recaptcha]
      = recaptcha_tags
      %p.inline-hints
        Or
        = link_to "sign in", new_user_session_path
        to remove this annoying reCaptcha
    = f.semantic_errors :base
  = f.actions do
    = f.action :submit, button_html: { class: "button button-action" }
  %p We run this site, not the Government!