=render('shared/processed_and_removed/show', state: :processed)


/details
/  summary
/    span.summary.primary Remove application
div
  p You can remove an application if an error was made or proceedings never took place

  = form_for @form, as: :application, url: processed_application_path, method: :put, html: { autocomplete: 'off', class: 'remove-form' } do |f|
    .form-group
      = f.label :removed_reason, t('removed_reason', scope: @form.i18n_scope)
      = f.label :removed_reason, @form.errors[:removed_reason].join(','), class: 'error' if @form.errors[:removed_reason].present?
      = f.text_field :removed_reason, class: 'form-control small-field'

    = f.submit 'Remove application', :class => 'button primary'

=render('shared/processed_and_removed/show', state: :processed)

- details_attributes = @form.errors.empty? ? {} : { open: 'open' }

.panel
  details *details_attributes
    summary
      span.summary.primary Remove application
    div
      p You can remove an application if an error was made or proceedings never took place

      = form_for @form, as: :application, url: processed_application_path, method: :put, html: { autocomplete: 'off', class: 'remove-form' } do |f|
        .form-group
          = f.label :removed_reason, t('removed_reason', scope: @form.i18n_scope)
          = f.label :removed_reason, @form.errors[:removed_reason].join(','), class: 'error' if @form.errors[:removed_reason].present?
          = f.text_field :removed_reason, class: 'form-control small-field'

        = f.submit 'Remove application', :class => 'button alert'

Implement frontend for removing application form
Implement frontend for removing application form

It uses the html5 details tag. When there's an error and the page is
re-rendered, the details panel with the form is automatically expanded.
Tested in Chrome and Firefox. When this situation occurs in Firefox, the
triangle icon is not correctly rotated, but I think it's too minor to
spend long time debugging.

ministryofjustice/fr-staffapp,ministryofjustice/fr-staffapp,ministryofjustice/fr-staffapp,ministryofjustice/fr-staffapp