Skip to content

Commit

Permalink
add skeleton for moreinfo logic > relates #26
Browse files Browse the repository at this point in the history
  • Loading branch information
VirtualDOMinic committed Sep 14, 2018
1 parent 3b91e6b commit 6caa834
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 1 deletion.
14 changes: 14 additions & 0 deletions public/js/populatemoreinfo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@


// callback just logs each key in session storage
function callback(k) {
console.log(k)
}

function forEachKey(callback) {
for (var i = 0; i < sessionStorage.length; i++) {
callback(sessionStorage.key(i));
}
}

forEachKey(callback)
2 changes: 2 additions & 0 deletions src/controllers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ const background = require('./background');
const resources = require('./resources');
const error = require('./error');
const moreinfo = require('./moreinfo');
const results = require('./results');

router.use(bodyParser.urlencoded({extended: true}));
router.get('/', home.get);
router.get('/welcome', welcome.get);
router.get('/background', background.get);
router.get('/resources', resources.get);
router.get('/more-info', moreinfo.get);
router.get('/results', results.get);

// trigger 500 error for testing

Expand Down
5 changes: 5 additions & 0 deletions src/controllers/results.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
exports.get = (req, res) => {
res.render('results', {
layout: 'scrollable'
});
}
4 changes: 3 additions & 1 deletion src/views/moreinfo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,6 @@
<button class="govuk-button">Let's go!</button>
</form>
</div>
</section>
</section>

<script src="js/populatemoreinfo.js"></script>
17 changes: 17 additions & 0 deletions src/views/results.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<nav class='grid-row'>
<div class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1'>
<h1>Results</h1>
</div>
</nav>
<section class='grid-row'>
<div class='centered-column centered-content secondary-background thirtytwo-padding full-height'>
<p>WE GOT NUTHIN</p>
</div>
</section>
<section class='grid-row'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1'>
<form action='/background' class='centered-content'>
<button class="govuk-button">Complain!</button>
</form>
</div>
</section>

0 comments on commit 6caa834

Please sign in to comment.