Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
234 lines (229 sloc) 10.1 KB
{{/*<!--
~ 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>
&nbsp;
</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}}