Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class and form update for new year #644

Merged
merged 1 commit into from
Jan 31, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/award_year.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class AwardYear < ApplicationRecord

after_create :create_settings

AVAILABLE_YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024]
AVAILABLE_YEARS = [2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024, 2025]

DEFAULT_FINANCIAL_DEADLINE_DAY = 17
DEFAULT_FINANCIAL_DEADLINE_MONTH = 9
Expand Down
3 changes: 2 additions & 1 deletion app/models/form_answer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
require_relative '../../forms/award_years/v2022/qae_forms'
require_relative '../../forms/award_years/v2023/qae_forms'
require_relative '../../forms/award_years/v2024/qae_forms'
require_relative '../../forms/award_years/v2025/qae_forms'

class FormAnswer < ApplicationRecord
include Statesman::Adapters::ActiveRecordQueries[
Expand Down Expand Up @@ -155,7 +156,7 @@ def award_form
elsif self.class.const_defined?(award_form_class_name(year))
self.class.const_get(award_form_class_name(year))
else
AwardYears::V2024::QaeForms # default value
AwardYears::V2025::QaeForms # default value
end
else
raise ArgumentError, "Can not find award form for the nomination in year: #{award_year.year}"
Expand Down
43 changes: 42 additions & 1 deletion forms/appraisal_form.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class AppraisalForm
#
# THIS NEED TO BE UPDATED EACH YEAR
#
SUPPORTED_YEARS = [2022, 2023, 2024]
SUPPORTED_YEARS = [2022, 2023, 2024, 2025]

EVALUATION_OPTIONS_2022 = [
["Weak evidence", "weak"],
Expand All @@ -24,6 +24,12 @@ class AppraisalForm
["Strong evidence", "strong"]
]

EVALUATION_OPTIONS_2025 = [
["Weak evidence", "weak"],
["Good evidence", "good"],
["Strong evidence", "strong"]
]

VERDICT_OPTIONS_2022 = [
["Not Recommended", "not_recommended"],
["Recommended", "recommended"],
Expand All @@ -42,6 +48,12 @@ class AppraisalForm
["Undecided", "undecided"]
]

VERDICT_OPTIONS_2025 = [
["Not Recommended", "not_recommended"],
["Recommended", "recommended"],
["Undecided", "undecided"]
]

def self.evaluation_options_for(object, section)
options = const_get("EVALUATION_OPTIONS_#{object.award_year.year}")

Expand Down Expand Up @@ -164,9 +176,38 @@ def self.verdict_options_for(object, section)
}
}.freeze

QAVS_2025 = {
good_impact: {
type: :rag,
label: "Good impact",
position: 0
},
volunteer_led: {
type: :rag,
label: "Volunteer-led",
position: 1
},
good_governance: {
type: :rag,
label: "Good governance",
position: 2
},
exceptional_qualities: {
type: :rag,
label: "Exceptional qualities",
position: 3
},
verdict: {
type: :verdict,
label: "Overall decision",
position: 4
}
}.freeze

ALL_FORMS_2022 = [QAVS_2022]
ALL_FORMS_2023 = [QAVS_2023]
ALL_FORMS_2024 = [QAVS_2024]
ALL_FORMS_2025 = [QAVS_2025]

def self.rate(key)
"#{key}_rate"
Expand Down
4 changes: 4 additions & 0 deletions forms/award_years/v2025/qae_forms.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
require_relative 'qavs'

class AwardYears::V2025::QaeForms
end
30 changes: 30 additions & 0 deletions forms/award_years/v2025/qavs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require_relative "qavs/qavs_step1"
require_relative "qavs/qavs_step2"
require_relative "qavs/qavs_step3"
require_relative "qavs/qavs_step4"
require_relative "qavs/qavs_step5"

class AwardYears::V2025::QaeForms
class << self
def qavs
@qavs ||= QaeFormBuilder.build "King's Award for Voluntary Service Nomination" do
step "nominee",
&AwardYears::V2025::QaeForms.qavs_step1

step "recommendation",
&AwardYears::V2025::QaeForms.qavs_step2

step "letters_of_support",
{ id: :letters_of_support_step },
&AwardYears::V2025::QaeForms.qavs_step3

step "submit_step",
&AwardYears::V2025::QaeForms.qavs_step4

step "local_assessment_form",
{ id: :local_assessment },
&AwardYears::V2025::QaeForms.qavs_step5
end
end
end
end
116 changes: 116 additions & 0 deletions forms/award_years/v2025/qavs/qavs_step1.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
# coding: utf-8
class AwardYears::V2025::QaeForms
class << self
def qavs_step1
@qavs_step1 ||= proc do
notice %(
<p class=govuk-body>Please note your answers are being saved automatically in the background.</p>
)

header :nominee_details_header, "Group details" do
ref "A 1"
end

text :nominee_name, "Name of group" do
sub_ref "A 1.1"
required
form_hint "It is important that the name is accurate and spelt correctly, as this will appear on the Award certificate if your nomination succeeds. You do not need to add a charity number."
style "large"
end

text :nominee_established_date, "When was the group established?" do
sub_ref "A 1.2"
required
style "small"
end

dropdown :nominee_activity, "Please select the group's main area of activity" do
sub_ref "A 1.3"
required
option "", ""
nominee_activities
end

