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

Convert calculate-your-holiday-entitlement to use ERB templates for questions #2128

Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Use ERB templates for Qs in calculate-your-holiday-entitlement
I ran the following command:

    $ rails r script/convert-question-i18-yaml-to-erb-templates.rb lib/smart_answer_flows/calculate-your-holiday-entitlement
    Writing template: basis_of_calculation.govspeak.erb
    Writing template: calculation_period.govspeak.erb
    Writing template: how_many_days_per_week.govspeak.erb
    Writing template: what_is_your_starting_date.govspeak.erb
    Writing template: what_is_your_leaving_date.govspeak.erb
    Writing template: how_many_hours_per_week.govspeak.erb
    Writing template: compressed_hours_how_many_hours_per_week.govspeak.erb
    Writing template: compressed_hours_how_many_days_per_week.govspeak.erb
    Writing template: casual_or_irregular_hours.govspeak.erb
    Writing template: annualised_hours.govspeak.erb
    Writing template: shift_worker_basis.govspeak.erb
    Writing template: shift_worker_hours_per_shift.govspeak.erb
    Writing template: shift_worker_shifts_per_shift_pattern.govspeak.erb
    Writing template: shift_worker_days_per_shift_pattern.govspeak.erb
    Writing template: when_does_your_leave_year_start.govspeak.erb

    Deleting i18n YAML: calculate-your-holiday-entitlement.yml

    Now insert `use_erb_templates_for_questions` at top of flow: calculate-your-holiday-entitlement.rb
floehopper authored and chrisroos committed Nov 19, 2015
commit c25843f22e6107a42797508e3d2cbf64d997a1b4
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% content_for :title do %>
How many hours will be worked a year?
<% end %>

<% content_for :hint do %>
This is calculated by excluding statutory entitlement. This calculation isn't suitable for term-time workers.
<% end %>

<% content_for :label do %>
Hours per year
<% end %>

<% content_for :error_message do %>
You need to enter a number greater than 0. Don't enter fractions. If you work half-hours, enter .5 for half. eg 340.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<% content_for :title do %>
Is the holiday entitlement based on:
<% end %>

<% options(
"days-worked-per-week": "days worked per week",
"hours-worked-per-week": "hours worked per week",
"casual-or-irregular-hours": "casual or irregular hours",
"annualised-hours": "annualised hours",
"compressed-hours": "compressed hours",
"shift-worker": "shifts"
) %>

<% content_for :hint do %>
Check the employment contract if you’re not sure about the holiday entitlement.
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<% content_for :title do %>
Do you want to work out holiday:
<% end %>

<% options(
"full-year": "for a full leave year",
"starting": "for someone starting part way through a leave year",
"leaving": "for someone leaving part way through a leave year",
"starting-and-leaving": "for someone starting and leaving part way through a leave year"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% content_for :title do %>
How many hours have been worked in this leave year?
<% end %>

<% content_for :hint do %>
The holiday entitlement may be calculated as the leave builds up ('accrues') for each hour worked.
<% end %>

<% content_for :label do %>
Hours worked
<% end %>

<% content_for :error_message do %>
You need to enter a number greater than 0. Don't enter fractions. If you work half-hours, enter .5 for half. eg 340.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
Number of days per week worked?
<% end %>

<% content_for :label do %>
Days per week
<% end %>

<% content_for :error_message do %>
Please check and enter a correct value. Don't enter fractions. If you work half-days, enter .5 for half. eg 4.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
How many hours are worked per week?
<% end %>

<% content_for :label do %>
Hours per week
<% end %>

<% content_for :error_message do %>
You can enter a maximum of 168 hours per week. Don't enter fractions. If you work half-hours, enter .5 for half. eg 40.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
Number of days worked per week?
<% end %>

<% content_for :hint do %>
If you work half-days enter .5 for a half, eg 3.5 for three and a half days.
<% end %>

<% content_for :error_message do %>
Please check and enter a correct value. Don't enter fractions. If you work half-days, enter .5 for half. eg 4.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
Number of hours worked per week?
<% end %>

<% content_for :hint do %>
If you work half-hours enter .5 for a half, eg 40.5.
<% end %>

<% content_for :error_message do %>
You can enter a maximum of 168 hours per week. Don't enter fractions. If you work half-hours, enter .5 for half. eg 40.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<% content_for :title do %>
Do you want to calculate the holiday:
<% end %>

<% options(
"full-year": "for a full leave year",
"starting": "for someone starting part way through a leave year",
"leaving": "for someone leaving part way through a leave year",
"starting-and-leaving": "for someone starting and leaving part way through a leave year"
) %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<% content_for :title do %>
How many days in the shift pattern?
<% end %>

<% content_for :hint do %>
The shift pattern includes non-working days.
<% end %>

<% content_for :label do %>
Days per pattern
<% end %>

<% content_for :error_message do %>
You need to enter a number greater than or equal to the number of shifts you work. Don't enter fractions. If you work half-days, enter .5 for half. eg 4.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
How many hours in each shift?
<% end %>

<% content_for :label do %>
Hours per shift
<% end %>

<% content_for :error_message do %>
You need to enter a number greater than 0. Don't enter fractions. If you work half-hours, enter .5 for half. eg 4.5
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<% content_for :title do %>
How many shifts will be worked per shift pattern?
<% end %>

<% content_for :label do %>
Shifts per pattern
<% end %>

<% content_for :error_message do %>
You need to enter a number greater than 0
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% content_for :title do %>
What was the employment end date?
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<% content_for :title do %>
What was the employment start date?
<% end %>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<% content_for :title do %>
When does the leave year start?
<% end %>

<% content_for :hint do %>
This is usually in the employment contract. If it isn’t and the job was started after 1 October 1998, the leave year will start on the 1st day of the job. If the job was started on or before 1 October 1998, the leave year will start on 1 October.
<% end %>

This file was deleted.