-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
370 additions
and
69 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
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
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,20 +1,9 @@ | ||
// go tests | ||
const fs = require('fs'); | ||
const dbConnection = require('./db_connection'); | ||
const fs = require("fs"); | ||
const dbConnection = require("./db_connection"); | ||
|
||
const sql = fs.readFileSync(`${__dirname}/test_build.sql`).toString(); | ||
|
||
const initialiseTestDatabase = () => dbConnection.query(sql); | ||
|
||
// const runDbTestBuild = () => | ||
// new Promise((resolve, reject) => { | ||
// dbConnection.query(sql, (err, result) => { | ||
// if (err) { | ||
// reject(err); | ||
// } else { | ||
// resolve(result); | ||
// } | ||
// }); | ||
// }); | ||
|
||
module.exports = initialiseTestDatabase; | ||
module.exports = initialiseTestDatabase; |
File renamed without changes.
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,37 @@ | ||
nav{ | ||
display: flex; | ||
width: 100vw; | ||
} | ||
|
||
#xp-section{ | ||
background-color: aqua; | ||
display: flex; | ||
flex-direction: row; | ||
width: 70vw; | ||
height: 3rem; | ||
align-items: center; | ||
justify-content: flex-start; | ||
} | ||
|
||
progress[value] { | ||
/* Reset the default appearance */ | ||
-webkit-appearance: none; | ||
appearance: none; | ||
} | ||
|
||
#xp-bar{ | ||
width: 50vw; | ||
height: 20px; | ||
} | ||
|
||
#avatar-section{ | ||
background-color: aquamarine; | ||
} | ||
|
||
h3{ | ||
margin: 1rem; | ||
} | ||
|
||
#profile-pic{ | ||
width: 8rem; | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,3 +1,11 @@ | ||
const queries = require("../model/index"); | ||
|
||
exports.get = (req, res) => { | ||
res.render("challSelect", { layout: "content-selected" }); | ||
queries.getSingleChallenge().then(challengeDetails => { | ||
console.log("challenge details: ", challengeDetails); | ||
res.render("challSelect", { | ||
layout: "content-selected", | ||
challenge: challengeDetails[0] | ||
}); | ||
}); | ||
}; |
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,3 +1,17 @@ | ||
const queries = require("../model/index"); | ||
|
||
exports.get = (req, res) => { | ||
res.render("dashboard"); | ||
}; | ||
|
||
const newChallenges = queries.getChallenges(); | ||
const acceptedChallenges = queries.getAcceptedChallenges(); | ||
const completedChallenges = queries.getCompletedChallenges(); | ||
|
||
Promise.all([newChallenges, acceptedChallenges, completedChallenges]) | ||
.then(challenges => { | ||
res.render("dashboard", { | ||
newChallenges: challenges[0], | ||
acceptedChallenges: challenges[1], | ||
completedChallenges: challenges[2] | ||
}); | ||
}) | ||
}; |
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,7 @@ | ||
const queries = require("../model/index"); | ||
|
||
exports.get = (req, res) => { | ||
queries.getAcceptedChallenges().then(acceptedChallenges => { | ||
res.render("dashboard", { acceptedChallenges: acceptedChallenges }); | ||
}); | ||
}; |
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,7 @@ | ||
const queries = require("../model/index"); | ||
|
||
exports.get = (req, res) => { | ||
queries.getCompletedChallenges().then(completedChallenges => { | ||
res.render("dashboard", { completedChallenges: completedChallenges }); | ||
}); | ||
}; |
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
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
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
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 +1,36 @@ | ||
// can use getAcceptedChallenges for this so delete later | ||
const getCompletedChallenges = () => { | ||
return new Promise((resolve, reject) => { | ||
const result = [ | ||
{ | ||
id: 2, | ||
inventory_id: null, | ||
title: "Dont buy plastic water bottles for a week", | ||
what: "maybe buy refillable bottle", | ||
why: "saving lots of plastic", | ||
ext_link: | ||
"https://www.independent.co.uk/environment/plastic-bottles-waste-recycling-pollution-single-use-keep-britain-tidy-water-a8307591.html", | ||
img_link: | ||
"https://www.banthebottle.net/wp-content/uploads/2009/06/ban-all-bottles-300x225.jpg", | ||
reward_points: 10, | ||
repeatable: true | ||
}, | ||
{ | ||
id: 3, | ||
inventory_id: null, | ||
title: "Stop trashing you dick", | ||
what: "maybe buy refillable bottle", | ||
why: "saving lots of plastic", | ||
ext_link: | ||
"https://www.independent.co.uk/environment/plastic-bottles-waste-recycling-pollution-single-use-keep-britain-tidy-water-a8307591.html", | ||
img_link: | ||
"https://www.banthebottle.net/wp-content/uploads/2009/06/ban-all-bottles-300x225.jpg", | ||
reward_points: 10, | ||
repeatable: true | ||
} | ||
]; | ||
resolve(result); | ||
}); | ||
}; | ||
|
||
module.exports = getCompletedChallenges; |
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
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 |
---|---|---|
|
@@ -13,4 +13,4 @@ module.exports = { | |
getChallenges, | ||
getCompletedChallenges, | ||
getSingleChallenge | ||
} | ||
} |
Oops, something went wrong.