dropdown :secondary_activity, "Please select the group's secondary area of activity (optional)" do
sub_ref "A 1.4"
option "", ""
nominee_activities
end

address :nominee_address, "Address of group" do
sub_ref "A 1.5"
required
sub_fields([
{ building: "Building" },
{ street: "Street" },
{ city: "Town or city" },
{ county: "County" },
{ postcode: "Postcode" }
])
end

text :nominee_phone, "Telephone number" do
sub_ref "A 1.6"
style "small"
type "tel"
end

text :nominee_website, "Website" do
sub_ref "A 1.7"
style "large"
end

textarea :social_media, "Social media" do
sub_ref "A 1.8"
form_hint "Social media accounts if known"
words_max 100
rows 2
end

header :nominee_leader_header, "About the group leader or main contact in the group" do
ref "A 2"
context %(
<p class='govuk-hint'>This is the person the County Assessment Panel will contact to ask any questions or arrange a visit.</p>
)
end

text :nominee_leader_name, "Name of the group leader or main contact in the group" do
sub_ref "A 2.1"
required
style "small"
end

text :nominee_leader_position, "Position held in the group" do
sub_ref "A 2.2"
required
style "large"
end

address :nominee_leader_address, "Address of main contact" do
sub_ref "A 2.3"
required
sub_fields([
{ building: "Building" },
{ street: "Street" },
{ city: "Town or city" },
{ county: "County" },
{ postcode: "Postcode" }
])
end

text :nominee_leader_email, "Email" do
sub_ref "A 2.4"
required
type "email"
style "large"
end

text :nominee_leader_telephone, "Telephone" do
sub_ref "A 2.5"
style "small"
type "tel"
end
end
end
end
end
78 changes: 78 additions & 0 deletions forms/award_years/v2025/qavs/qavs_step2.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# -*- coding: utf-8 -*-
class AwardYears::V2025::QaeForms
class << self
def qavs_step2
@qavs_step2 ||= proc do
notice %(
<p class=govuk-body>Please note your answers are being saved automatically in the background.</p>
)

header :recommendation, "About this section" do
help "About this section", %(
<p class='govuk-body'>
In this section, please explain how the nominated group has made a significant contribution in its area of activity. We are looking for groups that have given excellent service to their beneficiaries and communities; have delivered their service in innovative ways, and have shown other examples of selfless voluntary service that distinguish their work.
<strong>Please answer each question, noting the word limits, explaining what achievements make the nominated group stand out from others.</strong>
</p>
)
end

textarea :group_activities, "Please summarise the activities of the group" do
ref "B 1"
required
words_max 50
rows 2
end

textarea :beneficiaries, "Who are the beneficiaries (the people it helps) and where do they live?" do
ref "B 2"
required
words_max 30
rows 2
end

textarea :benefits, "What are the benefits of the group's work?" do
ref "B 3"
required
words_max 100
rows 2
end

textarea :volunteers, "This Award is specifically for groups that rely on significant and committed work by volunteers. Please explain what the volunteers do and what makes this particular group of volunteers so impressive?" do
ref "B 4"
required
words_max 200
rows 5
end

checkbox_seria :how_did_you_hear_about_award, "How did you hear about the Award this year?" do
ref "B 5"
required
context %(
<p class='govuk-hint'>Select all that apply.</p>
)
check_options [
["national_newspaper", "National newspaper"],
["local_newspaper", "Local newspaper"],
["tv_radio", "TV/radio"],
["internet", "Internet"],
["word_of_mouth", "Word of mouth"],
["previous_winner", "Previous winner/entrant"],
["charity", "Voluntary organisation/charity"],
["event", "Local event"],
["library", "Local library"],
["council", "Local Council"],
["other", "Other"]
]
end

textarea :how_did_you_hear_about_award_other_details, "" do
required
context %(
<p class='govuk-hint'>Please outline any other sources in the text box below:</p>
)
conditional :how_did_you_hear_about_award, "other"
end
end
end
end
end
37 changes: 37 additions & 0 deletions forms/award_years/v2025/qavs/qavs_step3.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
class AwardYears::V2025::QaeForms
class << self
def qavs_step3
@qavs_step3 ||= proc do
notice %(
<p class=govuk-body>Please note your answers are being saved automatically in the background.</p>
)

supporters :supporter_letters_list, "" do
ref "C 1"
context %(
<p class='govuk-hint'><a href="https://kavs.dcms.gov.uk/make-a-nomination/nominate/">Before you start, please refer to our full guidance for letters of support as outlined on our website.</a></p>
<p class='govuk-hint'>Please obtain two different letters that endorse the nominated group's contribution from people who are familiar with its work.</p>
<p class='govuk-hint'>
Supporters must not be volunteers or paid workers in the group. Each letter should be no more than 500 words. The letters should be about the whole group, rather than just one volunteer and should help to show how its work is outstanding.
</p>
<p class='govuk-hint'>Please list below the names of the supporters and their relationship (if any) to the group.</p>
)
hint "What are the allowed file formats?", %(
<p class='govuk-hint'>
Letter of support must be no larger than 5 MB.
</p>
<p class='govuk-hint'>
They can be:
<br>
Images in jpg, jpeg and png formats;
<br>
Files in doc, docx, odt, pdf and txt formats.
)
classes "question-support-uploads"
limit 2
default 1
end
end
end
end
end
Loading
Loading