Skip to content

Commit

Permalink
Merge pull request #593 from bitzesty/supporters
Browse files Browse the repository at this point in the history
Fix deletion of support letter attachments
  • Loading branch information
TheDancingClown authored Sep 12, 2023
2 parents bf016cd + d51b08d commit e8a780e
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion app/views/form/support_letters/_support_letter.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,4 @@ li.view-only
mount_name: :attachment
span.clear

= button_to "Remove", form_form_answer_support_letter_path(@form_answer, support_letter), method: :delete, class: "govuk-button govuk-button--warning #{'read_only' if admin_in_read_only_mode?}", 'aria-label' => "Delete support letter from #{support_letter.first_name} #{support_letter.first_name}"
= button_to "Remove", form_form_answer_support_letter_path(@form_answer, support_letter), method: :delete, class: "govuk-button govuk-button--warning #{'read_only' if admin_in_read_only_mode?}", 'aria-label' => "Delete support letter from #{support_letter.first_name} #{support_letter.last_name}"
4 changes: 1 addition & 3 deletions app/views/qae_form/_supporter_fields.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,4 @@ li.js-add-example class="#{'read-only js-support-letter-received' if persisted}"
- url = "#"

- if submission_deadline.trigger_at >= Time.zone.now
button.govuk-button.govuk-button--warning.remove-supporter.remove-link.js-remove-link.visible-read-only class="#{'read_only' if admin_in_read_only_mode?}"
| Remove

= link_to "Remove", url, class: "govuk-button govuk-button--warning remove-supporter remove-link js-remove-link", data: { url: url }, 'aria-label' => "Delete support letter from #{supporter["first_name"]} #{supporter["last_name"]}"
5 changes: 0 additions & 5 deletions app/views/qae_form/_supporter_fields_placeholder.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ li.js-add-example class="govuk-!-display-none"

button.govuk-button.button-alt.js-save-collection data-save-collection-url=users_form_answer_support_letters_url(@form_answer) disabled='disabled'
| Submit letter of support

p
- if !admin_in_read_only_mode?
button.govuk-button.govuk-button--warning.remove-supporter.remove-link.js-remove-link.govuk-button.govuk-button--warning.visible-read-only
| Remove

0 comments on commit e8a780e

Please sign in to comment.