Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
146 lines (141 sloc) 7.04 KB
<!DOCTYPE html>
{{/*<!--
~ 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 "registration"}}
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="content-type">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{i18n "_dkfai_welcome" .language}}</title>
<link rel="stylesheet" type="text/css" href="/css/bootstrap.min.css">
<!-- Optional Bootstrap theme -->
<link rel="stylesheet" href="/css/bootstrap-theme.min.css">
</head>
<body>
<div class="col-xs-12">
<h3 class="col-xs-offset-2 col-sm-offset-2 col-lg-offset-1">
{{i18n "_dkfai_register" .language}}
</h3>
</div>
<div class="ncontainer" style="padding-right: 15px;">
{{template "registrationform" .}}
</div>
<script src="/js/jquery-3.1.1.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/validator.min.js"></script>
</body>
</html>
{{end}}
{{define "registrationform"}}
{{if .thankyou}}
{{if .alreadyregistered}}
<div class="container">
<div class="col-xs-12">
<span class="text-info">
<div class="jumbotron" style="background-color: #f2dede;">
<h3 class=""> {{i18n "_error" .language}}!</h3>
<div class=""> {{i18n "_already_registered" .language}}</div>
<div class="clearfix">
<p><div class="pull-right">
<a href="/"
class="btn btn-warning">{{i18n "_cancel" .language}}</a>
</div>
</p>
</div>
</div>
</span>
</div>
</div>
{{else}}
<div class="container">
<div class="col-xs-12">
<span class="text-info">
<div class="jumbotron" style="background-color: #d3eed3;">
<h3 class=""> {{i18n "_dkfai_thankyou" .language}}!</h3>
<div class=""> {{i18n "_reminder_documents" .language}}</div>
<div class="">{{i18n "_check_input" .language}}</div>
<div class="clearfix">
<p><div class="pull-right">
<a href="/index?appid={{.appid}}&{{if .csrffield}}{{.csrffield}}{{else}}csrf_token{{end}}={{.csrftoken}}"
class="btn btn-primary">{{i18n "_input_ok" .language}}</a>
<a href="/register?appid={{.appid}}&{{if .csrffield}}{{.csrffield}}{{else}}csrf_token{{end}}={{.csrftoken}}"
class="btn btn-warning">{{i18n "_input_change" .language}}</a>
</div>
</p>
</div>
</div>
</span>
</div>
</div>
{{end}}
{{end}}
<form class="form-horizontal" data-toggle="validator" style="margin-right: 0;" method="POST" action="{{.action}}">
{{template "csrf" . }}
{{template "appid" . }}
{{template "registrationfields" .}}
{{if .buttons}}
<div class="col-xs-8 col-xs-offset-4 col-sm-3 col-sm-offset-2 col-md-offset-2 col-lg-offset-1">
<button type="button" onclick="window.location.href='/'" class="btn btn-default">{{i18n "_cancel" .language}}</button>
<button type="submit" class="btn btn-primary">{{i18n "_submit" .language}}</button>
</div>
{{end}}
</form>
{{end}}
{{define "registrationfields"}}
{{$defuser := dict "dot" . "itype" "text" "icon" "user" "disabled" .disabled "validate" "required" -}}
{{template "forminput" mergedict $defuser (dict "id" "lastname" "caption" (i18n "_lastname" .language) "tx" .lastnametx)}}
{{template "forminput" mergedict $defuser (dict "id" "firstname" "caption" (i18n "_firstname" .language) "tx" .firstnametx)}}
<div class="clearfix visible-sm-block visible-md-block"></div>
{{template "forminput" mergedict $defuser (dict "id" "fathersname" "caption" (i18n "_fathersname" .language) "validate" "" "tx" .fathersnametx)}}
{{$tel := dict "itype" "tel" "id" "phone" "caption" (i18n "_phone" .language) "icon" "phone" "def" "0123 456789" -}}
{{template "forminput" mergedict $defuser $tel}}
<div class="clearfix"></div>
{{$mail := dict "itype" "email" "id" "email" "caption" (i18n "_mail" .language) "icon" "envelope" "def" "stc@mail.ru" -}}
{{template "forminput" mergedict $defuser $mail}}
{{$home := dict "itype" "text" "id" "home" "caption" (i18n "_city" .language) "icon" "home" -}}
{{template "forminput" mergedict $defuser $home}}
<div class="clearfix visible-sm-block visible-md-block"></div>
{{$school := dict "id" "school" "caption" (i18n "_school" .language) "icon" "education" -}}
{{template "forminput" mergedict $defuser $school}}
{{$obl := dict "id" "district" "range" "oblasts" "caption" (i18n "_district" .language) "icon" "tent"}}
{{template "formselect" mergedict $defuser $obl}}
<div class="clearfix"></div>
<div class="col-xs-12 col-sm-12 col-md-12 col-lg-12" style="padding: 0px;">
{{$ol1 := "control-label col-xs-4 col-sm-2 col-md-2 col-lg-1" -}}
{{$olm := "control-label col-xs-4 col-xs-offset-0 col-sm-2 col-sm-offset-2 col-md-2 col-lg-offset-0 col-lg-1" -}}
{{$olp := "control-label col-xs-4 col-xs-offset-0 col-sm-2 col-sm-offset-6 col-md-2 col-md-offset-6 col-lg-offset-0 col-lg-1" -}}
{{$oix := "col-xs-6 col-sm-2 col-lg-2" -}}
{{$numort := `min="100" max="250" step="1" required` -}}
{{$numortx := `min="0" max="150" step="1"` -}}
{{$defort := dict "dot" . "itype" "number" "icon" "education" "disabled" .disabled "finput" $oix -}}
{{$ort := dict "id" "ort" "caption" (i18n "_ort_exam" .language) "def" "99" "validate" $numort "flabel" $ol1 -}}
{{template "forminput" mergedict $defort $ort}}
{{$ortm := dict "id" "ortmath" "caption" (i18n "_ort_math" .language) "validate" $numortx "flabel" $olm -}}
{{template "forminput" mergedict $defort $ortm}}
<div class="clearfix visible-sm-block visible-md-block"></div>
{{$ortp := dict "id" "ortphys" "caption" (i18n "_ort_phys" .language) "validate" $numortx "flabel" $olp -}}
{{template "forminput" mergedict $defort $ortp}}
</div>
{{end}}