Skip to content

Commit 33a4a1e

Browse files
committed
Merge pull request #2136 from alphagov/convert-landlord-immigration-check-to-use-erb-templates-for-questions
Convert landlord-immigration-check to use ERB templates for questions
2 parents ae76f51 + 8d18e4b commit 33a4a1e

31 files changed

+212
-128
lines changed

lib/smart_answer_flows/landlord-immigration-check.rb

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ def define
66
status :published
77
satisfies_need "102373"
88

9+
use_erb_templates_for_questions
10+
911
postcode_question :property? do
1012
permitted_next_nodes = [
1113
:main_home?,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<% content_for :title do %>
2+
Does the person have an application for a Registration Card issued by the Home Office showing that they can stay in the UK?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<% content_for :title do %>
2+
Does the person have a Certificate of Registration or Naturalisation as a British citizen?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<% content_for :title do %>
2+
Does the person have any of the following:
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
9+
10+
<% content_for :body do %>
11+
- a Registration Certificate or Document Certifying Permanent Residence issued by the Home Office to a national of the EU, EEA or Switzerland
12+
- a valid Biometric Residence Permit issued by the Home Office endorsed to show they’re allowed to stay indefinitely in the UK
13+
- a Permanent Residence Card, indefinite leave to remain, indefinite leave to enter or no time limit card issued by the Home Office
14+
- a valid passport showing that the person is exempt from immigration control, can stay indefinitely in the UK, has the right of abode in the UK or has no time limit on their stay in the UK
15+
- a current Immigration Status Document showing that the person has indefinite leave to stay in the UK or has no time limit to their stay
16+
- other documents exempting the person from immigration control (eg diplomatic passports, NATO ID card)
17+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<% content_for :title do %>
2+
Does the person have 2 of the following:
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
9+
10+
<% content_for :body do %>
11+
- a full birth or adoption certificate (that shows details of at least one of the birth
12+
or adoptive parents) from the UK, the Channel Islands, the Isle of Man or Ireland
13+
- an official letter or document (dated within the last 3 months) from a government agency or department (with their name and work address), an employer (with their name and company address) or UK passport holder (with their name, address and passport number) that confirms the person’s name and that they’re an employee
14+
- a letter from a UK police force issued within the last 3 months confirming the person is a victim of crime and their documents have been stolen
15+
- evidence that the person is currently serving in the UK armed forces or has previously served
16+
- HM prison discharge papers or probation service letter (or the same from the Scottish or Northern Ireland Prison Service)
17+
- a letter from a UK further or higher education institution confirming the person has been accepted for studies
18+
- a current UK driving licence (either full or provisional)
19+
- a current UK firearms or shot gun certificate
20+
- a Disclosure or Barring Service certificate issued in the last 6 months
21+
- benefits paperwork from HMRC, a local authority, the Department for Work and Pensions (DWP) or Jobcentre Plus within the last 12 months
22+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<% content_for :title do %>
2+
Does the person have a current Residence Card that is issued by the Home Office to a non-EEA national who is the family member of an EU, EEA or Swiss national?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
9+
10+
<% content_for :body do %>
11+
This includes a current Accession Card or Derivative Card.
12+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<% content_for :title do %>
2+
Does the person have a current or expired UK or Republic of Ireland passport or are they a named person in their parent’s UK or Republic of Ireland passport?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
9+
10+
<% content_for :body do %>
11+
A named person is someone who appears on someone else’s passport.
12+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<% content_for :title do %>
2+
Does the person have an outstanding immigration application, immigration appeal or administrative review?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
9+
10+
<% content_for :body do %>
11+
They must also provide their Home Office reference number.
12+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<% content_for :title do %>
2+
Is the person renting the property as their main and only home?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
9+
10+
<% content_for :body do %>
11+
This includes:
12+
13+
- tenancy agreement
14+
- a lease
15+
- a licence
16+
- sub-lease or sub-tenancy
17+
- lodgers
18+
- paying house guests
19+
- a family member living with the tenant as their main or only home
20+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<% content_for :title do %>
2+
Enter the postcode of the property you want to let:
3+
<% end %>
4+
5+
<% content_for :error_postcode_invalid do %>
6+
Invalid postcode
7+
<% end %>
8+
<% content_for :error_postcode_incomplete do %>
9+
Please enter a full postcode
10+
<% end %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<% content_for :title do %>
2+
What kind of property are you letting?
3+
<% end %>
4+
5+
<% options(
6+
"holiday_accommodation": "holiday accommodation",
7+
"social_housing": "social housing",
8+
"care_home": "a care home or hospice",
9+
"hostel_or_refuge": "a hostel or refuge",
10+
"mobile_home": "a mobile home",
11+
"employee_accommodation": "accommodation to an employee or as part of training, eg tied accommodation",
12+
"student_accommodation": "student accommodation",
13+
"7_year_lease_property": "a residential property with a lease for 7 years or more"
14+
) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<% content_for :title do %>
2+
Does the person have a certificate of right of abode in their passport?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<% content_for :title do %>
2+
Is the person:
3+
<% end %>
4+
5+
<% options(
6+
"eu_eea_switzerland": "from the EU, EEA or Switzerland",
7+
"non_eea_but_with_eu_eea_switzerland_family_member": "a non-EEA family member of someone from the EU, EEA or Switzerland",
8+
"somewhere_else": "from somewhere else"
9+
) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<% content_for :title do %>
2+
Is the person at least 18 years of age?
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<% content_for :title do %>
2+
Does the person have any of the following:
3+
<% end %>
4+
5+
<% options(
6+
"yes": "Yes",
7+
"no": "No"
8+
) %>
9+
10+
<% content_for :body do %>
11+
- a current passport endorsed to show that the person can stay in the UK
12+
- a current Biometric Residence Permit issued by the Home Office to the person showing that they can currently stay in the UK
13+
- an Immigration Status Document issued by the Home Office with an endorsement showing the person can currently stay in the UK
14+
<% end %>

lib/smart_answer_flows/locales/en/landlord-immigration-check.yml

-126
This file was deleted.

test/artefacts/landlord-immigration-check/B1 1PW.html

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ <h2>
6868

6969

7070

71+
7172
</div>
7273
</div>
7374
</div>

test/artefacts/landlord-immigration-check/B1 1PW/no.html

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ <h2>
3838

3939

4040

41+
4142
<div class="">
4243

4344
<ul class="options">
@@ -93,6 +94,7 @@ <h2>
9394

9495

9596

97+
9698
</div>
9799
</div>
98100
</div>

test/artefacts/landlord-immigration-check/B1 1PW/yes.html

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ <h2>
3838

3939

4040

41+
4142
<div class="">
4243

4344
<ul class="options inline">
@@ -57,6 +58,7 @@ <h2>
5758

5859

5960

61+
6062
</div>
6163
</div>
6264
</div>

test/artefacts/landlord-immigration-check/B1 1PW/yes/yes.html

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ <h2>
5858

5959

6060

61+
6162
</div>
6263
</div>
6364
</div>

test/artefacts/landlord-immigration-check/B1 1PW/yes/yes/no.html

+2
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ <h2>
3838

3939

4040

41+
4142
<div class="">
4243

4344
<ul class="options inline">
@@ -57,6 +58,7 @@ <h2>
5758

5859

5960

61+
6062
</div>
6163
</div>
6264
</div>

0 commit comments

Comments
 (0)