forked from ruffcorn33/TravelBuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
firebase_demo_form.html
195 lines (184 loc) · 7.99 KB
/
firebase_demo_form.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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="UTF-8">
<title>firebase_demo_form</title>
<!-- Bootstrap and jQuery -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<script src="https://code.jquery.com/jquery-3.2.1.slim.min.js" integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.9/umd/popper.min.js" integrity="sha384-ApNbgh9B+Y1QKtv3Rn7W3mgPxhU9K/ScQsAP7hUibX39j7fakFPskvXusvfa0b4Q" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>
<!-- Local Stylesheet -->
<link rel="stylesheet" type="text/css" href="assets/css/firebase_demo.css">
<!-- Firebase -->
<script src="https://www.gstatic.com/firebasejs/4.8.2/firebase.js"></script>
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css?family=Overlock+SC" rel="stylesheet">
<!-- Gijgo library - for datepicker widget -->
<script src="https://cdn.jsdelivr.net/gh/atatanasov/[email protected]/dist/combined/js/gijgo.min.js" type="text/javascript"></script>
<link href="https://cdn.jsdelivr.net/gh/atatanasov/[email protected]/dist/combined/css/gijgo.min.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="container">
<div class="row"> <!-- user row -->
<div class="col">
<!-- Current User -->
<div class="card">
<div class="card-heading card_header p-2">
<h2 class="card-title pl-4 m-0"><strong>Current User</strong></h2>
</div>
<div class="card-body">
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>Email</th>
</tr>
</thead>
<tbody id="userRow">
</tbody>
</table>
<hr>
<div class="d-flex"><h3 class="pt-2 pb-2 pl-3">User Trips </h3><p class="pl-5 align-self-end">Select a Trip by clicking on its Name.</p></div>
<table class="table table-hover">
<thead>
<tr>
<th>Name</th>
<th>Location</th>
<th>Start Date</th>
<th>End Date</th>
</tr>
</thead>
<tbody id="tripRows">
</tbody>
</table>
<h3 class="pt-2 pb-2 pl-3">Activities for trip <span id="activeTrip" class="bg-primary"></span></h3>
<table class="table table-hover">
<thead>
<tr>
<th>Category</th>
<th>Name</th>
<th>Location</th>
</tr>
</thead>
<tbody id="activityRows">
</tbody>
</table>
</div>
</div>
</div>
</div> <!-- end user row -->
<div class="row"> <!-- add trip row -->
<div class="col">
<!-- Add Trip -->
<div class="card">
<div class="card-heading card_header p-2">
<h2 class="card-title pl-4 m-0"><strong>Add Trip</strong></h2>
</div>
<div class="card-body">
<!-- Entry Form -->
<div>
<div class="form-group">
<label for="inp_trip_name">Trip Name</label>
<input class="form-control" id="inp_trip_name">
</input>
</div>
<div class="form-group">
<label for="inp_trip_location">Trip Location</label>
<input class="form-control" id="inp_trip_location" type="text">
</div>
<div class="form-group">
<label for="inp_start_date">Trip Start Date</label>
<input class="form-control" id="inp_start_date" width="200">
</div>
<div class="form-group">
<label for="inp_end_date">Trip End Date</label>
<input class="form-control" id="inp_end_date" width="200">
</div>
<button class="btn" id="submit_trip" type="button">Submit And Select Trip</button>
<button class="btn" id="update_trip" type="button">Update Selected Trip</button>
<button class="btn" id="delete_trip" type="button">Delete Selected Trip</button>
</div>
</div>
</div>
</div>
</div> <!-- end add trip row -->
<div class="row"> <!-- add activity row -->
<div class="col">
<!-- Add Activity -->
<div class="card">
<div class="card-heading card_header p-2">
<h2 class="card-title pl-4 m-0"><strong>Add Activity</strong></h2>
</div>
<div class="card-body">
<!-- Entry Form -->
<div>
<div class="form-group">
<label for="inp_activity_category">Activity Category</label>
<select class="form-control" id="inp_activity_category">
<!-- build select list in js -->
</select>
</div>
<div class="form-group">
<label for="inp_activity_name">Activity Name</label>
<input class="form-control" id="inp_activity_name" type="text">
</div>
<div class="form-group">
<label for="inp_activity_location">Activity Location</label>
<input class="form-control" id="inp_activity_location" type="text">
</div>
<button disabled class="btn" id="submit_activity" type="button">Submit Activity</button>
<button disabled class="btn" id="update_activity" type="button">Update Activity</button>
<button class="btn" id="delete_activity" type="button">Delete Activity</button>
</div>
</div>
</div>
</div>
</div> <!-- end add activity row -->
<div class="row"> <!-- Firebase dump row -->
<div class="col">
<!-- Firebase Dump -->
<div class="card">
<div class="card-heading card_header p-2">
<h2 class="card-title pl-4 m-0"><strong>Firebase Dump</strong></h2>
</div>
<div class="card-body">
<button class="btn btn-danger float-left mr-2" id="dump_user" type="button">Dump User</button>
<button class="btn btn-danger float-left mr-2" id="dump_trip" type="button">Dump Trip</button>
<button class="btn btn-danger float-left mr-2" id="dump_activity" type="button">Dump Activity</button>
</div>
<div class="card-body">
<hr>
<pre id="firebase_dump"></pre>
</div>
</div>
</div>
</div> <!-- end Firebase dump row -->
</div> <!-- end container -->
<!-- JavaScript -->
<script src="assets/javascript/firebase_init.js"></script>
<script src="assets/javascript/firebase_main.js"></script>
<script src="assets/javascript/firebase_demo.js"></script>
<!-- icons-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<script>
// setup the datepickers to be a date range
// TODO - this datepicker code needs to be moved to global scope of a 'main project' js file
var today = new Date(new Date().getFullYear(), new Date().getMonth(), new Date().getDate());
$('#inp_start_date').datepicker({
uiLibrary: 'bootstrap4',
iconsLibrary: 'fontawesome',
minDate: today,
maxDate: function () {
return $('#inp_end_date').val();
}
});
$('#inp_end_date').datepicker({
uiLibrary: 'bootstrap4',
iconsLibrary: 'fontawesome',
minDate: function () {
return $('#inp_start_date').val();
}
});
</script>
</body>