diff --git a/Untitled b/Untitled
new file mode 100644
index 0000000..e69de29
diff --git a/data/TESTING.json b/data/TESTING.json
new file mode 100644
index 0000000..b3cde00
--- /dev/null
+++ b/data/TESTING.json
@@ -0,0 +1,173 @@
+{
+ "markers": [
+ {
+ "name": "Finsburry",
+ "lat": 51.52617,
+ "lng": -0.10866
+ },
+ {
+ "name": "Shoreditch",
+ "lat": 51.52639,
+ "lng": -0.08017
+ },
+ {
+ "name": "Whitechapel",
+ "lat": 51.51848,
+ "lng": -0.06317
+ }
+ ],
+ "title": "TravelLog",
+ "users": [
+ {
+ "id": "admin",
+ "pwd": "123",
+ "adventures": [
+ {
+
+ "name": "beach",
+ "Date_Visited": "2016-01-02",
+ "Times_Visited": "2",
+ "Rating": "5",
+ "Hours_Spent": "3",
+ "Description": "",
+ "image": "beach.jpeg",
+ "lat": "51.51730898361811",
+ "lng": "-0.1123523712158203"
+ },
+ {
+ "name": "geisel",
+ "Date_Visited": "2016-03-05",
+ "Times_Visited": "5",
+ "Rating": "9",
+ "Hours_Spent": "10",
+ "Description": "",
+ "image": "geisel.jpg",
+ "lat": "51.528950998551906",
+ "lng": "-0.1041126251220703"
+ },
+ {
+ "name": "Potato Chip",
+ "Date_Visited": "0002-02-02",
+ "Times_Visited": "",
+ "Rating": "10",
+ "Hours_Spent": "",
+ "Description": "",
+ "image": "potatochip.jpg",
+ "lat": "51.50361379162682",
+ "lng": "-0.11278152465820314"
+ },
+ {
+ "name": "Bridge",
+ "Date_Visited": "1001-04-04",
+ "Times_Visited": "1",
+ "Rating": "10",
+ "Hours_Spent": "",
+ "Description": "",
+ "image": "http://lorempixel.com/600/200/?random=33",
+ "lat": "51.5100245354003",
+ "lng": "-0.10402679443359375"
+ },
+ {
+ "name": "MyHouse3",
+ "Date_Visited": "1996-01-30",
+ "Times_Visited": "2",
+ "Rating": "9",
+ "Hours_Spent": "20000",
+ "Description": " woww",
+ "image": "http://lorempixel.com/600/200/?random=19",
+ "lng": "-0.07673263549804688",
+ "lat": "51.51931851179036"
+ },
+ {
+ "name": "Cool place 2",
+ "Date_Visited": "1996-03-30",
+ "Times_Visited": "",
+ "Rating": "9",
+ "Hours_Spent": "",
+ "Description": "",
+ "image": "http://lorempixel.com/600/200/?random=74",
+ "lat": "51.49752274956565",
+ "lng": "-0.10746002197265625"
+ },
+ {
+ "name": "Testing123",
+ "Date_Visited": "2016-01-02",
+ "Times_Visited": "2",
+ "Rating": "5",
+ "Hours_Spent": "3",
+ "Description": "",
+ "image": "http://lorempixel.com/600/200/?random=33",
+ "lat": "51.51730898361811",
+ "lng": "-0.1123523712158203"
+ },
+ {
+ "name": "Geisel2.0",
+ "Date_Visited": "2016-01-02",
+ "Times_Visited": "23",
+ "Rating": "3",
+ "Hours_Spent": "111",
+ "Description": "I like studying here",
+ "image": "http://lorempixel.com/600/200/?random=41",
+ "lng": "-0.08565902709960938",
+ "lat": "51.49848454717058"
+ },
+ {
+ "name": "Testing",
+ "Date_Visited": "2016-03-05",
+ "Times_Visited": "5",
+ "Rating": "9",
+ "Hours_Spent": "10",
+ "Description": "",
+ "image": "http://lorempixel.com/600/200/?random=82",
+ "lat": "51.528950998551906",
+ "lng": "-0.1041126251220703"
+ },
+ {
+ "name": "Camden Town",
+ "Date_Visited": "2016-11-13",
+ "Times_Visited": "2",
+ "Rating": "5",
+ "Hours_Spent": "10",
+ "Description": " It was great!",
+ "image": "http://lorempixel.com/600/200/?random=93",
+ "lng": "-0.14110565185546875",
+ "lat": "51.53886172138777"
+ },
+ {
+ "image": "http://lorempixel.com/600/200/?random=43",
+ "lng": "-0.04113435745239257",
+ "lat": "51.511373347874375"
+ },
+ {
+ "name": "Went Doge hunting",
+ "Date_Visited": "2016-11-17",
+ "Times_Visited": "9",
+ "Rating": "2",
+ "Hours_Spent": "23",
+ "Description": " Found a nice Doge",
+ "image": "TOTFHBANNER.png",
+ "lat": "51.49570596538067",
+ "lng": "-0.01373291015625"
+
+ }
+ ]
+ },
+ {
+ "id": "ogilad",
+ "pwd": "abc123",
+ "adventures": []
+ },
+ {
+ "id": "ogilad2",
+ "pwd": "tester",
+ "adventures": []
+ },
+ {
+ "id": "bobody2",
+ "pwd": "creed",
+ "adventures": []
+ }
+ ],
+ "_locals": {},
+ "showGrid": true
+}
diff --git a/data/data.json b/data/data.json
new file mode 100644
index 0000000..0c62706
--- /dev/null
+++ b/data/data.json
@@ -0,0 +1,90 @@
+{
+ "markers": [
+ {
+ "name": "Finsburry",
+ "lat": 51.52617,
+ "lng": -0.10866
+ },
+ {
+ "name": "Shoreditch",
+ "lat": 51.52639,
+ "lng": -0.08017
+ },
+ {
+ "name": "Whitechapel",
+ "lat": 51.51848,
+ "lng": -0.06317
+ }
+ ],
+ "title": "TravelLog",
+ "users": [
+ {
+ "id": "admin",
+ "pwd": "123",
+ "adventures": [
+ {
+ "name": "beach",
+ "Date_Visited": "2016-01-02",
+ "Times_Visited": "2",
+ "Rating": "5",
+ "Hours_Spent": "3",
+ "Description": "",
+ "image": "beach.jpeg",
+ "lat": "51.51730898361811",
+ "lng": "-0.1123523712158203"
+ },
+ {
+ "name": "geisel",
+ "Date_Visited": "2016-03-05",
+ "Times_Visited": "5",
+ "Rating": "9",
+ "Hours_Spent": "10",
+ "Description": "",
+ "image": "geisel.jpg",
+ "lat": "51.528950998551906",
+ "lng": "-0.1041126251220703"
+ },
+ {
+ "name": "Potato Chip",
+ "Date_Visited": "0002-02-02",
+ "Times_Visited": "",
+ "Rating": "10",
+ "Hours_Spent": "",
+ "Description": "",
+ "image": "potatochip.jpg",
+ "lat": "51.50361379162682",
+ "lng": "-0.11278152465820314"
+ },
+ {
+
+ "name": "Sigma Kappa Rox",
+ "Date_Visited": "",
+ "Times_Visited": "",
+ "Rating": "",
+ "Hours_Spent": "",
+ "Description": " ",
+ "image": "14650445_10154610730858669_418477091311425272_n.jpg",
+ "lat": "51.51472517425703",
+ "lng": "-0.089263916015625"
+ }
+ ]
+ },
+ {
+ "id": "ogilad",
+ "pwd": "abc123",
+ "adventures": []
+ },
+ {
+ "id": "ogilad2",
+ "pwd": "tester",
+ "adventures": []
+ },
+ {
+ "id": "bobody2",
+ "pwd": "creed",
+ "adventures": []
+ }
+ ],
+ "_locals": {},
+ "showGrid": true
+}
diff --git a/index.html b/index.html
new file mode 100644
index 0000000..c2d4439
--- /dev/null
+++ b/index.html
@@ -0,0 +1,57 @@
+
+
+
+
+ Basic-express-site-2016 by origilad
+
+
+
+
+
+
+
+
+
+
+
+ Welcome to GitHub Pages.
+
+This automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here using GitHub Flavored Markdown , select a template crafted by a designer, and publish. After your page is generated, you can check out the new gh-pages
branch locally. If you’re using GitHub Desktop, simply sync your repository and you’ll see the new branch.
+
+
+ Designer Templates
+
+We’ve crafted some handsome templates for you to use. Go ahead and click 'Continue to layouts' to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved.
+
+
+ Creating pages manually
+
+If you prefer to not use the automatic generator, push a branch named gh-pages
to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.
+
+
+ Authors and Contributors
+
+You can @mention a GitHub username to generate a link to their profile. The resulting <a>
element will link to the contributor’s GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt ), PJ Hyett (@pjhyett ), and Tom Preston-Werner (@mojombo ) founded GitHub.
+
+
+ Support or Contact
+
+Having trouble with Pages? Check out our documentation or contact support and we’ll help you sort it out.
+
+
+
+
+
+
+
+
diff --git a/package.json b/package.json
index cf75e29..2c53217 100644
--- a/package.json
+++ b/package.json
@@ -5,8 +5,8 @@
"private": "true",
"main": "server.js",
"scripts": {
- "build-css": "stylus source/stylesheets/index.styl -o static/css",
- "watch-css": "stylus source/stylesheets/index.styl -o static/css -w",
+ "build-css": "stylus public/stylesheets/layout.styl -o static/css",
+ "watch-css": "stylus public/stylesheets/layout.styl -o static/css -w",
"clean": "rm -rf static/css && mkdir -p static/css",
"build": "npm run clean && npm run build-css",
"watch": "npm run clean && npm run watch-css & nodemon server -e js,jade",
@@ -15,10 +15,20 @@
"author": "Ben Gourley",
"license": "ISC",
"dependencies": {
- "express": "^4.13.4",
- "jade": "^1.11.0",
+ "body-parser": "^1.15.2",
+ "dialog": "^0.2.0",
+ "express": "^4.14.0",
+ "forms": "^1.2.0",
+ "geoip-lite": "^1.1.8",
+ "jade-bootstrap": "^1.0.9",
+ "jsonfile": "^2.4.0",
"morgan": "^1.7.0",
- "nodemon": "^1.9.1",
- "stylus": "^0.53.0"
+ "multer": "^1.2.0",
+ "nib": "^1.1.2",
+ "node-geocoder": "^3.15.1",
+ "nodemon": "^1.9.2",
+ "pug": "^2.0.0-beta6",
+ "pug-bootstrap": "0.0.3",
+ "stylus": "^0.54.5"
}
}
diff --git a/params.json b/params.json
new file mode 100644
index 0000000..952aede
--- /dev/null
+++ b/params.json
@@ -0,0 +1,6 @@
+{
+ "name": "Basic-express-site-2016",
+ "tagline": "Simple example Node website using Express (2016 edition)",
+ "body": "### Welcome to GitHub Pages.\r\nThis automatic page generator is the easiest way to create beautiful pages for all of your projects. Author your page content here [using GitHub Flavored Markdown](https://guides.github.com/features/mastering-markdown/), select a template crafted by a designer, and publish. After your page is generated, you can check out the new `gh-pages` branch locally. If you’re using GitHub Desktop, simply sync your repository and you’ll see the new branch.\r\n\r\n### Designer Templates\r\nWe’ve crafted some handsome templates for you to use. Go ahead and click 'Continue to layouts' to browse through them. You can easily go back to edit your page before publishing. After publishing your page, you can revisit the page generator and switch to another theme. Your Page content will be preserved.\r\n\r\n### Creating pages manually\r\nIf you prefer to not use the automatic generator, push a branch named `gh-pages` to your repository to create a page manually. In addition to supporting regular HTML content, GitHub Pages support Jekyll, a simple, blog aware static site generator. Jekyll makes it easy to create site-wide headers and footers without having to copy them across every page. It also offers intelligent blog support and other advanced templating features.\r\n\r\n### Authors and Contributors\r\nYou can @mention a GitHub username to generate a link to their profile. The resulting `` element will link to the contributor’s GitHub Profile. For example: In 2007, Chris Wanstrath (@defunkt), PJ Hyett (@pjhyett), and Tom Preston-Werner (@mojombo) founded GitHub.\r\n\r\n### Support or Contact\r\nHaving trouble with Pages? Check out our [documentation](https://help.github.com/pages) or [contact support](https://github.com/contact) and we’ll help you sort it out.\r\n",
+ "note": "Don't delete this file! It's used internally to help with page regeneration."
+}
\ No newline at end of file
diff --git a/public/images/14650445_10154610730858669_418477091311425272_n.jpg b/public/images/14650445_10154610730858669_418477091311425272_n.jpg
new file mode 100644
index 0000000..b374685
Binary files /dev/null and b/public/images/14650445_10154610730858669_418477091311425272_n.jpg differ
diff --git a/public/images/beach.jpeg b/public/images/beach.jpeg
new file mode 100644
index 0000000..c0d1d19
Binary files /dev/null and b/public/images/beach.jpeg differ
diff --git a/public/images/geisel.jpg b/public/images/geisel.jpg
new file mode 100644
index 0000000..75bb3e7
Binary files /dev/null and b/public/images/geisel.jpg differ
diff --git a/public/images/graph.png b/public/images/graph.png
new file mode 100644
index 0000000..f0aaaec
Binary files /dev/null and b/public/images/graph.png differ
diff --git a/public/images/potatochip.jpg b/public/images/potatochip.jpg
new file mode 100644
index 0000000..ca38e72
Binary files /dev/null and b/public/images/potatochip.jpg differ
diff --git a/public/stylesheets/layout.css b/public/stylesheets/layout.css
new file mode 100644
index 0000000..4bc87fd
--- /dev/null
+++ b/public/stylesheets/layout.css
@@ -0,0 +1,126 @@
+@import url("https://fonts.googleapis.com/css?family=Source+Code+Pro:400,200,700");
+* {
+ margin: 0;
+ padding: 0;
+ box-sizing: border-box;
+}
+body {
+ font-family: 'Source Code Pro', monospace;
+}
+.header {
+ background: url("https://images.unsplash.com/photo-1451337516015-6b6e9a44a8a3?crop=entropy&fit=crop&fm=jpg&h=975&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1925");
+ background-position: center;
+}
+.header .page-title {
+ font-weight: 200;
+ font-size: 80px;
+ text-align: center;
+ padding: 100px;
+ text-transform: uppercase;
+ color: #fff;
+}
+.nav1 {
+ background: #000;
+ text-align: center;
+}
+.nav1 li {
+ display: inline-block;
+}
+.nav1 a {
+ display: inline-block;
+ padding: 20px;
+ color: #fff;
+ text-decoration: none;
+}
+.nav1 a:hover {
+ background-color: #3ab795;
+ text-decoration: underline;
+}
+.main-content {
+ margin: 50px auto;
+ max-width: 600px;
+}
+.main-content p {
+ line-height: 1.6;
+ margin-bottom: 1.7em;
+}
+.footer {
+ margin: 50px auto;
+ max-width: 600px;
+ border-top: 1px solid #444;
+ padding: 20px 0;
+}
+.footer p {
+ color: #444;
+ font-size: 12px;
+}
+.image1 {
+ position: relative;
+ width: 100%;
+ display: table-cell;
+}
+h2 {
+ position: absolute;
+ top: 150px;
+ left: 0;
+ width: 100%;
+}
+h2 span {
+ color: #fff;
+ font: bold 24px/45px Helvetica, Sans-Serif;
+ letter-spacing: -1px;
+ background: #000; /* fallback color */
+ background: rgba(0,0,0,0.7);
+ padding: 10px;
+}
+.submitbtn {
+ display: inline-block;
+ color: #666;
+ background-color: #eee;
+ letter-spacing: 2px;
+ font-size: 14px;
+ padding: 10px 75px;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border: 1px solid rgba(0,0,0,0.3);
+ border-bottom-width: 3px;
+ position: relative;
+ top: 5px;
+ left: -10px;
+ margin: 10px;
+}
+.submitbtn:hover {
+ background-color: #e3e3e3;
+ border-color: rgba(0,0,0,0.5);
+}
+.submitbtn:active {
+ background-color: #ccc;
+ border-color: rgba(0,0,0,0.9);
+}
+.logintext {
+ width: 20px;
+}
+.reg {
+ margin-top: 8px;
+}
+.adventure {
+ display: table;
+ margin: auto;
+}
+.grid {
+ margin-left: 2%;
+ margin-right: 2%;
+}
+.grid_image {
+ float: left;
+ padding-left: 10px;
+ padding-right: 10px;
+ padding-top: 20px;
+ position: relative;
+}
+.grid_image span {
+ position: absolute;
+ right: 10px;
+ bottom: 75px;
+}
diff --git a/public/stylesheets/layout.styl b/public/stylesheets/layout.styl
new file mode 100644
index 0000000..1e6a29f
--- /dev/null
+++ b/public/stylesheets/layout.styl
@@ -0,0 +1,135 @@
+@import url('https://fonts.googleapis.com/css?family=Source+Code+Pro:400,200,700')
+
+*
+ margin 0
+ padding 0
+ box-sizing border-box
+
+body
+ font-family 'Source Code Pro', monospace
+
+.header
+ background url('https://images.unsplash.com/photo-1451337516015-6b6e9a44a8a3?crop=entropy&fit=crop&fm=jpg&h=975&ixjsv=2.1.0&ixlib=rb-0.3.5&q=80&w=1925')
+ background-position center
+
+ .page-title
+ font-weight 200
+ font-size 80px
+ text-align center
+ padding 100px
+ text-transform uppercase
+ color #fff
+
+.nav1
+ background #000
+ text-align center
+
+ li
+ display inline-block
+
+ a
+ display inline-block
+ padding 20px
+ color #fff
+ text-decoration none
+
+ &:hover
+ background-color #3AB795
+ text-decoration underline
+
+.main-content
+ margin 50px auto
+ max-width 600px
+
+ p
+ line-height 1.6
+ margin-bottom 1.7em
+
+.footer
+ margin 50px auto
+ max-width 600px
+ border-top 1px solid #444
+ padding 20px 0
+
+ p
+ color #444
+ font-size 12px
+.image1 {
+ position: relative;
+ width: 100%;
+ display: table-cell;
+}
+
+h2 {
+ position: absolute;
+ top: 150px;
+ left: 0;
+ width: 100%;
+}
+
+h2 span {
+ color: white;
+ font: bold 24px/45px Helvetica, Sans-Serif;
+ letter-spacing: -1px;
+ background: rgb(0, 0, 0); /* fallback color */
+ background: rgba(0, 0, 0, 0.7);
+ padding: 10px;
+}
+
+.submitbtn {
+ display: inline-block;
+ color: #666;
+ background-color: #eee;
+ letter-spacing: 2px;
+ font-size: 14px;
+ padding: 10px 75px;
+ border-radius: 5px;
+ -moz-border-radius: 5px;
+ -webkit-border-radius: 5px;
+ border: 1px solid rgba(0,0,0,0.3);
+ border-bottom-width: 3px;
+ position: relative;
+ top: 5px;
+ left: -10px;
+ margin: 10px;
+}
+
+ .submitbtn:hover {
+ background-color: #e3e3e3;
+ border-color: rgba(0,0,0,0.5);
+ }
+ .submitbtn:active {
+ background-color: #CCC;
+ border-color: rgba(0,0,0,0.9);
+ }
+.logintext {
+ width: 20px;
+}
+
+.reg {
+ margin-top: 8px;
+}
+
+.adventure {
+ display: table;
+ margin: auto;
+}
+
+.grid{
+ margin-left: 2%;
+ margin-right: 2%;
+}
+.grid_image
+{
+ float:left;
+ padding-left:10px;
+ padding-right: 10px;
+ padding-top: 20px;
+ position:relative;
+}
+
+.grid_image span{
+ position:absolute;
+ right:10px;
+ bottom:75px;
+}
diff --git a/routes/AdventureAnalytics.js b/routes/AdventureAnalytics.js
new file mode 100644
index 0000000..bc78afc
--- /dev/null
+++ b/routes/AdventureAnalytics.js
@@ -0,0 +1,89 @@
+var jsonfile = require('jsonfile'); //so we can easily write to json
+jsonfile.spaces = 4; //so when we write to jsonfile it formats
+var filepath = __dirname + "/../data/data.json";
+jsonContent = jsonfile.readFileSync(filepath); //read file and put as json object
+//jsonContent.adventures[1].name = "no"; //go to adventures[1].name = Testtingg
+jsonfile.writeFileSync(__dirname + '/../data/TESTING.json', jsonContent); //write back the stuff we changed
+
+
+exports.AdventureAnalytics = function(req, res){
+ try {
+ var user = req.params.user;
+ for(var i = 0; i highestRating){
+ highestRating = jsonContent.users[i].adventures[j].Rating;
+ highestRatedAdventures = [];
+ highestRatedAdventures[0] = jsonContent.users[i].adventures[j].name;
+ }
+ else if(jsonContent.users[i].adventures[j].Rating === highestRating ){
+ highestRatedAdventures[highestRatedAdventures.length] = jsonContent.users[i].adventures[j].name;
+ }
+ if(parseInt(jsonContent.users[i].adventures[j].Times_Visited) > highestVisit){
+ highestVisit = jsonContent.users[i].adventures[j].Times_Visited;
+ mostAdventures = [];
+ mostAdventures[0] = jsonContent.users[i].adventures[j].name;
+ }
+ else if(jsonContent.users[i].adventures[j].Times_Visited === highestVisit ){
+ mostAdventures[mostAdventures.length] = jsonContent.users[i].adventures[j].name;
+ }
+ if(parseInt(jsonContent.users[i].adventures[j].Hours_Spent) > highestHours){
+ highestHours = jsonContent.users[i].adventures[j].Hours_Spent;
+ mostHours = [];
+ mostHours[0] = jsonContent.users[i].adventures[j].name;
+ }
+ else if(jsonContent.users[i].adventures[j].Hours_Spent === highestHours ){
+ mostHours[mostHours.length] = jsonContent.users[i].adventures[j].name;
+ }
+
+ if(jsonContent.users[i].adventures.length < 10){
+ message = "Oh No! You've gone on less than 10 adventures, you should go out more!";
+ }
+ }
+ console.log("321");
+ weekAnalytics.adventureTime = parseInt(0);
+ weekAnalytics.totalVisits = parseInt(0);
+ console.log("123");
+ for(var wi = 0; wi code {
+ padding: 0;
+ margin: 0;
+ font-size: 0.9rem;
+ color: #567482;
+ word-break: normal;
+ white-space: pre;
+ background: transparent;
+ border: 0; }
+.main-content .highlight {
+ margin-bottom: 1rem; }
+ .main-content .highlight pre {
+ margin-bottom: 0;
+ word-break: normal; }
+.main-content .highlight pre, .main-content pre {
+ padding: 0.8rem;
+ overflow: auto;
+ font-size: 0.9rem;
+ line-height: 1.45;
+ border-radius: 0.3rem; }
+.main-content pre code, .main-content pre tt {
+ display: inline;
+ max-width: initial;
+ padding: 0;
+ margin: 0;
+ overflow: initial;
+ line-height: inherit;
+ word-wrap: normal;
+ background-color: transparent;
+ border: 0; }
+ .main-content pre code:before, .main-content pre code:after, .main-content pre tt:before, .main-content pre tt:after {
+ content: normal; }
+.main-content ul, .main-content ol {
+ margin-top: 0; }
+.main-content blockquote {
+ padding: 0 1rem;
+ margin-left: 0;
+ color: #819198;
+ border-left: 0.3rem solid #dce6f0; }
+ .main-content blockquote > :first-child {
+ margin-top: 0; }
+ .main-content blockquote > :last-child {
+ margin-bottom: 0; }
+.main-content table {
+ display: block;
+ width: 100%;
+ overflow: auto;
+ word-break: normal;
+ word-break: keep-all; }
+ .main-content table th {
+ font-weight: bold; }
+ .main-content table th, .main-content table td {
+ padding: 0.5rem 1rem;
+ border: 1px solid #e9ebec; }
+.main-content dl {
+ padding: 0; }
+ .main-content dl dt {
+ padding: 0;
+ margin-top: 1rem;
+ font-size: 1rem;
+ font-weight: bold; }
+ .main-content dl dd {
+ padding: 0;
+ margin-bottom: 1rem; }
+.main-content hr {
+ height: 2px;
+ padding: 0;
+ margin: 1rem 0;
+ background-color: #eff0f1;
+ border: 0; }
+
+@media screen and (min-width: 64em) {
+ .main-content {
+ max-width: 64rem;
+ padding: 2rem 6rem;
+ margin: 0 auto;
+ font-size: 1.1rem; } }
+
+@media screen and (min-width: 42em) and (max-width: 64em) {
+ .main-content {
+ padding: 2rem 4rem;
+ font-size: 1.1rem; } }
+
+@media screen and (max-width: 42em) {
+ .main-content {
+ padding: 2rem 1rem;
+ font-size: 1rem; } }
+
+.site-footer {
+ padding-top: 2rem;
+ margin-top: 2rem;
+ border-top: solid 1px #eff0f1; }
+
+.site-footer-owner {
+ display: block;
+ font-weight: bold; }
+
+.site-footer-credits {
+ color: #819198; }
+
+@media screen and (min-width: 64em) {
+ .site-footer {
+ font-size: 1rem; } }
+
+@media screen and (min-width: 42em) and (max-width: 64em) {
+ .site-footer {
+ font-size: 1rem; } }
+
+@media screen and (max-width: 42em) {
+ .site-footer {
+ font-size: 0.9rem; } }
+
+
diff --git a/views/AdventureAnalytics.pug b/views/AdventureAnalytics.pug
new file mode 100644
index 0000000..64c2f3e
--- /dev/null
+++ b/views/AdventureAnalytics.pug
@@ -0,0 +1,21 @@
+extend layout
+
+
+block prepend links
+ - var homeURL = '/Home/' + user.id;
+ - var adURL = '/AdventureAnalytics/' + user.id;
+ - var travelURL = '/TravelLog/' + user.id;
+
+block append content
+ include includes/analyticstabs
+
+ //Google analytics stuff
+ script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-87345316-1', 'auto');
+ ga('send', 'pageview');
+ ga('send','event','tab','switchTabs');
diff --git a/views/Login.pug b/views/Login.pug
new file mode 100644
index 0000000..9b9d681
--- /dev/null
+++ b/views/Login.pug
@@ -0,0 +1,43 @@
+
+//Google analytics stuff
+script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-87345316-1', 'auto');
+ ga('send', 'pageview');
+ ga('send','event','button','login')
+
+
+html
+ head
+ //where to get more css formatting
+ link(rel='stylesheet', href='/stylesheets/layout.css')
+ link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css')
+ link(rel='stylesheet', href='stylesheets/style.css')
+ //can rename title to something else later
+ title #{title} - Spots
+
+ body
+ .header
+ h1.page-title Spots
+
+
+block content
+ .main.container
+ .row
+ .col-md-6.col-md-offset-3
+ h1.display-2.m-b-2(style="text-align:center") Begin your adventure
+ form(name="login", method="post")
+ div.input
+ label Username
+ input(label="WOW", type="text", name="username", class='form-control').logintext
+ div.input
+ label Password
+ input(type="password",name="password", class='form-control').logintext
+ div(style="text-align:center;")
+ div.action
+ input(type="submit", value="Log in").submitbtn
+ div(style="margin-top:3px; position:relative;left:-8px;") Don't have an account?
+ Sign up!
diff --git a/views/Register.pug b/views/Register.pug
new file mode 100644
index 0000000..3671d3e
--- /dev/null
+++ b/views/Register.pug
@@ -0,0 +1,47 @@
+-//Google analytics stuff
+
+
+html
+ head
+ //where to get more css formatting
+ link(rel='stylesheet', href='/stylesheets/layout.css')
+ link(rel='stylesheet', href='//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css')
+ link(rel='stylesheet', href='stylesheets/style.css')
+ //can rename title to something else later
+ title #{title} - Spots
+
+ body
+ .header
+ h1.page-title Spots
+
+block content
+
+ .main.container
+ .row
+ .col-md-6.col-md-offset-3
+ h1.display-2.m-b-2(style="text-align:center") Create a Spots acccount!
+ form(name="add-estimation", method="post")
+ div.input
+ label.reg Username
+ input(label="WOW", type="text", name="username", class='form-control')
+ div.input
+ label.reg Password
+ input(type="password",name="password", class='form-control').logintext
+ div.input
+ label.reg Confirm password
+ input(type="password",name="confirmpassword", class='form-control').logintext
+ div(style="text-align:center; position:relative; top:10px")
+ div.action
+ input(type="submit", value="Create Account").submitbtn
+ div(style="margin-top:3px; position:relative;left:-8px;") Already have an account?
+ Log in here
+
+ //Google analytics stuff
+ script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-87345316-1', 'auto');
+ ga('send', 'pageview');
+ ga('send','event','button','register');
diff --git a/views/TravelLog.pug b/views/TravelLog.pug
new file mode 100644
index 0000000..31d7adf
--- /dev/null
+++ b/views/TravelLog.pug
@@ -0,0 +1,57 @@
+extend layout
+
+
+
+block prepend links
+ - var homeURL = '/Home/' + user.id;
+ - var adURL = '/AdventureAnalytics/' + user.id;
+ - var travelURL = '/TravelLog/' + user.id;
+
+block content
+ //Google analytics stuff
+ script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-87345316-1', 'auto');
+ ga('send', 'pageview');
+ ga('send','event','button','clickOnAdventure');
+
+
+ if(showGrid)
+ //paragraph for title
+ style.
+ h3 {font-size: 50px; text-align: center;color: #464646; margin-bottom:20px}
+
+ block content
+ h3 Travel Log
+
+ div(class="grid")
+ //go through all of the adventures from the json file that we read
+ //GRID LAYOUT THOUGH
+ each adventure in user.adventures
+ div(class="grid_image", id= adventure.id)
+ a(href="/adventure/" +user.id+"/"+ adventure.name, class="adventure")
+ img(src="/images/"+adventure.image,
+ style="width:300px; height: 300px;")
+ h2
+ span #{adventure.name}
+
+ else
+ //paragraph for title
+ style.
+ h3 {font-size: 50px; text-align: center;color: #464646; margin-bottom:20px}
+
+ block content
+ h3 Travel Log
+
+ //go through all of the adventures from the json file that we read
+ each adventure in user.adventures
+ a(href="/adventure/" +user.id+"/"+ adventure.name, class="adventure")
+ div(class="image1", id= adventure.id)
+ img(src="/images/"+adventure.image,
+ style="width:600px; height: 200px; margin-bottom:5px;",
+ alt="")
+ h2(style="margin:0px")
+ span #{adventure.name}
diff --git a/views/adventure.pug b/views/adventure.pug
new file mode 100644
index 0000000..be2fb02
--- /dev/null
+++ b/views/adventure.pug
@@ -0,0 +1,51 @@
+extend layout
+
+
+
+
+block prepend links
+ - var homeURL = '/Home/' + user.id;
+ - var adURL = '/AdventureAnalytics/' + user.id;
+ - var travelURL = '/TravelLog/' + user.id;
+
+block content
+
+
+ .main.container
+ .row
+ .col-md-6.col-md-offset-3
+ h1.display-2.m-b-2(style="text-align:center")
+ -var imagepath = '/images/'+adventureContent.image;
+ div
+ img(src=""+imagepath,
+ style="width:600px; height: 200px;",
+ alt="")
+
+ h1 #{adventureName}
+
+ div.content
+ p First Visit: #{adventureContent.Date_Visited}
+
+ div.content
+ p Times Visited: #{adventureContent.Times_Visited}
+
+ div.content
+ p Rating: #{adventureContent.Rating}
+
+ div.content
+ p Hours Spent: #{adventureContent.Hours_Spent}
+
+ div.content
+ p Description: #{adventureContent.Description}
+ -var location = "/LoggedAdventure/" + user.id + "/" + adventureContent.lat + "/" + adventureContent.lng + "/edit";
+ Edit
+
+ //Google analytics stuff
+ script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-87345316-1', 'auto');
+ ga('send', 'pageview');
+ ga('send','event','button','editAdventure');
diff --git a/views/homepage.pug b/views/homepage.pug
new file mode 100644
index 0000000..9a4e725
--- /dev/null
+++ b/views/homepage.pug
@@ -0,0 +1,48 @@
+extend layout
+
+block prepend links
+ - var homeURL = '/Home/' + user.id;
+ - var adURL = '/AdventureAnalytics/' + user.id;
+ - var travelURL = '/TravelLog/' + user.id;
+ -//li: a(href=homeURL) Home!
+
+block content
+ link(rel='stylesheet', href='http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css')
+ #map(style='height: 500px;')
+ script(src='http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js')
+ script(src="//ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js")
+ script.
+ window.scrollTo(0,document.body.scrollHeight);
+ var map = L.map("map").setView([51.505, -0.09], 13);
+ var user = !{JSON.stringify(user)};
+ function onMarkerClick(e){
+ console.log("CHECKROOSTER");
+ console.log(e);
+ window.location = '/adventure/' + user.id + "/" + this.path;
+ }
+
+ function onMapClick(e){
+ var marker = L.marker([e.latlng.lat, e.latlng.lng ]).addTo(map);
+ marker.on('click', onMarkerClick);
+ window.location = '/LoggedAdventure/' + user.id + "/" + e.latlng.lat + "/" + e.latlng.lng;
+ }
+
+ var adventures = user.adventures;
+ for( var i = 0; iOpenStreetMap contributors'}).addTo(map);
+
+ //Google analytics stuff
+ script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-87345316-1', 'auto');
+ ga('send', 'pageview');
+ ga('send','event','map','clickOnMap');
diff --git a/views/includes/analyticstabs.pug b/views/includes/analyticstabs.pug
new file mode 100644
index 0000000..298ca2d
--- /dev/null
+++ b/views/includes/analyticstabs.pug
@@ -0,0 +1,50 @@
+
+block body(data-spy="scroll" data-target=".navbar" data-offset="50")
+
+ #{message}
+ nav(class="navbar navbar-inverse")
+ ul(class="nav navbar-nav")
+ li
+ a(href="#adventurability") Adventurability
+ li
+ a(href="#favorites") Favorites
+ li
+ a(href="#pastWeek") Past Week
+
+ div(id="adventurability")
+ h1 Adventure Frequency
+ block tester
+ include graph
+ hr
+ div(id="favorites")
+ hr
+ h1 Favorites
+ hr
+ h3 Top Rated Place(s):
+ br
+ h5 #{highestRatedAd.join(', ')}
+ h3 Most Visited Place(s):
+ br
+ h5 #{mostVisited.join(', ')}
+ h3 Most Time Spent at:
+ br
+ h5 #{mostHours.join(', ')}
+ hr
+ div(id="pastWeek")
+ h1 Past Week
+ hr
+ h3 In the past, you've gone on these adventures:
+ br
+ each ad in weekly
+ - var link = "/adventure/" + user.id + "/" + ad.name
+ a(href=link)
+ h5 #{ad.name} : #{ad.Description}
+ h3 In total, that's #{weekly.length} adventures this week!
+ h3 The total amount of time you've spent at these adventures is:
+ br
+ h5 #{weekAnalytics.adventureTime} Hours!
+
+ h3 The total amount of times you've visited these places is:
+ br
+ h5 #{weekAnalytics.totalVisits} Visits!
+ hr
diff --git a/views/includes/graph.pug b/views/includes/graph.pug
new file mode 100644
index 0000000..ef873a9
--- /dev/null
+++ b/views/includes/graph.pug
@@ -0,0 +1,103 @@
+
+block tester
+
+ script(src="http://d3js.org/d3.v3.min.js")
+ script.
+ var margin = {top: 20, right: 20, bottom: 100, left: 40},
+ width = 600 - margin.left - margin.right,
+ height = 500 - margin.top - margin.bottom;
+
+
+ // set the ranges
+ var x = d3.scale.ordinal().rangeRoundBands([0, width], .05);
+
+ var y = d3.scale.linear().range([height, 0]);
+
+ // define the axis
+ var xAxis = d3.svg.axis()
+ .scale(x)
+ .orient("bottom")
+
+
+ var yAxis = d3.svg.axis()
+ .scale(y)
+ .orient("left")
+ .ticks(10);
+
+
+ // add the SVG element
+ var svg = d3.select("body").append("svg")
+ .attr("width", width + margin.left + margin.right)
+ .attr("height", height + margin.top + margin.bottom)
+ .append("g")
+ .attr("transform",
+ "translate(" + margin.left + "," + margin.top + ")");
+
+ console.log("0");
+ // load the data
+ var user = !{JSON.stringify(user.adventures)};
+ console.log("Part1");
+ var data = user;
+ var dates = [];
+ var newData = [];
+ var counter = 0;
+ console.log("Part2");
+ data.forEach(function(d) {
+ if(d.Date_Visited){
+ console.log(d.Date_Visited);
+ if(!dates[d.Date_Visited]){
+ console.log("ANEW");
+ dates[d.Date_Visited] = d;
+ dates[d.Date_Visited].Freq = 0;
+ }
+ dates[d.Date_Visited].Letter = d.Date_Visited;
+
+ dates[d.Date_Visited].Freq = dates[d.Date_Visited].Freq+1;
+ }
+ });
+
+ for(var d in dates) {
+ console.log("POOP");
+ newData[counter] = dates[d];
+ counter++;
+ }
+ console.log(dates);
+
+ // scale the range of the data
+ x.domain(data.map(function(d) { return d.Letter; }));
+ y.domain([0, d3.max(data, function(d) { return d.Freq; })]);
+
+ // add axis
+ svg.append("g")
+ .attr("class", "x axis")
+ .attr("transform", "translate(0," + height + ")")
+ .call(xAxis)
+ .selectAll("text")
+ .style("text-anchor", "end")
+ .attr("dx", "-.8em")
+ .attr("dy", "-.55em")
+ .attr("transform", "rotate(-90)" );
+
+ svg.append("g")
+ .attr("class", "y axis")
+ .call(yAxis)
+ .append("text")
+ .attr("transform", "rotate(-90)")
+ .attr("y", 5)
+ .attr("dy", ".71em")
+ .style("text-anchor", "end")
+ .text("Frequency");
+
+
+
+ console.log(newData);
+ // Add bar chart
+ svg.selectAll("bar")
+ .data(newData)
+ .enter().append("rect")
+ .attr("class", "bar")
+ .attr("x", function(d) { return x(d.Letter); })
+ .attr("width", x.rangeBand())
+ .attr("y", function(d) { return y(d.Freq); })
+ .attr("height", function(d) { return height - y(d.Freq); });
+
diff --git a/views/layout.pug b/views/layout.pug
new file mode 100644
index 0000000..3746e8c
--- /dev/null
+++ b/views/layout.pug
@@ -0,0 +1,23 @@
+doctype html
+html
+ head
+ //where to get more css formatting
+ link(rel='stylesheet', href='/stylesheets/layout.css')
+ link(rel="stylesheet",href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css")
+
+ //can rename title to something else later
+ title #{title} - Spots
+ body
+ .header
+ h1.page-title Spots
+
+ //links on a menu bar!
+ block links
+ ul.nav1
+ li: a(href=homeURL) Home
+ li: a(href=adURL) Adventure Analytics
+ li: a(href=travelURL) Travel Log
+
+ block content
+
+
diff --git a/views/logged-adventure.pug b/views/logged-adventure.pug
new file mode 100644
index 0000000..0f633ce
--- /dev/null
+++ b/views/logged-adventure.pug
@@ -0,0 +1,54 @@
+extend layout
+
+block prepend links
+ - var homeURL = '/Home/' + user.id;
+ - var adURL = '/AdventureAnalytics/' + user.id;
+ - var travelURL = '/TravelLog/' + user.id;
+
+block content
+ .main.container
+ .row
+ .col-md-6.col-md-offset-3
+ h1.display-2.m-b-2(style="text-align:center") Log your Adventure!
+ form#log-adventure(method="post", enctype="multipart/form-data")
+ div.input
+ label Name
+ input#Name(type='text' name="name" value=values.name class="form-control")
+
+ div.input
+ label First Visit
+ input#TimesVisited(type='date' class="form-control" value=values.Date_Visited name="Date_Visited")
+
+ div.input
+ label Times Visited
+ input#TimesVisited(type='number' name="Times_Visited" value=values.Times_Visited class="form-control")
+
+ div.input
+ label Rating (1-10)
+ input#Rating.formcontrol(type='number' class="form-control" value=values.Rating name="Rating")
+
+ div.input
+ label Hours Spent
+ input#HoursSpent(type='number' name="Hours_Spent" value=values.Hours_Spent class="form-control")
+
+ div.input
+ label Image
+ input#Image(type='file', name="Image")
+
+ div.input
+ label Description
+ textarea#Rating(rows="5" cols="50" name="Description" class="form-control", value=values.Description)
+
+ div.actions
+ input(type="submit", value="Submit").submitbtn
+ a.submitbtn(href=homeURL) Cancel
+
+ //Google analytics stuff
+ script.
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
+ ga('create', 'UA-87345316-1', 'auto');
+ ga('send', 'pageview');
+ ga('send','event','button','submitAdventure');