Skip to content

Commit

Permalink
move method into helper
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan committed Oct 11, 2024
1 parent 7fc2db1 commit 84d760f
Show file tree
Hide file tree
Showing 6 changed files with 81 additions and 86 deletions.
2 changes: 2 additions & 0 deletions app/components/job_application_review_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ class JobApplicationReviewComponent < ReviewComponent
)
end)

attr_reader :job_application

def initialize(job_application, step_process:, allow_edit: nil, classes: [], html_attributes: {}, **)
super(
classes: classes,
Expand Down
6 changes: 1 addition & 5 deletions app/controllers/publishers/vacancies/build_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Publishers::Vacancies::BuildController < Publishers::Vacancies::BaseContro
:pay_package, :important_dates, :start_date, :applying_for_the_job, :how_to_receive_applications, :application_link,
:application_form, :school_visits, :visa_sponsorship, :contact_details, :about_the_role, :include_additional_documents, :documents

helper_method :form, :job_application_sample
helper_method :form

before_action :strip_checkbox_params, only: %i[update]
before_action :set_school_options
Expand All @@ -21,10 +21,6 @@ def show
render_wizard
end

def job_application_sample
@job_application_sample ||= SampleJobApplication.sample_job_application
end

def update
if form.valid?
update_vacancy
Expand Down
75 changes: 75 additions & 0 deletions app/helpers/job_applications_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,79 @@ def radio_button_legend_hint
}
end
end

def job_application_sample(vacancy) # rubocop: disable Metrics/MethodLength
JobApplication.new(
first_name: "Jane",
last_name: "Smith",
previous_names: "Churchill",
street_address: "1 House Street",
city: "Townington",
postcode: "AB1 2CD",
country: "England",
phone_number: "07123456789",
teacher_reference_number: "1234567",
qualified_teacher_status: "yes",
qualified_teacher_status_year: "2021",
email_address: "[email protected]",
support_needed: "yes",
support_needed_details: "I require a wheelchair accessible room for an interview",
close_relationships: "yes",
close_relationships_details: "Brother-in-law works at the trust",
personal_statement:
"As an English teacher, I am extremely passionate about instilling a love of reading and the written word into young people. I have been interested in a position at your school for a number of years and was thrilled to see this opportunity. I received my QTS in 2019, and have since worked as an English teacher in a secondary school in Sheffield.<br />
In the classroom, I always strive to modify my approach to suit a range of abilities and motivation. By planning lessons around my students’ interests, I have been able to inspire even the most unmotivated readers into a love of books. For example, teaching descriptive writing by looking at their favourite sports and persuasive writing via marketing materials for their favourite shops. Furthermore, I have worked with dozens of students for whom English is their second language and nothing motivates me more than seeing that lightbulb moment happen when they can see their own progress. Last year, 95% of my GCSE students passed with grade 5 or above, and I have a proven track record for ensuring all of my KS3 students improve by at least two grades over years 7 to 9.<br />
Moreover, I believe that good teaching doesn’t just happen in the classroom. I am a strong advocate for student wellbeing and pastoral support and have greatly enjoyed leading a morning form class for the last three years. Also, in my current school I have contributed to the English department by running a weekly book club, and organising several school trips to literary locations such as Haworth and Stratford Upon Avon, as well as visits to see plays on the curriculum.<br />
I really resonate with your school’s ethos around inclusion and leaving no student behind, and I hope to be an asset to your English department, while continuing to grow as a teacher.",
employment_history_section_completed: true,
employments:
[
Employment.new(
organisation: "Townington Secondary School",
job_title: "KS3 Teaching Assistant",
main_duties: "Pastoral support for students. Managing student behaviour. Monitored students’ progress and gave feedback to teachers.",
reason_for_leaving: "Moving out of the area",
subjects: Faker::Educator.subject,
started_on: Faker::Date.in_date_period(year: 2016),
current_role: "no",
ended_on: Faker::Date.in_date_period(year: 2018),
),
Employment.new(
organisation: "Sheffield Secondary School",
job_title: "English Teacher",
main_duties: "Planning and delivering English Literature and Language lessons ro a range of abilities across KS3 and GCSE to prepare them for exams. Contributing to the English department via extra curricular activities, organising trips, and running a reading club.",
reason_for_leaving: "No opportunities for career advancement",
subjects: Faker::Educator.subject,
started_on: Faker::Date.in_date_period(year: 2016),
current_role: "no",
ended_on: Faker::Date.in_date_period(year: 2018),
),
],
references:
[
Reference.new(name: "Laura Davison", organisation: "Townington Secondary School", relationship: "Line manager", email: "[email protected]"),
Reference.new(name: "John Thompson", organisation: "Sheffield Secondary School", relationship: "Line manager", email: "[email protected]"),
],
qualifications:
[
Qualification.new(category: :undergraduate, year: 2016, subject: "BA English Literature", grade: "2.1"),
Qualification.new(category: :other, year: 2019, subject: "PGCE English with QTS"),
Qualification.new(category: :a_level, year: 2012, qualification_results: [
QualificationResult.new(subject: "English Literature", grade: "A"),
QualificationResult.new(subject: "History", grade: "B"),
QualificationResult.new(subject: "French", grade: "A"),
]),
Qualification.new(category: :gcse, year: 2010, qualification_results: [
QualificationResult.new(subject: "Maths", grade: "A"),
QualificationResult.new(subject: "English Literature", grade: "A"),
QualificationResult.new(subject: "English Language", grade: "B"),
QualificationResult.new(subject: "History", grade: "C"),
QualificationResult.new(subject: "French", grade: "A"),
QualificationResult.new(subject: "Music", grade: "B"),
QualificationResult.new(subject: "Geography", grade: "C"),
]),
],
vacancy: vacancy,
)
end
end
78 changes: 0 additions & 78 deletions app/services/sample_job_application.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

- s.with_row do |row|
- row.with_key text: t("helpers.label.jobseekers_job_application_personal_details_form.teacher_reference_number_review")
- row.with_value text: job_application_jobseeker_profile_info(job_application)
- row.with_value text: job_application.teacher_reference_number

- s.with_row do |row|
- row.with_key text: t("helpers.legend.jobseekers_job_application_professional_status_form.statutory_induction_complete")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
li = item

= govuk_details(summary_text: "See what an application form looks like") do
= job_application_review(job_application_sample, step_process: {}, show_tracks: false, show_sidebar: false, allow_edit: false) do |r|
- render "jobseekers/job_applications/job_application_review_sections", r: r, job_application: job_application_sample
= job_application_review(job_application_sample(vacancy), step_process: {}, show_tracks: false, show_sidebar: false, allow_edit: false) do |r|
- render "jobseekers/job_applications/job_application_review_sections", r: r, job_application: r.job_application

- if vacancy.listed? || current_organisation.local_authority?
= f.hidden_field :enable_job_applications
Expand Down

0 comments on commit 84d760f

Please sign in to comment.