1
1
<div id =" map" ></div >
2
-
3
2
<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" >
5
4
<i class =" material-icons" >add</i >
6
5
</a >
7
6
</div >
45
44
</select >
46
45
<label >What kind of flying is best here...</label >
47
46
</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 >
57
47
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 >
58
69
</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 >
62
70
63
71
</form >
64
72
</div >
65
73
</div >
66
74
</div >
67
-
68
75
<!-- Modal Structure -->
69
76
<div id =" modalAbout" class =" modal" >
70
77
<div class =" modal-content" >
@@ -123,8 +130,10 @@ function initMap() {
123
130
124
131
for (var i = 0 ; i < spots .length ; i++ ) { // loop through all the locations and render a marker
125
132
var outlet = " No" ;
133
+ var date = (spots[i].date ).toString ().substring (0 , 10 );
126
134
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);
128
137
}
129
138
130
139
}
@@ -147,17 +156,17 @@ function placeMarkerAndPanTo(latLng, map) {
147
156
}
148
157
149
158
// 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 ) {
151
160
var upvote = " /upvote/" + id;
152
161
// 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>' ;
161
170
162
171
var infowindow = new google.maps.InfoWindow ({
163
172
content: contentString2
0 commit comments