/
Work.go.html
233 lines (229 loc) · 10.1 KB
/
Work.go.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
{{/*<!--
~ The MIT License (MIT)
~
~ Copyright (c) 2016. Georg Beier. All rights reserved.
~
~ Permission is hereby granted, free of charge, to any person obtaining a copy
~ of this software and associated documentation files (the "Software"), to deal
~ in the Software without restriction, including without limitation the rights
~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
~ copies of the Software, and to permit persons to whom the Software is
~ furnished to do so, subject to the following conditions:
~
~ The above copyright notice and this permission notice shall be included in all
~ copies or substantial portions of the Software.
~
~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
~ SOFTWARE.
-->*/}}
{{define "work"}}
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>DKFAI App</title>
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<!-- Optional Bootstrap theme -->
<link rel="stylesheet" href="../css/bootstrap-theme.min.css">
<script src="../js/jquery-3.1.1.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<script src="../js/validator.js"></script>
<script src="../js/work.js"></script>
</head>
<body>
{{template "finder" .}}
<hr>
{{template "tabs" . }}
</body>
</html>
{{end}}
{{define "finder"}}
<div style="margin: 5px">
<nav role="navigation" class="navbar navbar-default">
<a href="/logout" class="navbar-brand navbar-right">
<span class="sr-only">Logout</span>
<span class="glyphicon glyphicon-off" style="margin-right: 5 px"></span>
</a>
<div class="navbar-header">
<button type="button" data-target="#navbarCollapse" data-toggle="collapse" class="navbar-toggle">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
</div>
<div id="navbarCollapse" class="collapse navbar-collapse">
<form role="search" class="navbar-form navbar-left">
{{template "csrf" . }}
<div class="form-group">
<input id="search1" type="text" placeholder="LastName" class="form-control" style="margin: 2px 0px;">
<input id="search2" type="text" placeholder="FirstName" class="form-control" style="margin: 2px 0px;">
<button id="find" type="button" class="btn btn-default" style="margin: 2px 0px;">
<span class="sr-only">Find</span>
<span class="glyphicon glyphicon-search"></span>
</button>
<div id="qapps" class="form-group" style="margin: 2px 0px;">
<select id="noresult" class="form-control" style="width: 16em;" disabled="disabled">
<option value="0">----------</option>
</select>
</div>
</div>
</form>
</div>
</nav>
</div>
{{end}}
{{define "qresult"}}
<select id="sresult" class="form-control" style="width: 16em;" onchange="showSelect()">
{{range .}}
<option value="{{.id}}">{{.lastname}}, {{.firstname}}</option>
{{else}}
<option value="0">not found</option>
{{end}}
</select>
{{end}}
{{define "tabs"}}
<ul class="nav nav-tabs" id="workTabs">
{{if .authenrol}}
<script type="text/javascript">
// objects that cache the search result select values of every tab
searchStates['enrol'] = new SearchState('#qapps', '#search1', '#search2');
searchStates['edit'] = new SearchState('#qapps', '#search1', '#search2');
searchStates['cancellation'] = new SearchState('#qapps', '#search1', '#search2');
// information to configure the search click url and result area of every tab
finderValues['enrol'] = {findUrl: '/find/applicant', targetUrl: '/enrol/show', target: '#enrolarea'};
finderValues['edit'] = {findUrl: '/find/applicant', targetUrl: '/enrol/show', target: '#editarea'};
finderValues['cancellation'] = {findUrl: '/find/applicant', targetUrl: '/cancellation/show', target: '#cancellationarea'};
</script>
<li class="active" data-toggle="tooltip" data-placement="top" title='{{i18n "_title_enrol" .language}}'>
<a data-toggle="tab" href="#enrol"><span class="glyphicon glyphicon-education"></span> </a>
</li>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_edit_candidate" .language}}'>
<a data-toggle="tab" href="#edit"><span class="glyphicon glyphicon-pencil"></span></a>
</li>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_cancel_candidate" .language}}'>
<a data-toggle="tab" href="#cancellation"><span class="glyphicon glyphicon-remove-sign"></span></a>
</li>
{{end}}
{{if .authpoff}}
<script type="text/javascript">
searchStates['results'] = new SearchState('#qapps', '#search1', '#search2');
searchStates['resultlist'] = new SearchState('#qapps', '#search1', '#search2', true, true);
finderValues['results'] = {findUrl: '/find/applicant', targetUrl: '/results/show', target: '#resultsarea'};
// finderValues['resultlist'] = {findUrl: '/find/applicant', targetUrl: '/enrol/resultlist', target: '#resultlistarea'};
</script>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_capture_results" .language}}'>
<a data-toggle="tab" href="#results"><span class="glyphicon glyphicon-certificate"></span></a>
</li>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_result_list" .language}}'>
<a data-toggle="tab" href="#resultlist"><span class="glyphicon glyphicon-th-list"></span></a>
</li>
{{end}}
{{if .authuadmin}}
<script type="text/javascript">
searchStates['users'] = new SearchState('#qapps', '#search1', '#search2');
</script>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_edit_users" .language}}'>
<a data-toggle="tab" href="#users"><span class="glyphicon glyphicon-user"></span></a>
</li>
{{end}}
{{if .authfulladmin}}
<script type="text/javascript">
searchStates['admin'] = new SearchState('#qapps', '#search1', '#search2', true);
searchStates['trace'] = new SearchState('#qapps', '#search1', '#search2', true, true);
// finderValues['admin'] = {findUrl: '/find/year', targetUrl: '/admin/result', target: '#adminarea'};
// finderValues['trace'] = {findUrl: '/find/applicant', targetUrl: '/admin/trace', target: '#tracearea'};
</script>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_admin" .language}}'>
<a data-toggle="tab" href="#admin"><span class="glyphicon glyphicon-wrench"></span></a>
</li>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_audit" .language}}'>
<a data-toggle="tab" href="#trace"><span class="glyphicon glyphicon-eye-open"></span></a>
</li>
{{end}}
{{if .authall}}
<script type="text/javascript">
searchStates['set'] = new SearchState('#qapps', '#search1', '#search2');
</script>
<li data-toggle="tooltip" data-placement="top" title='{{i18n "_title_profile" .language}}'>
<a data-toggle="tab" href="#set"><span class="glyphicon glyphicon-cog"></span></a>
</li>
{{end}}
</ul>
<div class="tab-content">
{{if .authenrol}}
<div id="enrol" class="tab-pane fade in active">
<div id="enrolarea" style="margin: 20px">
<p></p>
</div>
</div>
<div id="edit" class="tab-pane fade">
<div id="editarea" style="margin: 20px">
<p></p>
</div>
</div>
<div id="cancellation" class="tab-pane fade">
<div class="radio-inline">
<label for="do-cancellation" class="control-label">
<input id="do-cancellation" type="radio" name="cancellation" value="" checked="checked">
{{i18n "_cancellation" .language}}
</label>
</div>
<div class="radio-inline">
<label for="undo-cancellation" class="control-label">
<input id="undo-cancellation" type="radio" name="cancellation" value="undo">
{{i18n "_undo_cancellation" .language}}
</label>
</div>
<div id="cancellationarea" style="margin: 20px">
<p></p>
</div>
</div>
{{end}}
{{if .authpoff}}
<div id="results" class="tab-pane fade">
<div id="resultsarea" style="margin: 20px">
<p></p>
</div>
</div>
<div id="resultlist" class="tab-pane fade">
<div id="resultlistarea" style="margin: 20px">
{{template "results_download" .}}
</div>
</div>
{{end}}
{{if .authuadmin}}
<div id="users" class="tab-pane fade">
<div id="usersarea" style="margin: 20px">
<p></p>
</div>
</div>
{{end}}
{{if .authfulladmin}}
<div id="admin" class="tab-pane fade">
<div id="adminarea" style="margin: 20px">
<p></p>
</div>
</div>
<div id="trace" class="tab-pane fade">
<div id="tracearea" style="margin: 20px">
<p></p>
</div>
</div>
{{end}}
{{if .authall}}
<div id="selfadmin" class="tab-pane fade">
<div id="selfadminarea" style="margin: 20px">
<p></p>
</div>
</div>
{{end}}
</div>
{{end}}