diff --git a/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee b/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee index af3e491b8..2dbca938b 100644 --- a/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee +++ b/app/assets/javascripts/frontend/custom_questions/support_letters.js.coffee @@ -5,6 +5,10 @@ window.SupportLetters = $(document).on 'change', '.js-trigger-autosave', debounce(SupportLetters.submit, 1000) + $(document).on 'click', '.js-remove-support-letter-attachment', (e) -> + e.preventDefault() + SupportLetters.removeFile($(this).closest('.govuk-form-group').find('input:first'), e) + new_item_init: (el) -> SupportLetters.clean_up_system_tags(el) SupportLetters.enable_item_fields_and_controls(el) @@ -25,11 +29,11 @@ window.SupportLetters = parent.find('.govuk-error-message').html('') parent.find('.govuk-error-message').closest('.govuk-form-group').removeClass('govuk-form-group--error') - - label = $('

' + filename + '

') + + textContainer = parent.find('.support-letter-attachment-container') + textContainer.removeClass('govuk-!-display-none') + textContainer.find('.flex').prepend('

' + filename + '

') hiddenInput = $("") - - parent.append(label) parent.append(hiddenInput) SupportLetters.autosave() SupportLetters.submit(e) @@ -61,6 +65,15 @@ window.SupportLetters = parent.find('input[type="hidden"]').remove() parent.find('.support-letter-attachment-filename').remove() + removeFile: (el, e) -> + $el = $(el) + $el.val('') + $el.siblings('.js-support-letter-attachment-id').first().val('') + $el.siblings('.support-letter-attachment-container').addClass('govuk-!-display-none') + $el.removeClass('govuk-!-display-none') + SupportLetters.autosave() + SupportLetters.submit(e) + enable_item_fields_and_controls: (parent) -> parent.find('.govuk-error-message').html('') prefixed = parent.find('.js-system-tag').data('new-hidden-input-name') diff --git a/app/assets/stylesheets/frontend/forms.scss b/app/assets/stylesheets/frontend/forms.scss index d17d03335..46a4363a9 100644 --- a/app/assets/stylesheets/frontend/forms.scss +++ b/app/assets/stylesheets/frontend/forms.scss @@ -660,6 +660,11 @@ input[type="file"] { padding: 20px !important; border: 2px solid #000 !important; + &.borderless { + border: 0 !important; + padding: 0 !important; + } + .lte-ie7 & { display: inline; width: 100%; diff --git a/app/assets/stylesheets/frontend/views/award_form.scss b/app/assets/stylesheets/frontend/views/award_form.scss index 0b32cc711..8f7269b8d 100644 --- a/app/assets/stylesheets/frontend/views/award_form.scss +++ b/app/assets/stylesheets/frontend/views/award_form.scss @@ -151,15 +151,34 @@ margin: 0.75em 0; } -.support-letter-attachment-filename, label > .visible-read-only, .view-value { margin-bottom: 10px; font-weight: normal; } -.support-letter-attachment-filename { - display: block; +.support-letter-attachment-container { + padding: 15px; + display: flex; + justify-content: space-between; + align-items: start; + background: $govuk-light-grey; + + .flex { + display: flex; + justify-content: space-between; + align-items: start; + } + + .js-remove-support-letter-attachment{ + color: $govuk-red; + word-break: keep-all; + margin-top: 0 !important; + } + + .non-js-remove-support-letter-attachment { + color: $govuk-red; + } } .view-only, diff --git a/app/controllers/form/support_letter_attachments_controller.rb b/app/controllers/form/support_letter_attachments_controller.rb new file mode 100644 index 000000000..1be939752 --- /dev/null +++ b/app/controllers/form/support_letter_attachments_controller.rb @@ -0,0 +1,29 @@ +class Form::SupportLetterAttachmentsController < Form::BaseController + include FormAnswerSubmissionMixin + before_action :set_support_letter + + def show; end + + def destroy + attachment = SupportLetterAttachment.find(params[:id]) + form_answer = attachment.form_answer + + if attachment.destroy + updated_list = form_answer.document['supporter_letters_list'].reject { |letter| letter['letter_of_support'] == attachment.id } + form_answer.update(document: form_answer.document.merge(supporter_letters_list: updated_list)) + + flash[:notice] = 'Attachment successfully deleted.' + else + flash[:alert] = 'Failed to delete attachment.' + end + + redirect_to form_form_answer_supporters_path(form_answer) + end + + private + + def set_support_letter + @support_letter = SupportLetter.find(params[:support_letter_id]) + @form_answer = @support_letter.form_answer + end +end diff --git a/app/views/assessor/form_answers/_question.html.slim b/app/views/assessor/form_answers/_question.html.slim index 9078c0863..bb0f616dd 100644 --- a/app/views/assessor/form_answers/_question.html.slim +++ b/app/views/assessor/form_answers/_question.html.slim @@ -9,9 +9,7 @@ fieldset class=question.fieldset_classes data=question.fieldset_data_hash - if question.label_as_legend? legend.govuk-label aria-label="#{ref.to_s.gsub(' ', '-')} #{question.title.blank? ? '' : ':' + question.title}" - if question.ref || question.sub_ref - span class="steps step-#{ref.to_s.parameterize} #{'if-js-hide' if question.sub_ref && !question.display_sub_ref_on_js_form}" - span.todo - = ref.to_s + = render "qae_form/question_ref", question: question, ref: ref - unless question.title.blank? - font_size = question.delegate_obj.is_a?(QaeFormBuilder::HeaderQuestion) ? "govuk-!-font-size-36" : "govuk-!-font-size-24" span class="govuk-body #{ font_size } govuk-!-font-weight-bold govuk-!-display-block" @@ -23,9 +21,7 @@ fieldset class=question.fieldset_classes data=question.fieldset_data_hash legend.govuk-label aria-label="#{ref.to_s.gsub(' ', '-')} #{question.title.blank? ? '' : ':' + question.title}" label.govuk-label for="q_#{question.key}" id="q_#{question.key}_label" aria-label="#{ref.to_s.gsub(' ', '-')}: #{question.title}" - if question.ref || question.sub_ref - span class="steps step-#{ref.to_s.parameterize} #{'if-js-hide' if question.sub_ref && !question.display_sub_ref_on_js_form}" - span.todo - = ref.to_s + = render "qae_form/question_ref", question: question, ref: ref - unless question.title.blank? span class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" == question.title @@ -36,10 +32,6 @@ fieldset class=question.fieldset_classes data=question.fieldset_data_hash - if question.ref || question.sub_ref .if-js-hide label.govuk-label for="q_#{question.key}" aria-label="#{ref.to_s.gsub(' ', '-')}: #{question.title}" - span class="steps step-#{ref.to_s.parameterize} #{'if-js-hide' if question.sub_ref && !question.display_sub_ref_on_js_form}" - span.visuallyhidden - = ref.to_s - span.todo - = ref.to_s + = render "qae_form/question_ref", question: question, ref: ref = render "assessor/form_answers/questions/#{question.delegate_obj.class.name.demodulize.underscore}", question: question, answers: answers, attachments: attachments diff --git a/app/views/form/support_letter_attachments/show.html.slim b/app/views/form/support_letter_attachments/show.html.slim new file mode 100644 index 000000000..10b3b01ac --- /dev/null +++ b/app/views/form/support_letter_attachments/show.html.slim @@ -0,0 +1,20 @@ +- content_for :page_title, "Support Letter Attachment" + +.govuk-grid-row + .govuk-grid-column-two-thirds + h1.govuk-heading-xl Support Letter Attachment + + - if @support_letter.support_letter_attachment.present? + .govuk-summary-list + .govuk-summary-list__row + dt.govuk-summary-list__key + | File Name + dd.govuk-summary-list__value + = @support_letter.support_letter_attachment.original_filename + + = button_to "Delete Attachment", + form_form_answer_support_letter_support_letter_attachment_path(@form_answer, @support_letter, @support_letter.support_letter_attachment), + method: :delete, + class: "govuk-button govuk-button--warning" + - else + p.govuk-body No attachment found for this support letter. diff --git a/app/views/form/support_letters/_form.html.slim b/app/views/form/support_letters/_form.html.slim index 3d11283b7..f04e1db4f 100644 --- a/app/views/form/support_letters/_form.html.slim +++ b/app/views/form/support_letters/_form.html.slim @@ -1,26 +1,50 @@ = f.simple_fields_for :support_letters do |ff| - idx = ff.options[:child_index] + 1 - li - .govuk-grid-row - .govuk-grid-column-one-half - label[class="govuk-label"] - span[class="govuk-body govuk-!-font-size-20 govuk-!-font-weight-bold govuk-!-display-block"] - = "Letter of Support #{idx}" - = ff.input :first_name, label: "First Name:", input_html: { class: "form-control" } - = ff.input :last_name, label: "Surname:", input_html: { class: "form-control" } - = ff.input :relationship_to_nominee, label: "Relationship to Group:", input_html: { class: "form-control" } - - = ff.input :manual, as: :hidden, input_html: { value: true } - = ff.input :user_id, as: :hidden, input_html: { value: current_user.id } - - = ff.simple_fields_for :support_letter_attachment, (ff.object.support_letter_attachment || ff.object.build_support_letter_attachment) do |fff| - = fff.input :attachment, as: :file, label: "Upload Letter of Support #{idx}", input_html: { class: "form-control" }, wrapper_html: { style: "margin-bottom: -1rem;" } - - if fff.object.attachment.present? - p.govuk-body.support-letter-attachment-filename - = render "shared/attachment_with_virus_check_status", item: fff.object, mount_name: :attachment + - first_or_second = idx == 1 ? "first" : "second" + li.borderless + .question-block + label[class="govuk-label"] + legend.govuk-label + = render "qae_form/question_ref", question: question, ref: "C #{idx}" + span[class="govuk-body govuk-!-font-size-36 govuk-!-font-weight-bold govuk-!-display-block"] + = "The #{first_or_second} letter of support" + + legend.govuk-label aria-label="C #{idx}.1: Name" + = render "qae_form/question_ref", question: question, ref: "C #{idx}.1" + span[class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block"] + = "Name of the person who wrote the #{first_or_second} letter of support" + = ff.input :first_name, label: "First Name:", input_html: { class: "form-control medium" } + = ff.input :last_name, label: "Surname:", input_html: { class: "form-control medium" } + + legend.govuk-label aria-label="C #{idx}.2: Relationship to Group" + = render "qae_form/question_ref", question: question, ref: "C #{idx}.2" + label for="form_answer_support_letters_attributes_#{ff.options[:child_index]}_relationship_to_nominee" class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" + = "Relationship to group" + span.question-context.question-debug.govuk-hint + ' For example, a beneficiary of the group, local resident or member of a partner charity. + = ff.input :relationship_to_nominee, label: false, input_html: { class: "form-control medium" } + + = ff.input :manual, as: :hidden, input_html: { value: true } + = ff.input :user_id, as: :hidden, input_html: { value: current_user.id } + + legend.govuk-label aria-label="C #{idx}.3: Upload Letter of Support" + = render "qae_form/question_ref", question: question, ref: "C #{idx}.3" + label for="form_answer_support_letters_attributes_#{ff.options[:child_index]}_support_letter_attachment" class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" + = "Upload the #{first_or_second} letter of support" + span.question-context.question-debug.govuk-hint + ' If you upload the wrong file, click the 'Remove' link next to the file name to delete it. The file upload button will reappear, allowing you to select the correct file. + + = ff.simple_fields_for :support_letter_attachment, (ff.object.support_letter_attachment || ff.object.build_support_letter_attachment) do |fff| + - if fff.object.attachment.present? + p.govuk-body.support-letter-attachment-container class="govuk-!-font-size-19" + = render "shared/attachment_with_virus_check_status", item: fff.object, mount_name: :attachment + - if ff.object.support_letter_attachment.id.present? + = link_to 'Remove', form_form_answer_support_letter_support_letter_attachment_path(@form_answer, ff.object, ff.object.support_letter_attachment), method: :delete, class: 'govuk-link non-js-remove-support-letter-attachment govuk-!-font-size-19' = fff.input :attachment_cache, as: :hidden = fff.input :form_answer_id, as: :hidden, input_html: { value: @form_answer.id } = fff.input :user_id, as: :hidden, input_html: { value: current_user.id } + - unless fff.object.id.present? + = fff.input :attachment, as: :file, label: false, input_html: { class: "form-control" }, wrapper_html: { style: "margin-bottom: -1rem;" } diff --git a/app/views/form/supporters/index.html.slim b/app/views/form/supporters/index.html.slim index e5d73b67f..27f6e9caa 100644 --- a/app/views/form/supporters/index.html.slim +++ b/app/views/form/supporters/index.html.slim @@ -15,19 +15,10 @@ h1.govuk-heading-xl article.group role="article" div - letters_intro_question = @step.questions.detect { |q| q.key == :supporter_letters_list } + - letters_context = @step.questions.detect { |q| q.key == :supporter_letters_list_context} - checkbox_questions = @step.questions.select { |q| q.key.in?(%i(independent_individual not_nominator)) } - .question-block - label.govuk-label - span class="steps step-d-1" - span.visuallyhidden - ' C 1 - span.todo - ' C 1 - span class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" - ' Upload your letters of support - - == letters_intro_question&.context + == letters_context&.context - for help in (letters_intro_question&.hint || []) details.govuk-details data-module="govuk-details" @@ -45,7 +36,7 @@ h1.govuk-heading-xl - f.object.support_letters.build unless f.object.support_letters[n].present? ul.list-add.supporters-list - = render partial: "form/support_letters/form", locals: { f: f } + = render partial: "form/support_letters/form", locals: { f: f, question: letters_intro_question } - checkbox_questions.each do |question| .govuk-form-group diff --git a/app/views/qae_form/_question.html.slim b/app/views/qae_form/_question.html.slim index d916491bc..dd0e9eb5d 100644 --- a/app/views/qae_form/_question.html.slim +++ b/app/views/qae_form/_question.html.slim @@ -11,9 +11,7 @@ fieldset class=question.fieldset_classes data=question.fieldset_data_hash - if question.label_as_legend? legend.govuk-label aria-label="#{ref.to_s.gsub(' ', '-')} #{question.title.blank? ? '' : ':' + question.title}" - if question.ref || question.sub_ref - span class="steps step-#{ref.to_s.parameterize} #{'if-js-hide' if question.sub_ref && !question.display_sub_ref_on_js_form}" - span.todo - = ref.to_s + = render "qae_form/question_ref", question: question, ref: ref - unless question.title.blank? - font_size = question.delegate_obj.is_a?(QaeFormBuilder::HeaderQuestion) ? "govuk-!-font-size-36" : "govuk-!-font-size-24" span class="govuk-body #{ font_size } govuk-!-font-weight-bold govuk-!-display-block" @@ -25,9 +23,7 @@ fieldset class=question.fieldset_classes data=question.fieldset_data_hash legend.govuk-label aria-label="#{ref.to_s.gsub(' ', '-')} #{question.title.blank? ? '' : ':' + question.title}" label.govuk-label for="q_#{question.key}" id="q_#{question.key}_label" aria-label="#{ref.to_s.gsub(' ', '-')}: #{question.title}" - if question.ref || question.sub_ref - span class="steps step-#{ref.to_s.parameterize} #{'if-js-hide' if question.sub_ref && !question.display_sub_ref_on_js_form}" - span.todo - = ref.to_s + = render "qae_form/question_ref", question: question, ref: ref - unless question.title.blank? span class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" == question.title @@ -38,11 +34,7 @@ fieldset class=question.fieldset_classes data=question.fieldset_data_hash - if question.ref || question.sub_ref .if-js-hide label.govuk-label for="q_#{question.key}" aria-label="#{ref.to_s.gsub(' ', '-')}: #{question.title}" - span class="steps step-#{ref.to_s.parameterize} #{'if-js-hide' if question.sub_ref && !question.display_sub_ref_on_js_form}" - span.visuallyhidden - = ref.to_s - span.todo - = ref.to_s + = render "qae_form/question_ref", question: question, ref: ref - if question.delegate_obj.is_a?(QaeFormBuilder::HeaderQuestion) - if question.ref || question.sub_ref diff --git a/app/views/qae_form/_question_ref.html.slim b/app/views/qae_form/_question_ref.html.slim new file mode 100644 index 000000000..16b3acf99 --- /dev/null +++ b/app/views/qae_form/_question_ref.html.slim @@ -0,0 +1,3 @@ +span class="steps step-#{ref.to_s.parameterize} #{'if-js-hide' if question.sub_ref && !question.display_sub_ref_on_js_form}" + span.todo + = ref.to_s diff --git a/app/views/qae_form/_supporter_fields.html.slim b/app/views/qae_form/_supporter_fields.html.slim index aee0fad3b..b0580301c 100644 --- a/app/views/qae_form/_supporter_fields.html.slim +++ b/app/views/qae_form/_supporter_fields.html.slim @@ -1,37 +1,52 @@ +- first_or_second = index == 0 ? "first" : "second" +- idx = index + 1 - persisted = supporter["support_letter_id"].present? || supporter["supporter_id"].present? - create_url = users_form_answer_support_letters_url(@form_answer) - update_url = users_form_answer_support_letter_path(@form_answer, supporter["support_letter_id"]) if persisted -li[class=class_names("js-add-example", "js-support-letter-received" => persisted) data-create-url=create_url data-update-url=update_url] + +li.borderless[class=class_names("js-add-example", "js-support-letter-received" => persisted) data-create-url=create_url data-update-url=update_url] + legend.govuk-label + = render "qae_form/question_ref", question: question, ref: "C #{idx}" label[class="govuk-label"] - span[class="govuk-body govuk-!-font-size-20 govuk-!-font-weight-bold govuk-!-display-block"] - = "Letter of Support #{index + 1}" + span[class="govuk-body govuk-!-font-size-36 govuk-!-font-weight-bold govuk-!-display-block"] + = "The #{first_or_second} letter of support" input.js-support-entry-id type="hidden" name="form[#{question.key}][#{index}][support_letter_id]" value=supporter["support_letter_id"] *possible_read_only_ops(question.step.opts[:id]) .js-system-tag data-new-hidden-input-name="form[#{question.key}][#{index}][support_letter_id]" + legend.govuk-label aria-label="C #{index + 1}.1: Name" + = render "qae_form/question_ref", question: question, ref: "C #{idx}.1" + span class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" + ' Name of the person who wrote the #{first_or_second} letter of support .govuk-form-group label.govuk-label for="form[#{question.key}][#{index}][first_name]" ' First Name: span.govuk-error-message input.js-support-letter-field.js-support-letter-first-name.js-trigger-autosave.govuk-input autocomplete="off" class="js-trigger-autosave medium" name="form[#{question.key}][#{index}][first_name]" id="form[#{question.key}][#{index}][first_name]" type="text" value=supporter["first_name"] *possible_read_only_ops(question.step.opts[:id]) - .govuk-form-group label.govuk-label for="form[#{question.key}][#{index}][last_name]" ' Surname: span.govuk-error-message input.js-support-letter-field.js-support-letter-last-name.js-trigger-autosave.govuk-input autocomplete="off" class="js-trigger-autosave medium" name="form[#{question.key}][#{index}][last_name]" id="form[#{question.key}][#{index}][last_name]" type="text" value=supporter["last_name"] *possible_read_only_ops(question.step.opts[:id]) + legend.govuk-label aria-label="C #{idx}.2: Relationship to Group" + = render "qae_form/question_ref", question: question, ref: "C #{idx}.2" .govuk-form-group - label.govuk-label for="form[#{question.key}][#{index}][relationship_to_nominee]" - ' Relationship to Group: + label class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" for="form[#{question.key}][#{index}][relationship_to_nominee]" + ' Relationship to group + span.question-context.question-debug.govuk-hint + ' For example, a beneficiary of the group, local resident or member of a partner charity. span.govuk-error-message input.js-support-letter-field.js-support-letter-relationship-to-nominee.js-trigger-autosave.govuk-input autocomplete="off" class="js-trigger-autosave medium" name="form[#{question.key}][#{index}][relationship_to_nominee]" id="form[#{question.key}][#{index}][relationship_to_nominee]" type="text" value=supporter["relationship_to_nominee"] *possible_read_only_ops(question.step.opts[:id]) + legend.govuk-label aria-label="C #{idx}.3: Relationship to Group" + = render "qae_form/question_ref", question: question, ref: "C #{idx}.3" .govuk-form-group - label.govuk-label for="form[#{question.key}][#{index}][letter_of_support]" - = "Upload Letter of Support #{index + 1}" + label class="govuk-body govuk-!-font-size-24 govuk-!-font-weight-bold govuk-!-display-block" for="form[#{question.key}][#{index}][letter_of_support]" + ' Upload the #{first_or_second} letter of support + span.question-context.question-debug.govuk-hint + ' If you upload the wrong file, click the 'Remove' link next to the file name to delete it. The file upload button will reappear, allowing you to select the correct file. span.govuk-error-message - - input class="js-support-letter-field js-trigger-autosave js-support-letter-attachment govuk-input medium" name="form[#{question.key}][#{index}][letter_of_support]" id="form[#{question.key}][#{index}][letter_of_support]" type='file' *possible_read_only_ops(question.step.opts[:id]) + input class="js-support-letter-field js-trigger-autosave js-support-letter-attachment govuk-input medium #{'govuk-!-display-none' if supporter['letter_of_support'].present?}" name="form[#{question.key}][#{index}][letter_of_support]" id="form[#{question.key}][#{index}][letter_of_support]" type='file' *possible_read_only_ops(question.step.opts[:id]) - if supporter['letter_of_support'].present? - = render "support_letters/attachment", question: question, index: index, attachment_id: supporter['letter_of_support'] + = render "support_letters/attachment", question: question, index: index, supporter: supporter, attachment_id: supporter['letter_of_support'] diff --git a/app/views/shared/_attachment_with_virus_check_status.html.slim b/app/views/shared/_attachment_with_virus_check_status.html.slim index bef7d0bb7..4b9bcb9e5 100644 --- a/app/views/shared/_attachment_with_virus_check_status.html.slim +++ b/app/views/shared/_attachment_with_virus_check_status.html.slim @@ -7,12 +7,14 @@ class: 'govuk-link' - elsif scan_results == "scanning" || scan_results == "pending" = item.try(:original_filename) - | (scanning on viruses) + br + .govuk-hint + | (File uploaded and is being scanned for viruses. Preview available once the scan is complete.) - elsif scan_results == "infected" = item.try(:original_filename) - | has been blocked (virus detected), please remove. + | has been blocked (virus detected), please upload another file. - else - = item.try(:original_filename) - | didn't pass virus scanner check, please remove + = item.try(:original_filename) || "File" + | didn't pass virus scanner check, please upload another file. - else = item.try(:original_filename) diff --git a/app/views/support_letters/_attachment.html.slim b/app/views/support_letters/_attachment.html.slim index 611b93a17..86406f38a 100644 --- a/app/views/support_letters/_attachment.html.slim +++ b/app/views/support_letters/_attachment.html.slim @@ -1,5 +1,9 @@ - file = support_letter_attachments[attachment_id.to_i] -p.govuk-body.support-letter-attachment-filename - = render "shared/attachment_with_virus_check_status", item: file, mount_name: :attachment +.support-letter-attachment-container + .flex + .support-letter-attachment-filename class="govuk-!-font-size-19" + = render "shared/attachment_with_virus_check_status", item: file, mount_name: :attachment + button.govuk-link.js-remove-support-letter-attachment class="govuk-!-font-size-19" data-module="govuk-button" type="button" + | Remove input.js-support-letter-attachment-id type="hidden" name="form[#{question.key}][#{index}][letter_of_support]" value=attachment_id *possible_read_only_ops diff --git a/config/routes.rb b/config/routes.rb index 0eec6a3cb..8c3d0638e 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -104,7 +104,9 @@ namespace :form do resources :form_answers do resources :supporters, only: [:new, :create, :index, :destroy] - resources :support_letters, only: [:create] + resources :support_letters, only: [:create] do + resources :support_letter_attachments, only: [:show, :destroy] + end resources :form_attachments, only: [:index, :new, :create, :destroy] end end diff --git a/forms/award_years/v2025/qavs/qavs_step3.rb b/forms/award_years/v2025/qavs/qavs_step3.rb index d8b99639f..acfb87a1e 100644 --- a/forms/award_years/v2025/qavs/qavs_step3.rb +++ b/forms/award_years/v2025/qavs/qavs_step3.rb @@ -6,36 +6,35 @@ def qavs_step3

Please note your answers are being saved automatically in the background.

) - supporters :supporter_letters_list, "" do - ref "C 1" + header :supporter_letters_list_context, "" do context %(

Letters of support are an essential part of your nomination, as they help to clarify and explain the impact of the nominated group's work in the local community. You will need to provide 2 letters of support alongside your nomination.

For more information on what letters can cover, please see the Letters of Support page on our website.

-

Key criteria:

+

Key criteria:

    -
  1. letters must be written by individuals who are familiar with the group's work, for example: a beneficiary, local resident or member of a partner charity
  2. -
  3. letters must not be written by a volunteer, employee, trustee, or anyone involved in the running of the group
  4. -
  5. letters written by the nominator will be ineligible
  6. -
  7. each letter should be no more than 500 words
  8. -
  9. only 2 letters of support can be submitted
  10. +
  11. Letters must be written by individuals who are familiar with the group's work, for example: a beneficiary, local resident or member of a partner charity.
  12. +
  13. Letters must not be written by a volunteer, employee, trustee, or anyone involved in the running of the group.
  14. +
  15. Letters written by the nominator will be ineligible.
  16. +
  17. Each letter should be no more than 500 words.
  18. +
  19. Only 2 letters of support can be submitted.
-

For each letter uploaded below, please note the letter writer's relationship to the group, for example: a beneficiary of the group, local resident or member of a partner charity.

-

Once uploaded, all files are saved automatically. If you make a mistake and upload the wrong letter, please use the same button to upload the correct file as it will automatically replace the previous version.

) pdf_context_with_header_blocks [ [:normal, %(Letters of support are an essential part of your nomination, as they help to clarify and explain the impact of the nominated group's work in the local community. You will need to provide 2 letters of support alongside your nomination.)], [:normal, %(For more information on what letters can cover, please see the Letters of Support page on our website.)], - [:normal, %(Key criteria: + [:bold, %(Key criteria: - 1. letters must be written by individuals who are familiar with the group's work, for example: a beneficiary, local resident or member of a partner charity - 2. letters must not be written by a volunteer, employee, trustee, or anyone involved in the running of the group - 3. letters written by the nominator will be ineligible - 4. each letter should be no more than 500 words - 5. only 2 letters of support can be submitted + 1. Letters must be written by individuals who are familiar with the group's work, for example: a beneficiary, local resident or member of a partner charity. + 2. Letters must not be written by a volunteer, employee, trustee, or anyone involved in the running of the group. + 3. Letters written by the nominator will be ineligible. + 4. Each letter should be no more than 500 words. + 5. Only 2 letters of support can be submitted. )], - [:normal, %(For each letter uploaded below, please note the letter writer's relationship to the group, for example: a beneficiary of the group, local resident or member of a partner charity.)], - [:bold, %(Once uploaded, all files are saved automatically. If you make a mistake and upload the wrong letter, please use the same button to upload the correct file as it will automatically replace the previous version.)] ] + end + + supporters :supporter_letters_list, "" do + ref "C 1" classes "question-support-uploads" limit 2 default 2