petities/petitions.eu

View on GitHub
app/views/petitions/_edit_details.html.slim

Summary

Maintainability
Test Coverage
div.petition-details id="edit_details" style='display: none;'
  = form_for @petition do |f|

    div.petition-edit-label
      = t('petition.details.form.public_name')
    = f.text_field :petitioner_name, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.your_name')

    div.petition-edit-label
      = t('petition.details.form.public_email')
    = f.text_field :petitioner_email, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.your_email')

    div.petition-edit-label
      = t('petition.details.form.telephone')
    = f.text_field :petitioner_telephone, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.your_number')

    div.petition-edit-label
      = t('petition.details.form.public_organisation')
    = f.text_field :petitioner_organisation, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.your_organisation')

    div.petition-edit-label
      = t('petition.details.form.due_date_label')
    = f.date_select :date_projected, class: 'petition-edit-input whitespace',
                     default: 90.days.from_now

    div.whitespace

    - if f.object.in_treatment?
      div.petition-edit-label
        = t('petition.details.form.answer_date_label')
      = f.date_select :answer_due_date, class: 'petition-edit-input whitespace',
                       default: 100.days.from_now

      div.whitespace

    - if f.object.reference_field.present? || f.object.in_treatment?
      div.petition-edit-label.whitespace
        = t('petition.details.form.reference_field')
      = f.text_field :reference_field, class: 'petition-edit-input',
                     placeholder: t('petition.details.edit.reference_field')

    div.whitespace
    div.whitespace
    div.petition-edit-label
      = t('petition.details.form.link1')
    = f.text_field :link1, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.link_url')

    div.petition-edit-label
      = t('petition.details.form.link1_text')
    = f.text_field :link1_text, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.link_text')


    div.petition-edit-label
      = t('petition.details.form.link1')
    = f.text_field :link2, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.link_url')

    div.petition-edit-label
      = t('petition.details.form.link1_text')
    = f.text_field :link2_text, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.link_text')


    div.petition-edit-label
      = t('petition.details.form.link1')
    = f.text_field :link3, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.link_url')

    div.petition-edit-label
      = t('petition.details.form.link1_text')
    = f.text_field :link3_text, class: 'petition-edit-input',
                   placeholder: t('petition.details.edit.link_text')

    = f.submit t('petition.details.form.submit'), class: "petition-form-button"