-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add 'check eligibility cost time' pattern
- Loading branch information
1 parent
08368b7
commit 6129101
Showing
15 changed files
with
797 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,28 @@ | ||
var express = require('express') | ||
var router = express.Router() | ||
|
||
router.use(function (req, res, next) { | ||
|
||
// Store common vars in string | ||
|
||
res.locals.formData = ""; | ||
res.locals.formQuery = "?"; | ||
res.locals.data = {}; | ||
|
||
for (var name in req.query){ | ||
var value = req.query[name]; | ||
res.locals.formData += '<input type="hidden" name="'+name+'" value="' + value + '">\n'; | ||
res.locals.formQuery += name + "=" + value + "&"; | ||
res.locals.data[name] = value; | ||
} | ||
|
||
next(); | ||
|
||
}); | ||
|
||
// Route index page | ||
router.get('/', function (req, res) { | ||
res.render('index') | ||
}) | ||
|
||
// add your routes here | ||
|
||
module.exports = router |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
docs/views/examples/check-eligibility-cost-time/how-many-vehicles/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% extends "layout.html" %} {% block page_title %} Example - Forms {% endblock %} {% block content %} | ||
<main id="content" role="main"> | ||
|
||
<div class="grid-row"> | ||
<div class="column-two-thirds"> | ||
|
||
<form method="get" action="/docs/examples/check-eligibility-cost-time/licence-type/just-your-goods" class="form"> | ||
|
||
{{formData | safe}} | ||
|
||
<h1 class="heading-large"> | ||
How many vehicles will you operate? | ||
</h1> | ||
|
||
<fieldset> | ||
<legend class="visuallyhidden"> | ||
How many vehicles will you operate? | ||
</legend> | ||
|
||
<label class="form-label" for="how_many_vehicles_1">Number of vehicles</label> | ||
<input class="form-control form-control-1-8" id="how_many_vehicles_1" type="text" name="how_many_vehicles"> | ||
|
||
<br> | ||
<br> | ||
|
||
</fieldset> | ||
|
||
<div class="form-group"> | ||
<input type="submit" class="button" value="Continue" /> | ||
</div> | ||
|
||
</form> | ||
|
||
</div> | ||
</div> | ||
|
||
</main> | ||
{% endblock %} |
61 changes: 61 additions & 0 deletions
61
docs/views/examples/check-eligibility-cost-time/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
{% extends "layout.html" %} {% block page_title %} Check eligibility, cost and time {% endblock %} {% block content %} | ||
<main id="content" role="main"> | ||
|
||
<div class="grid-row"> | ||
<div class="column-two-thirds"> | ||
|
||
<form method="get" action="/docs/examples/check-eligibility-cost-time/over-18" class="form"> | ||
|
||
{{formData | safe}} | ||
|
||
<h1 class="heading-large"> | ||
Check eligibility, cost and time | ||
</h1> | ||
|
||
<p> | ||
You may want to let users check first eligibility, cost and time for using your service. | ||
</p> | ||
|
||
<p> | ||
You can see the code for this example here: | ||
</p> | ||
|
||
<div class="code"> | ||
/docs/documentation_routes.js | ||
/docs/views/examples/check-eligibility-cost-time | ||
</div> | ||
|
||
<br> | ||
|
||
<fieldset> | ||
<legend class="visuallyhidden"> | ||
Check eligibility, cost and time | ||
</legend> | ||
|
||
<p class="">In this section you'll be asked between 4 and 6 questions.</p> | ||
|
||
<p class="">The answers you give will show:</p> | ||
|
||
<ul class="list list-bullet "> | ||
<li>if you're eligible to transport goods</li> | ||
<li>how much it will cost for you to apply</li> | ||
<li>how long the application process will take</li> | ||
</ul> | ||
|
||
<p class="">This information will be different depending on your answers.</p> | ||
|
||
</fieldset> | ||
|
||
<br> | ||
|
||
<div class="form-group"> | ||
<input type="submit" class="button" value="Continue to questions" /> | ||
</div> | ||
|
||
</form> | ||
|
||
</div> | ||
</div> | ||
|
||
</main> | ||
{% endblock %} |
50 changes: 50 additions & 0 deletions
50
docs/views/examples/check-eligibility-cost-time/licence-type/just-your-goods/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% extends "layout.html" %} {% block page_title %} Driving lessons {% endblock %} {% block content %} | ||
<main id="content" role="main"> | ||
|
||
<div class="grid-row"> | ||
<div class="column-two-thirds"> | ||
|
||
<form method="get" action="/docs/examples/check-eligibility-cost-time/result/eligible" class="form"> | ||
|
||
{{formData | safe}} | ||
|
||
<h1 class="heading-large"> | ||
Will you be transporting just your own goods? | ||
</h1> | ||
|
||
<fieldset> | ||
<legend class="visuallyhidden"> | ||
Will you be transporting just your own goods? | ||
</legend> | ||
|
||
<div class="form-group"> | ||
<label for="just_your_goods_1" class="block-label"> | ||
<input type="radio" id="just_your_goods_1" name="just_your_goods" value="yes"> | ||
Yes | ||
</label> | ||
|
||
<label for="just_your_goods_2" class="block-label"> | ||
<input type="radio" id="just_your_goods_2" name="just_your_goods" value="no"> | ||
No | ||
</label> | ||
|
||
<label for="just_your_goods_3" class="block-label"> | ||
<input type="radio" id="just_your_goods_3" name="just_your_goods" value="no"> | ||
Not sure | ||
</label> | ||
|
||
</div> | ||
|
||
</fieldset> | ||
|
||
<div class="form-group"> | ||
<input type="submit" class="button" value="Continue" /> | ||
</div> | ||
|
||
</form> | ||
|
||
</div> | ||
</div> | ||
|
||
</main> | ||
{% endblock %} |
50 changes: 50 additions & 0 deletions
50
docs/views/examples/check-eligibility-cost-time/licence-type/outside-uk/index.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{% extends "layout.html" %} {% block page_title %} Driving lessons {% endblock %} {% block content %} | ||
<main id="content" role="main"> | ||
|
||
<div class="grid-row"> | ||
<div class="column-two-thirds"> | ||
|
||
<form method="get" action="/docs/examples/check-eligibility-cost-time/result/eligible" class="form"> | ||
|
||
{{formData | safe}} | ||
|
||
<h1 class="heading-large"> | ||
Will you be transporting outside the UK? | ||
</h1> | ||
|
||
<fieldset> | ||
<legend class="visuallyhidden"> | ||
Will you be transporting outside the UK? | ||
</legend> | ||
|
||
<div class="form-group"> | ||
<label for="outside_uk_1" class="block-label"> | ||
<input type="radio" id="outside_uk_1" name="outside_uk" value="yes"> | ||
Yes | ||
</label> | ||
|
||
<label for="outside_uk_2" class="block-label"> | ||
<input type="radio" id="outside_uk_2" name="outside_uk" value="no"> | ||
No | ||
</label> | ||
|
||
<label for="outside_uk_3" class="block-label"> | ||
<input type="radio" id="outside_uk_3" name="outside_uk" value="no"> | ||
Not sure | ||
</label> | ||
|
||
</div> | ||
|
||
</fieldset> | ||
|
||
<div class="form-group"> | ||
<input type="submit" class="button" value="Continue" /> | ||
</div> | ||
|
||
</form> | ||
|
||
</div> | ||
</div> | ||
|
||
</main> | ||
{% endblock %} |
Oops, something went wrong.