Skip to content

Commit

Permalink
#53 Retrieves data for about section
Browse files Browse the repository at this point in the history
  • Loading branch information
dangerdak committed Oct 11, 2017
1 parent bc37ef9 commit 03bcd3a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
18 changes: 11 additions & 7 deletions src/controllers/about.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
const { saveAboutMe } = require('../model/form_queries');
const { saveAboutMe, getSection } = require('../model/form_queries');

exports.get = (req, res) => {
res.render('about', {
activePage: { about: true },
pageTitle: 'About Me',
previousPage: '/symptoms',
nextPage: '/background',
});
getSection(req.session.id, 'about_me')
.then((data) => {
res.render('about', {
activePage: { about: true },
pageTitle: 'About Me',
previousPage: '/symptoms',
nextPage: '/background',
data,
});
});
};

exports.post = (req, res) => {
Expand Down
12 changes: 6 additions & 6 deletions src/views/about.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<ol>
<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"><span class='li mr2 w2'>&rarr;</span> What are some things you like? (including hobbies and interests)?
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="likes" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your hobbies'></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="likes" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your hobbies'>{{data.likes}}</textarea>
</li>

<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"><span class='li mr2 w2'>&rarr;</span> Tell us what you don't like!
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="dislikes" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your dislikes'></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="dislikes" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your dislikes'>{{data.dislikes}}</textarea>
</li>

<div class="ideasbutton">
Expand All @@ -25,12 +25,12 @@

<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"><span class='li mr2 w2'>&rarr;</span> What are some of your strengths?
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="stengths" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your strengths'></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="stengths" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know your strengths'>{{data.strengths}}</textarea>
</li>

<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"><span class='li mr2 w2'>&rarr;</span> What would you like to be better at?
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="weaknesses" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know where you want to improve'></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="weaknesses" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know where you want to improve'>{{data.weaknesses}}</textarea>
</li>

<div class="ideasbutton">
Expand All @@ -41,12 +41,12 @@

<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"><span class='li mr2 w2'>&rarr;</span> What makes you feel uncomfortable or anxious?
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="uncomfortable" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know what makes you uncomfortable'></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="uncomfortable" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know what makes you uncomfortable'>{{data.uncomfortable}}</textarea>
</li>

<li class="f5 black-60 db mb2 tracked pt3 pb3 mr2"><span class='li mr2 w2'>&rarr;</span> What helps you feel safe and calm?
<br>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="safe" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know what makes you feel safe'></textarea>
<textarea class="mt3 w-80 mw7 vh-5 ba b--black-30 br3 h4" type="text" name="safe" rows="8" cols="80" placeholder="Write here please" aria-label='please let us know what makes you feel safe'>{{data.safe}}</textarea>
</li>
</ol>

Expand Down

0 comments on commit 03bcd3a

Please sign in to comment.