Skip to content

Commit

Permalink
Merge pull request #51 from fac-14/resultspage
Browse files Browse the repository at this point in the history
Results page
  • Loading branch information
sunuwars authored Sep 21, 2018
2 parents ef15784 + b477e2b commit d8651e7
Show file tree
Hide file tree
Showing 19 changed files with 173 additions and 107 deletions.
6 changes: 6 additions & 0 deletions public/images/down-arrow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion public/js/formaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var resourceString = [];
Object.keys(sessionStorage).forEach(i => {
if (i.includes("-background")) {
backgroundString.push(i.replace('-background', '').replace(" ", "%20"))
console.log(i, "is background")
} else if (i.includes("-resource")) {
resourceString.push(i.replace ('-resource', '').replace(" ", "%20"))
}
Expand Down
10 changes: 10 additions & 0 deletions public/js/hideresultssections.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
function hideMe(event) {
var a;
if (event.target.nodeName == "IMG"){
var a = event.target.parentNode.id + '-results';
} else {
var a = event.target.id + '-results';
}
var elementToHide = document.getElementById(a)
elementToHide.classList.toggle('hidden');
}
Binary file not shown.
57 changes: 36 additions & 21 deletions public/stylesheets/main.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/stylesheets/main.css.map

Large diffs are not rendered by default.

31 changes: 25 additions & 6 deletions public/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ h1 {
font-size: $heading-1;
}

h3 {
text-align: center;
h2 {
font-size: $heading-2;
}

progress[value] {
Expand All @@ -94,6 +94,7 @@ progress[value]::-webkit-progress-bar {

progress[value]::-webkit-progress-value {
background-color: $accent-colour;
box-shadow: 0 2px 5px $accent-colour-dark inset;
}

progress {
Expand All @@ -117,6 +118,10 @@ textarea {
resize: none;
}

a {
cursor: pointer;
}

// CLASSES

.full-viewport {
Expand All @@ -143,6 +148,7 @@ textarea {
}

.li-outer {
list-style-type: none;
font-family: $body-font;
color: $primary-text-colour;
font-weight: $regular-font;
Expand Down Expand Up @@ -171,7 +177,7 @@ textarea {

.centered-column {
@include oGridCenter;
@include oGridColspan((default: 12, M: 8, L: 6));
@include oGridColspan((default: 12, M: 10, L: 8));
}

.centered-content {
Expand All @@ -184,7 +190,6 @@ textarea {
flex-direction:column;
}


.centered-content-no-padding {
display: flex;
align-items: center;
Expand All @@ -202,8 +207,13 @@ textarea {
.thirtytwo-padding {
padding: 32px;
}

.padding-lft {
padding-left:64px;
padding-left: 42px;
}

.bottom-padding-lft {
padding-left: 54px;
}

.progressbar {
Expand All @@ -219,6 +229,15 @@ textarea {
font-size: $medium-font-size;
}

.hidden {
display: none;
}

.down-arrow-img {
height: $base-font-size;
width: $heading-1;
}

// IDS

#more-info-field {
Expand Down Expand Up @@ -253,7 +272,7 @@ img {
border: {
radius: $round-image;
}
width: $small-image;
max-height: 60vh;
max-width: 90%;
}

Expand Down
4 changes: 0 additions & 4 deletions src/controllers/sendinfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,13 @@ exports.post = (req, response) => {
console.log('resultArray', resultArray);
const outArray = filterByType(resultArray);
console.log('OUTPUT ARRAY', outArray);
//response.cookie('results', outArray);
response.render('results', {
results: outArray,
layout: 'scrollable',
progressamt: '100',
title: 'Results',
pageInfo: 'Based on the checkboxes you have selected, here are your results. This is a work in progress - if you feel there aren\'t many resources that apply to you, please come back again later. We\'ll be adding more as we go long.',
});
//response.redirect('/results');
//response.json({'results': outArray});
//response.send(outArray);
})
.catch(err => console.log(err));

Expand Down
1 change: 1 addition & 0 deletions src/database/db_connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ const url = require("url");
require("env2")("./config.env");

let DB_URL = process.env.DB_URL;

if(process.env.NODE_ENV === 'test') {
DB_URL = process.env.TEST_DB_URL;
console.log(DB_URL);
Expand Down
2 changes: 2 additions & 0 deletions src/model/getData.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ const getData = (bgArray, rscArray) => {

console.log("DATAQUERY=", dataQuery);

console.log("Database URL=", process.env.DB_URL);

return new Promise((resolve, reject) => {
db.query(dataQuery)
.then(res => resolve(res))
Expand Down
1 change: 0 additions & 1 deletion src/model/get_resource_detail.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ const getResourceDetail = resourceId => {
};

module.exports = getResourceDetail;
console.log("herehere");
getResourceDetail(1)
.then(res => console.log(res.rows))
.catch(err => console.log(err));
Expand Down
2 changes: 1 addition & 1 deletion src/views/background.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
</div>
</section>
<section class='grid-row'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1 bottom-padding-lft'>
<form action='/resources' class='centered-content'>
<button class="govuk-button">Get resources</button>
</form>
Expand Down
4 changes: 2 additions & 2 deletions src/views/home.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
</div>
</figure>
<section class='grid-row'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1'>
<p>Think that a career in tech isn't for 'someone like you?' Let us prove you wrong!</p>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1 bottom-padding-lft'>
<p>Think that a career in tech isn't for 'someone like you'? Let us prove you wrong!</p>
</div>
</section>

Expand Down
2 changes: 1 addition & 1 deletion src/views/moreinfo.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</div>
</section>
<section class='grid-row'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1 bottom-padding-lft'>
<form action='/results' class='centered-content' id='final-form' method='POST'>
<button class="govuk-button">Show me the results</button>
</form>
Expand Down
2 changes: 1 addition & 1 deletion src/views/partials/heading.hbs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<nav class='grid-row'>
<div class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1'>
<div class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1 padding-lft'>
<h1>{{title}}</h1>
</div>
</nav>
2 changes: 1 addition & 1 deletion src/views/partials/pageinformation.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{{#if pageInfo}}
<section class='grid-row'>
<div class='centered-column centered-content secondary-background thirtytwo-padding'>
<div class='centered-column centered-content secondary-background thirtytwo-padding flex-col padding-lft'>
{{pageInfo}}
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion src/views/resources.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</div>
</section>
<section class='grid-row'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1'>
<div id='bottom-section' class='centered-column centered-content secondary-background thirtytwo-padding fixed-height-double-h1 bottom-padding-lft'>
<form action='/more-info' class='centered-content'>
<button class="govuk-button">Next!</button>
</form>
Expand Down
Loading

0 comments on commit d8651e7

Please sign in to comment.