-
Notifications
You must be signed in to change notification settings - Fork 0
/
detailsSidebar.html
256 lines (222 loc) · 8.86 KB
/
detailsSidebar.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
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
<!--
TODO: Create a separate place to put information to reduce hardcode
-->
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<style>
html {
background: #bbdcf0;
color: black;
line-height: 1.5;
font-family: Verdana;
}
output {
font-size: 200%;
font-family: Helvetica Neue,Helvetica,Arial,sans-serif;
}
.button {
background-color: #2980B9;
border: none;
border-radius: 15px;
color: white;
padding: 15px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
cursor: pointer;
}
.dataInput {
background: #f1f2ee;
padding: 5px;
border-radius: 15px;
margin: 5px;
border-style: solid;
border-width: 2px;
border-color: #c3d5d8;
}
.messageOutput {
background: #00FA9A;
padding: 5px;
border-radius: 15px;
margin: 5px;
border-style: solid;
border-width: 2px;
border-color: #c3d5d8;
}
.flex-inner {
display: flex;
flex-wrap: wrap;
align-items: center;
}
</style>
</head>
<body>
<center>
<h3>Meeting Details:</h3>
<form>
<div class="dataInput">
<label>Location:</label>
<select id="meetingLocation" name="meetingLocation">
</select><br>
</div>
<div class="dataInput">
<label>Date:</label>
<input type="date" id="meetingDate" name="meetingDate"value=""min="2020-01-01" max="2050-12-31"><br>
</div>
<div class="dataInput">
<label>Start time:</label>
<input type="time" id="startTime" name="startTime" min="09:00" max="22:00" required><br>
<label>End time:</label>
<input type="time" id="endTime" name="endTime" min="09:00" max="22:00" required><br>
</div>
<div class="dataInput">
<label>Chair:</label>
<select id="meetingChair" name="meetingChair">
</select><br>
</div>
<div class="dataInput">
<label>Recorded by:</label>
<select id="meetingRecorder" name="meetingRecorder">
</select><br>
</div>
<div class="dataInput">
<label>Audio URL:</label>
<div><input type="text" id="meetingAudio" name="meetingAudio" size="18"></div><br>
</div>
<div class="dataInput">
<label>Present:</label><br>
<ul id="attend" class="flex-inner" style="list-style-type:none;">
<li>
<input type="checkbox" id="role1" name="role1" >
<input type="hidden" id="role1Hidden" name="role1Hidden" value="" >
<label for="president">President</label>
</li>
<li>
<input type="checkbox" id="role2" name="role2" >
<input type="hidden" id="role2Hidden" name="role2Hidden" value="" >
<label for="education">VP of Edu. </label><br>
</li>
<li>
<input type="checkbox" id="role3" name="role3" >
<input type="hidden" id="role3Hidden" name="role3Hidden" value="" >
<label for="membership">VP of Mem.</label>
</li>
<li>
<input type="checkbox" id="role4" name="role4" >
<input type="hidden" id="role4Hidden" name="role4Hidden" value="" >
<label for="pr">VP of PR</label><br>
</li>
<li>
<input type="checkbox" id="role5" name="role5" >
<input type="hidden" id="role5Hidden" name="role5Hidden" value="" >
<label for="treasurer">Treasurer</label>
</li>
<li>
<input type="checkbox" id="role6" name="role6" >
<input type="hidden" id="role6Hidden" name="role6Hidden" value="" >
<label for="pr">SAA</label><br>
</li>
<li>
<input type="checkbox" id="role7" name="role7" >
<input type="hidden" id="role7Hidden" name="role7Hidden" value="" >
<label for="pr">Secretary</label>
</li>
</ul>
</div>
<h3>Next Meeting Details:</h3>
<div class="dataInput">
<label>Location:</label>
<select id="nextLocation" name="nextLocation">
</select><br>
<label>Date:</label>
<input type="date" id="nextDate" name="nextDate"value=""min="2020-01-01" max="2050-12-31"><br>
<label>Start time:</label>
<input type="time" id="nextStart" name="nextStart" min="09:00" max="22:00" required><br>
</div>
</form>
<div id="submitButton"></div>
<p>
<input class="button" type="button" value="Save" onclick="formSubmit()" />
<input class="button" type="button" value="Replace text" onclick="google.script.run.replaceText()" />
</p>
<p>
<input type="button" value="Item/Tasks" onclick="google.script.run.showTasks()" />
<input type="button" value="Settings" onclick="google.script.run.showSettings()" />
<input type="button" value="Help" onclick="google.script.run.showHelp()" />
<input type="button" value="Close" onclick="google.script.host.close()" />
</p>
</center>
</body>
<!--------------------------------- Code ---------------------------------------------------------------------->
<script type="text/javascript">
//runs automatically on load
google.script.run.withSuccessHandler(updateFormValues).getAllProperties();
// ------------------------- Updating Form Values ---------------
function updateFormValues(properties) {
document.getElementById('meetingDate').value = properties.meetingDate;
document.getElementById('startTime').value = properties.startTime;
document.getElementById('endTime').value = properties.endTime;
document.getElementById('nextDate').value = properties.nextDate;
document.getElementById('nextStart').value = properties.nextStart;
//checkboxes logic; typeof the checkboxes passed by the form is string
var selectChair = document.getElementById("meetingChair");
var selectRecorder = document.getElementById("meetingRecorder");
var selectLocation = document.getElementById("meetingLocation");
var selectNextLocation = document.getElementById("nextLocation");
//based on the 7 Executive Roles
for (i=1;i < 8; i++){
if (properties['role'+i+'Hidden'] == 'true'){
document.getElementById('role'+i).checked = true
}
//populate roles dropdown boxes; had to create two option elements
var optRole = properties['settingRole'+i];
var elRole = document.createElement("option");
var el2Role = document.createElement("option");
elRole.textContent = optRole;
elRole.value = optRole;
el2Role.textContent = optRole;
el2Role.value = optRole;
selectRecorder.appendChild(elRole);
selectChair.appendChild(el2Role);
}
//based on 5 default location; TODO: create option to add more
for (i=1;i < 6; i++){
//populate location dropdown box
var optLoc = properties['settingLocation'+i];
var elLoc = document.createElement("option");
var el2Loc = document.createElement("option");
elLoc.textContent = optLoc;
elLoc.value = optLoc;
el2Loc.textContent = optLoc;
el2Loc.value = optLoc;
selectLocation.appendChild(elLoc);
selectNextLocation.appendChild(el2Loc);
}
document.getElementById('meetingChair').value = properties.meetingChair;
document.getElementById('meetingRecorder').value = properties.meetingRecorder;
document.getElementById('meetingLocation').value = properties.meetingLocation;
document.getElementById('nextLocation').value = properties.nextLocation;
}
// ------------------------------------ Submitting Form ---------------
function formSubmit() {
//before passing form determine which checkboxes are on
for(i = 1; i < 8; i++){
if(document.getElementById("role"+i).checked) {
document.getElementById("role"+i+"Hidden").value = true;
}else{
document.getElementById("role"+i+"Hidden").value = false;
}
}
google.script.run.meetingInput(document.forms[0]);
document.getElementById('submitButton').innerHTML = "<div class='messageOutput'>Saved</div>";
google.script.run.withSuccessHandler(hideSaved).waitSeconds();
}
function hideSaved() {
document.getElementById('submitButton').innerHTML = "";
}
</script>
</html>