11<div id =" map" ></div >
2-
32<div class =" fixed-action-btn horizontal" >
4- <a class =" btn-floating btn-large waves-effect waves-light red modal-trigger" href =" #modal1" >
3+ <a class =" btn-floating btn-large waves-effect waves-light yellow darken-2 modal-trigger pulse " href =" #modal1" >
54 <i class =" material-icons" >add</i >
65 </a >
76</div >
4544 </select >
4645 <label >What kind of flying is best here...</label >
4746 </div >
48- Has an outlet?
49- <p >
50- <input name =" yes" type =" radio" id =" test1" />
51- <label for =" test1" >Yes</label >
52- </p >
53- <p >
54- <input name =" no" type =" radio" id =" test2" />
55- <label for =" test2" >No</label >
56- </p >
5747
48+
49+ <div class =" row" >
50+ <p class =" col s2" >Has an outlet? </p >
51+ <p class =" col s1" >
52+ <input name =" yes" type =" radio" id =" test1" />
53+ <label for =" test1" >Yes</label >
54+ </p >
55+ <p class =" col s1" >
56+ <input name =" no" type =" radio" id =" test2" />
57+ <label for =" test2" >No</label >
58+ </p >
59+ </div >
60+
61+ </div >
62+
63+ <div class =" row" >
64+ <div class =" col s12" >
65+ <button class =" btn-large waves-effect waves-light center-align" type =" submit" name =" action" onclick =" Materialize.toast('Spot added, refresh to view it!', 4000)" style =" background-color:#fbc02d;" >Add Spot
66+ <i class =" material-icons right" >send</i >
67+ </button >
68+ </div >
5869 </div >
59- <button class =" btn waves-effect waves-light" type =" submit" name =" action" >Add Spot
60- <i class =" material-icons right" >send</i >
61- </button >
6270
6371 </form >
6472 </div >
6573 </div >
6674</div >
67-
6875<!-- Modal Structure -->
6976 <div id =" modalAbout" class =" modal" >
7077 <div class =" modal-content" >
@@ -123,8 +130,10 @@ function initMap() {
123130
124131 for (var i = 0 ; i < spots .length ; i++ ) { // loop through all the locations and render a marker
125132 var outlet = " No" ;
133+ var date = (spots[i].date ).toString ().substring (0 , 10 );
126134 if (spots[i].isOutlet ) { outlet = " Yes" ; }
127- addMarker (spots[i].coords , spots[i].address , spots[i]._id , spots[i].points , spots[i].type , spots[i].goodFor , outlet);
135+
136+ addMarker (spots[i].coords , spots[i].address , spots[i]._id , spots[i].points , spots[i].type , spots[i].goodFor , outlet, date);
128137 }
129138
130139}
@@ -147,17 +156,17 @@ function placeMarkerAndPanTo(latLng, map) {
147156}
148157
149158// adds a marker as well as an info box containing the rating of the spot
150- function addMarker (coords , address , id , points , type , goodFor , hasOutlet ) {
159+ function addMarker (coords , address , id , points , type , goodFor , hasOutlet , date ) {
151160 var upvote = " /upvote/" + id;
152161 // string that is used to render the html in the info box
153- var contentString2 = ' <div id="content" class="info"><div class="row"><div class="col s12" id="title" ><br>' + address + ' </div></div><div class="row"><div> ' +
154- ' <form action="/upvote/' + id + ' " method="POST">' +
155- ' <input class="vote-button" type="submit" name="upvote" value="↑"/></form>' + points +
156- ' <form action="/downvote/' + id + ' " method="POST">' +
157- ' <input class="vote-button" type="submit" name="downvote" value="↓"/>' +
158- ' </form></div><div> ' +
159- ' <ul>< li>This spot is good for <b> ' + goodFor + ' </b> and is a <b> ' + type + ' </b>.</li><li> < div>Are you able to charge packs here: <b> ' + hasOutlet +
160- ' </b></li ></ul></ div></ div> </div></div>' ;
162+ var contentString2 = ' <div id="content" class="info"><div class="row"><div class="col s1.5" ><br>' +
163+ ' <form action="/upvote/' + id + ' " method="POST">' +
164+ ' <input class="vote-button up " type="submit" name="upvote" value="↑"/></form><b style="padding-left: 10px;" >' + points +
165+ ' </b> <form action="/downvote/' + id + ' " method="POST">' +
166+ ' <input class="vote-button down " type="submit" name="downvote" value="↓"/>' +
167+ ' </form></div>' + ' <div class="col s10.5" id="text"><br><b> ' + address + ' </b><ul><li>This spot is good for <b> ' + goodFor + ' </b> and is a <b> ' + type + ' </b>.</li><li> <div>Are you able to charge packs here: <b> ' + hasOutlet +
168+ ' </b></ li></ul></div></div><div class="divider"></div></div></div></ div>' +
169+ ' </div><br ></div><div class="right-align"> Spot added on ' + date + ' </div></div>' ;
161170
162171 var infowindow = new google.maps.InfoWindow ({
163172 content: contentString2
0 commit comments