-
Notifications
You must be signed in to change notification settings - Fork 1
/
add.html
132 lines (113 loc) · 4.2 KB
/
add.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Oakland Pumps it up</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
<style type="text/css">
#map {
width: 100%;
height: 100%;
margin: 0px 0px 0px 0px;
padding: 0px 0px 0px 0px;
position: absolute;
top:40px;
}
body {
padding-top: 60px;
padding-bottom: 40px;
}
</style>
<link href="bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.ie.css" />
<![endif]-->
<!-- Le HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- Le fav and touch icons -->
<link rel="shortcut icon" href="bootstrap/ico/favicon.ico">
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="bootstrap/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="bootstrap/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="bootstrap/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="bootstrap/ico/apple-touch-icon-57-precomposed.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="#">Oakland Pumps it up!</a>
</div>
</div>
</div>
<div class="container">
<form class="form-horizontal" id="new-station-form">
<fieldset>
<div class="control-group">
<div class="controls">
<label>Station Type</label>
<select id="station_type">
<option value="Bike Shop">Bike Shop</option>
<option value="Citizen Supported">Citizen Supported</option>
</select>
</div>
</div>
<div class="control-group">
<div class="controls">
<label>Name</label>
<input type="text" id="name">
</div>
</div>
<div class="control-group">
<div class="controls">
<label>Address</label>
<textarea id="address"></textarea>
</div>
</div>
<div class="control-group">
<div class="controls">
<label>Description</label>
<textarea id="description"></textarea>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary">Save changes</button>
<button class="btn">Cancel</button>
</div>
</fieldset>
</form>
</div> <!-- /container -->
<!-- Le javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="bootstrap/js/bootstrap.js"></script>
<script src="http://cdn.leafletjs.com/leaflet-0.3.1/leaflet.js"></script>
<script>
$(document).on("submit", "#new-station-form", function(event){
event.preventDefault();
data = {
"station\[name\]": $("#name").val(),
"station\[address\]": $("#address").val(),
"station\[description\]": $("#description").val(),
"station\[station_type\]": $("#station_type").val()
}
$.ajax({
url: 'http://oaklandpumpsitup.herokuapp.com/stations.json',
type: 'POST',
data: data,
success: function(){
alert('Thanks for adding a station!');
}
});
return false;
});
</script>
</body>
</html>