Skip to content

Commit

Permalink
Your household interview led - User journey built to the household su…
Browse files Browse the repository at this point in the history
…mmary page
  • Loading branch information
saedwards committed Dec 6, 2018
1 parent 9f3cb18 commit 2971a0d
Show file tree
Hide file tree
Showing 15 changed files with 1,152 additions and 35 deletions.
6 changes: 6 additions & 0 deletions _data/your-household-interview-led.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ navigationItemsHousehold:
state: current
- label: Accommodation
state: incomplete

navigationItemsHouseholdComplete:
- label: People in your household
state: complete
- label: Accommodation
state: incomplete
2 changes: 1 addition & 1 deletion _includes/footer-eq-default-transactional.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<footer class="footer" role="contentinfo">
<footer class="footer u-mt-xl u-pt-xl" role="contentinfo">
<div class="container">
<div class="grid">
<div class="grid__col col-12@m">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ export const tempAwayQuestionSentenceMap = {
'less-twelve': 'People who are temporarily outside the UK for less than 12' +
' months',
'usually-temp': 'People staying temporarily who usually live in the UK but' +
' do not have another UK address, for example, relatives, friends',
' do not have another UK address',
'other': 'Other people who usually live here, including anyone temporarily' +
' away from home'
};
4 changes: 3 additions & 1 deletion _prototypes/your-household-interview-led/bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,8 @@ window.ONS.helpers = {
window.ONS.utils = {
removeFromList,
trailingNameS,
numberToPositionWord
numberToPositionWord,
getSignificant
};

$(populateHouseholdList);
Expand All @@ -404,3 +405,4 @@ $(tools);
$(updateAllPreviousLinks);
$(updateBySurveyType);
$(updateSignificantDate);

Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: Census Coverage Survey
project: your-household
globalcss: false
layout: eq-default-extras
cdn: v1.8.4
hideSaveLater: true
footer: minimal
---

<link rel="stylesheet" href="../style.css"/>
<div class="page__subheader">
<div class="container">
<a class="js-previous-link mars" href="../do-you-live-here">Previous</a>
</div>
</div>

<div class="page__container container">
<div class="grid grid--reverse">
<div class="grid__col col-4@m">
{% include navigation.html
title="Your household"
items=site.data.your-household-interview-led.navigationItemsHousehold
%}
</div>
<div class="grid__col col-7@m pull-1@m">
<main role="main" id="main" class="page__main">
<form id="form" name="trav" class="form qa-questionnaire-form"
role="form" autocomplete="off" novalidate="">
<input type="hidden" name="previous"
value="does-anyone-else-live-here"/>
<div class="group" id="rsi">
<div class="block" id="total-retail-turnover">
<section class="section">
<div class="question u-mb-s">
<h1 id="question-title"
class="question__title saturn">
Does anybody else live at <span
class="address-text"></span>?
</h1>
</div>

<div id="member-list"></div>

<div class="answer__fields js-fields">
<div class="field field--radio field--multiplechoice ">
<fieldset class="u-mb-xl">
<div class="field__item js-focusable-box">
<input class="input input--radio js-focusable"
type="radio"
name="does-anyone-else-live-here"
id="yes-someone-else"
value="yes">
<label class="label label--inline venus"
for="yes-someone-else"
id="yes-someone-else-label">
<span
class="yes-answer">Yes, I need to
add
another person</span>
<span
class="pluto u-db label--negative">Include partners, children, babies born on or before 19th August 2018, housemates, tenants and lodgers, students and schoolchildren who live away from home during term time</span>
</label>
</div>

<div class="field__item js-focusable-box">
<input class="input input--radio js-focusable"
type="radio"
name="does-anyone-else-live-here"
id="no" value="no">
<label class="label label--inline venus"
for="no">No, this is
everyone</label>
</div>
</fieldset>
</div>
</div>
</section>
</div>
</div>
<button class="btn btn--primary btn--lg qa-btn-submit venus"
type="submit" name="">Save and continue
</button>
</form>
</main>
</div>
</div>
</div>

<script src='/js/compiled/your-household-interview-led/bundle.js'></script>

<script>
var yesbox = document.getElementById("yes-someone-else"),
storageAPI = window.ONS.storage;
$('.qa-btn-submit').click(function(e) {

/**
* Routing
*/
if (!yesbox.checked) {
if (window.location.search.match(/journey=visitors/)) {
document.trav.action = "../summary";
}
else {
document.trav.action = "../temp-types-living-away";
}

} else {
document.trav.action = "../who-else-to-add";
}
});

$(function() {
var addressLines = (sessionStorage.getItem('address') || '').split(','),
addressLine1 = addressLines[0],
addressLine2 = addressLines[1],
householdMembers = storageAPI
.getAllHouseholdMembers().filter(storageAPI.isHouseholdMember),
nextPosition = householdMembers.length + 1;

if (window.location.search.match(/journey=visitors/)) {
$('#form')
.prepend('<input type="hidden" name="journey" value="visitors" />');
$('#question-title')
.html('Was there anyone else staying on ' + window.ONS.utils.getSignificant() + ' ' +
addressLine1 +
', ' + addressLine2 + '?');
$('#member-list').html('<ul id="visitors-list"></ul>');
$('#yes-someone-else-label').html('Yes, I need to add another visitor');
window.ONS.helpers.populateVisitorList();
}
else {
$('#member-list').html('<ul id="household-members"></ul>');
window.ONS.helpers.populateHouseholdList();
}

if ((nextPosition) > 1) {
$('.yes-answer').html(
'Yes, I need to add a ' +
window.ONS.utils.numberToPositionWord(nextPosition) +
' person'
);
}
});
</script>
25 changes: 6 additions & 19 deletions _prototypes/your-household-interview-led/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,14 @@
please spare a little time for a short
interview?</p>

<div class="definition js-details u-mb-s"
data-hide-label="Click to collapse."
data-show-label="Click to expand.">

<a href="#definition"
class="definition__link mars js-details-trigger u-no-js-hide icon--details"
aria-expanded="false"
data-js-accordion-event-label="Why your answer is important"
data-ga-label="definition-pattern-library"
data-ga-action="Definition click"
data-ga="click"
data-ga-category="Help">Why do I have to include my visitors? <span class="u-vh js-details-label">Click to expand.</span></a>

<h3
class="venus u-no-js-show u-mb-no">Why do I have to include my visitors?</h3>

<div id="definition" class="definition__main js-details-body">
<div class="definition__content mars">
<div class="collapsible collapsible--simple js-collapsible js-collapsible-simple has-js" id="collapsible-0">
<div class="js-collapsible-content">
<h3
class="collapsible__title js-collapsible-title icon--collapsible-simple u-fs-r--b" data-ga="click" data-ga-category="definition" data-ga-action="Close panel" data-ga-label="What is the Census Coverage Survey?" id="collapsible-0-collapsible-title-0" aria-controls="collapsible-0-collapsible-body-0" aria-expanded="false" aria-selected="false" tabindex="0">What is the Census Coverage Survey?</h3>
<div class="collapsible__body js-collapsible-body" id="collapsible-0-collapsible-body-0" aria-labelledby="collapsible-title-0" aria-hidden="true">
<p>Lorem ipsum...</p>
<button class="btn--secondary btn--small js-collapsible-close u-no-js-hide" data-ga="click" data-ga-category="definition" data-ga-action="Close panel" data-ga-label="What is the Census Coverage Survey?">Hide this</button>
</div>
<button class="btn btn--secondary btn--small definition__content-close-trigger js-details-trigger u-no-js-hide">Hide this</button>
</div>
</div>
</div>
Expand Down
100 changes: 100 additions & 0 deletions _prototypes/your-household-interview-led/is-anyone-related.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
---
title: Census Coverage Survey
project: your-household
globalcss: false
layout: eq-default-extras
cdn: v1.8.4
hideSaveLater: true
footer: minimal
---

<link rel="stylesheet" href="../style.css"/>
<div class="page__subheader">
<div class="container">
<a class="js-previous-link mars"
href="../does-anyone-else-live-here">Previous</a>
</div>
</div>

<div class="page__container container">
<div class="grid grid--reverse">
<div class="grid__col col-4@m">
{% include navigation.html
title="Your household"
items=site.data.your-household-interview-led.navigationItemsHousehold
%}
</div>
<div class="grid__col col-7@m pull-1@m">
<main role="main" id="main" class="page__main">
<form name="trav" class="form qa-questionnaire-form" role="form"
autocomplete="off" novalidate="">
<input type="hidden" name="away-journeys"
value=""/>
<div class="group">
<div class="block">
<section class="section">
<div class="question u-mb-s"
id="total-retail-turnover-question">
<h1 class="question__title saturn js-heading">
Are any of these people related to
each other?
</h1>
</div>

<ul id="household-members" class="u-mb-l"></ul>

<div class="answer__fields js-fields">
<div class="field field--radio field--multiplechoice ">
<fieldset class="u-mb-xl">
<div class="field__item js-focusable-box">
<input class="input input--radio js-focusable"
type="radio"
name="is-this-everyone"
id="yes-someone-else"
value="yes">
<label class="label label--inline venus"
for="yes-someone-else"
id="yes-someone-else-label">Yes, some or all are related
</label>
</div>

<div class="field__item js-focusable-box">
<input class="input input--radio js-focusable"
type="radio"
name="is-this-everyone"
id="no" value="no">
<label class="label label--inline venus"
for="no">No, all
household members
are unrelated</label>
</div>
</fieldset>
</div>
</div>
</section>
</div>
</div>
<button class="btn btn--primary btn--lg qa-btn-submit venus"
type="submit" name="">Save and continue
</button>
</form>
</main>
</div>
</div>
</div>

<script src='/js/compiled/your-household-interview-led/bundle.js'></script>

<div style="display:none">
<div id="question-list-item-template" class="field__item js-focusable-box">
<input class="input input--checkbox js-focusable js-exclusive-checkbox-group js-answer-field" name="away-type" value="" id="" type="checkbox" />
<label class="label label--inline venus js-answer-label"></label>
</div>
</div>

<script>
$('.qa-btn-submit').on('click', function (e) {
e.preventDefault();
window.location.href = '../visitors';
});
</script>
9 changes: 7 additions & 2 deletions _prototypes/your-household-interview-led/section-intro.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ <h1 class="saturn">

<p class="mars"><strong class="card-number">1</strong>
Turn to card for 1 for the definition of a
household (not necessarily related) living at
household</p>

<p class="mars">A <strong>household</strong>,
which is one person living alone or a group
of people (not necessarily related) living at
the same address who share cooking facilities
and share a living room OR sitting room OR
dining area.
Expand All @@ -51,7 +55,8 @@ <h1 class="saturn">
</div>
</div>

<button class="btn btn--primary btn--lg qa-btn-submit venus btn-submit"
<button
class="btn btn--primary btn--lg qa-btn-submit venus btn-submit u-mb-l"
type="submit" name="">Continue
</button>
</main>
Expand Down
4 changes: 0 additions & 4 deletions _prototypes/your-household-interview-led/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
background : url('../img/icons/lockicon.svg') no-repeat left top;
}

.footer {
margin-top : 7rem;
}

.btn--danger {
background-color : #D0021B;
border-color : #D0021B;
Expand Down
Loading

0 comments on commit 2971a0d

Please sign in to comment.