Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Images clickable #5

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
de50652
Added all files, initialized
origilad Nov 1, 2016
acba843
adding routes
nhasjim Nov 2, 2016
ad48597
Created Links for Home, AA, Travel Log
nhasjim Nov 3, 2016
a4cdf7f
added the links for travel log, adv ana, and home page
nhasjim Nov 3, 2016
2a7b2a0
Fixed package.json to compile
nhasjim Nov 3, 2016
d9290c9
added map to the map page
origilad Nov 3, 2016
de52a07
just specified certain paths
nhasjim Nov 3, 2016
d0df4c3
added marker to map
origilad Nov 3, 2016
c6ed147
added route for homepage
nhasjim Nov 3, 2016
539db6a
Merge branch 'master' of https://github.com/origilad/basic-express-si…
origilad Nov 3, 2016
08f9f49
Merge pull request #1 from origilad/addMap
origilad Nov 3, 2016
ec25d06
Merge branch 'master' of https://github.com/origilad/basic-express-si…
nhasjim Nov 3, 2016
d5d3f15
added homepage reroute
nhasjim Nov 3, 2016
ea6c552
played with a test json file on TravelLog. Put a data folder to conta…
nhasjim Nov 3, 2016
a9ad401
test
origilad Nov 4, 2016
a19284c
added reading from data/json into the map
origilad Nov 4, 2016
aa8c115
Merge pull request #2 from origilad/addMap
origilad Nov 4, 2016
34035c7
current progress
origilad Nov 4, 2016
703ee22
Merge pull request #3 from origilad/addAdventure
origilad Nov 4, 2016
12c0e23
nothing
nhasjim Nov 4, 2016
ca96f52
ADDED LOGIN PAGE
nhasjim Nov 4, 2016
3c0df1a
LOGIN PAGE WORKS
nhasjim Nov 4, 2016
ade3613
Merge pull request #4 from origilad/login
origilad Nov 4, 2016
3da6bd7
Test
origilad Nov 4, 2016
f668a16
Merge branch 'master' of https://github.com/origilad/basic-express-si…
origilad Nov 4, 2016
1afe25e
added hidden password
nhasjim Nov 4, 2016
96f68f1
password works
nhasjim Nov 4, 2016
8a78cca
Merge pull request #5 from origilad/login
nhasjim Nov 4, 2016
c709d75
add marker
origilad Nov 4, 2016
57cffa5
Merge pull request #6 from origilad/addAdventure
origilad Nov 4, 2016
2ce5af1
updated package.json
origilad Nov 4, 2016
ab505fd
Merge pull request #7 from origilad/addAdventure
origilad Nov 4, 2016
93f0133
Create master branch via GitHub
origilad Nov 4, 2016
dde0ce1
redid bahari's changes that i removed
origilad Nov 4, 2016
48c64bf
Merge pull request #8 from origilad/addAdventure
origilad Nov 4, 2016
2694884
Lol travel Log
nhasjim Nov 4, 2016
e71afae
Travel Log loll
nhasjim Nov 4, 2016
e5ad4c0
added adventure analytics page
origilad Nov 4, 2016
c67a6b8
Merge pull request #9 from origilad/addAdventure
origilad Nov 4, 2016
c75f816
added text onto Travel Log
nhasjim Nov 4, 2016
9a1adbb
Travel Log Text
nhasjim Nov 4, 2016
cb4dbd2
added images folder
origilad Nov 4, 2016
7b5bf8e
Merge pull request #10 from origilad/addAdventure
origilad Nov 4, 2016
001bb80
Travel Log Fix
nhasjim Nov 4, 2016
b552704
Switched to pug
nhasjim Nov 4, 2016
70162d8
Merge pull request #11 from origilad/pug
nhasjim Nov 4, 2016
ae3cd54
fixed pug
nhasjim Nov 4, 2016
d68662f
Merge pull request #12 from origilad/pug
nhasjim Nov 4, 2016
e31b4e3
make clickable
davidmoll Nov 4, 2016
3ac2b65
Added dummy page for adventures
davidmoll Nov 4, 2016
db0b45e
reverting changes
davidmoll Nov 4, 2016
a2104c1
reverting changes
davidmoll Nov 4, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Test
  • Loading branch information
origilad committed Nov 4, 2016
commit 3da6bd78b6dd1b4ac2e401a8d0f5a9a59b959c96
13 changes: 12 additions & 1 deletion server.js
Original file line number Diff line number Diff line change
@@ -7,6 +7,10 @@ var express = require('express')
, stylus = require('stylus')
, nib = require('nib');

var bodyParser = require('body-parser');
app.use(bodyParser.json()); // support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies

//defining a compile function so it compiles my .styl files
function compile(str, path) {
return stylus(str)
@@ -37,7 +41,10 @@ app.get('/TravelLog', TravelLog.TravelLog);


var LoggedAdventure = require( __dirname + '/routes/LoggedAdventure');
app.get('/LoggedAdventure', LoggedAdventure.LoggedAdventure);
app.get('/LoggedAdventure', function(req, res){
console.log(req.body);
return res.render('logged-adventure', {title: "POOP", lat: req.body.lat});
});

//HOMEPAGE
var HomePage = require( __dirname + '/routes/HomePage');
@@ -50,8 +57,12 @@ app.get('/', function(req,res, next){


app.post('/CreateNewAdventure', function(req, res){
var lat = req.body.lat;
var lng = req.body.lng;
res.send({"page": "LoggedAdventure"});
res.render('logged-adventure', {title: "JWOW"});
});

app.listen(process.env.PORT || 3000, function () {
console.log('Listening on http://localhost:' + (process.env.PORT || 3000))
})
7 changes: 2 additions & 5 deletions views/homepage.jade
Original file line number Diff line number Diff line change
@@ -11,11 +11,8 @@ block content
function onMapClick(e){
alert("creating new adventure");
alert(e.latlng.lat + "!" + e.latlng.lng);
$.post('http://localhost:3000/CreateNewAdventure', {lat: e.latlng.lat, lng: e.latlng.lng})
.success(function(data) {
alert(data.lat);
window.location = data.page;
});
$.get('/LoggedAdventure', {lat: e.latlng.lat, lng: e.latlng.lng}, function(data){});
window.location = "/LoggedAdventure";
}
var map = L.map("map").setView([51.505, -0.09], 13);
var marker = L.marker([#{markers[0].lat}, #{markers[0].lng}]).addTo(map);
2 changes: 1 addition & 1 deletion views/logged-adventure.jade
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
extend layout

block content
p WOW
p LOG A NEW ADVENTURE LAT #{lat} LNG #{lng}