2019-08-04 14:48:43 -08:00
|
|
|
{{define "title"}}Update Profile{{end}}
|
|
|
|
{{define "style"}}
|
|
|
|
|
|
|
|
{{end}}
|
|
|
|
{{define "content"}}
|
2019-08-05 01:19:11 -08:00
|
|
|
|
|
|
|
<div class="d-sm-flex align-items-center justify-content-between mb-4">
|
|
|
|
<h1 class="h3 mb-0 text-gray-800">Update My Profile</h1>
|
|
|
|
</div>
|
|
|
|
|
2019-08-04 14:48:43 -08:00
|
|
|
<form class="user" method="post" novalidate>
|
2019-08-05 13:25:49 -08:00
|
|
|
|
|
|
|
<div class="card shadow">
|
|
|
|
<div class="card-body">
|
|
|
|
|
|
|
|
<div class="row mb-2">
|
|
|
|
<div class="col-12">
|
|
|
|
|
|
|
|
<h4 class="card-title">Your Details</h4>
|
|
|
|
</div>
|
2019-08-04 14:48:43 -08:00
|
|
|
</div>
|
2019-08-05 13:25:49 -08:00
|
|
|
|
|
|
|
<div class="row mb-2">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="inputFirstName">First Name</label>
|
2019-08-06 13:02:44 -08:00
|
|
|
<input type="text"
|
|
|
|
class="form-control {{ ValidationFieldClass $.validationErrors "FirstName" }}"
|
|
|
|
placeholder="enter first name" name="FirstName" value="{{ .form.FirstName }}" required>
|
|
|
|
{{template "invalid-feedback" dict "fieldName" "FirstName" "validationDefaults" $.userValidationDefaults "validationErrors" $.validationErrors }}
|
2019-08-05 13:25:49 -08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="inputLastName">Last Name</label>
|
2019-08-06 13:02:44 -08:00
|
|
|
<input type="text"
|
|
|
|
class="form-control {{ ValidationFieldClass $.validationErrors "LastName" }}"
|
|
|
|
placeholder="enter last name" name="LastName" value="{{ .form.LastName }}" required>
|
|
|
|
{{template "invalid-feedback" dict "fieldName" "LastName" "validationDefaults" $.userValidationDefaults "validationErrors" $.validationErrors }}
|
2019-08-05 13:25:49 -08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="inputEmail">Email</label>
|
2019-08-06 13:02:44 -08:00
|
|
|
<input type="text"
|
|
|
|
class="form-control {{ ValidationFieldClass $.validationErrors "Email" }}"
|
|
|
|
placeholder="enter email" name="Email" value="{{ .form.Email }}" required>
|
|
|
|
{{template "invalid-feedback" dict "fieldName" "Email" "validationDefaults" $.userValidationDefaults "validationErrors" $.validationErrors }}
|
2019-08-05 13:25:49 -08:00
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
2019-08-06 13:02:44 -08:00
|
|
|
<label for="selectTimezone">Timezone</label>
|
|
|
|
<select id="selectTimezone" name="Timezone"
|
|
|
|
class="form-control {{ ValidationFieldClass $.validationErrors "Timezone" }}">
|
2019-08-05 13:25:49 -08:00
|
|
|
<option value="">Not set</option>
|
|
|
|
{{ range $idx, $t := .timezones }}
|
|
|
|
<option value="{{ $t }}" {{ if CmpString $t $.form.Timezone }}selected="selected"{{ end }}>{{ $t }}</option>
|
|
|
|
{{ end }}
|
|
|
|
</select>
|
2019-08-06 13:02:44 -08:00
|
|
|
{{template "invalid-feedback" dict "fieldName" "Timezone" "validationDefaults" $.userValidationDefaults "validationErrors" $.validationErrors }}
|
2019-08-05 13:25:49 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-04 14:48:43 -08:00
|
|
|
</div>
|
2019-08-05 13:25:49 -08:00
|
|
|
<div class="row">
|
|
|
|
<div class="col">
|
|
|
|
<input id="btnSubmit" type="submit" name="action" value="Save" class="btn btn-primary"/>
|
|
|
|
<a href="/user" class="ml-2 btn btn-secondary" >Cancel</a>
|
|
|
|
</div>
|
2019-08-04 14:48:43 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-05 13:25:49 -08:00
|
|
|
|
2019-08-05 01:19:11 -08:00
|
|
|
</form>
|
2019-08-04 14:48:43 -08:00
|
|
|
|
2019-08-05 01:19:11 -08:00
|
|
|
<form class="user" method="post" novalidate>
|
2019-08-05 13:25:49 -08:00
|
|
|
|
2019-08-06 13:02:44 -08:00
|
|
|
<div class="card mt-4">
|
|
|
|
<div class="card-body">
|
|
|
|
<div class="row mb-2">
|
|
|
|
<div class="col-12">
|
|
|
|
<h4 class="card-title">Change Password</h4>
|
|
|
|
<p><small><b>Optional</b>. You can change your password by specifying a new one below. Otherwise leave the fields empty.</small></p>
|
|
|
|
</div>
|
2019-08-04 14:48:43 -08:00
|
|
|
</div>
|
2019-08-06 13:02:44 -08:00
|
|
|
<div class="row mb-2">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="inputPassword">Password</label>
|
|
|
|
<input type="password" class="form-control" id="inputPassword" placeholder="" name="Password" value="">
|
|
|
|
<span class="help-block "><small><a a href="javascript:void(0)" id="btnGeneratePassword"><i class="fas fa-random mr-1"></i>Generate random password </a></small></span>
|
|
|
|
{{template "invalid-feedback" dict "validationDefaults" $.passwordValidationDefaults "validationErrors" $.validationErrors "fieldName" "Password" }}
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="inputPasswordConfirm">Confirm Password</label>
|
|
|
|
<input type="password" class="form-control" id="inputPasswordConfirm" placeholder="" name="PasswordConfirm" value="">
|
|
|
|
{{template "invalid-feedback" dict "validationDefaults" $.passwordValidationDefaults "validationErrors" $.validationErrors "fieldName" "PasswordConfirm" }}
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-04 14:48:43 -08:00
|
|
|
</div>
|
2019-08-06 13:02:44 -08:00
|
|
|
<div class="row">
|
2019-08-05 13:25:49 -08:00
|
|
|
<div class="col">
|
2019-08-06 13:02:44 -08:00
|
|
|
<input type="submit" name="action" value="Change Password" class="btn btn-primary btn-sm"/>
|
2019-08-05 13:25:49 -08:00
|
|
|
</div>
|
2019-08-06 13:02:44 -08:00
|
|
|
</div>
|
|
|
|
</div>
|
2019-08-04 14:48:43 -08:00
|
|
|
</div>
|
2019-08-05 13:25:49 -08:00
|
|
|
|
2019-08-04 14:48:43 -08:00
|
|
|
</form>
|
2019-08-06 13:02:44 -08:00
|
|
|
|
2019-08-04 14:48:43 -08:00
|
|
|
{{end}}
|
|
|
|
{{define "js"}}
|
|
|
|
<script>
|
|
|
|
function randomPassword(length) {
|
|
|
|
var chars = "abcdefghijklmnopqrstuvwxyz!@#&*()-+<>ABCDEFGHIJKLMNOP1234567890";
|
|
|
|
var pass = "";
|
|
|
|
for (var x = 0; x < length; x++) {
|
|
|
|
var i = Math.floor(Math.random() * chars.length);
|
|
|
|
pass += chars.charAt(i);
|
|
|
|
}
|
|
|
|
return pass;
|
|
|
|
}
|
|
|
|
|
|
|
|
$(document).ready(function(){
|
|
|
|
$("#btnGeneratePassword").on("click", function() {
|
|
|
|
pwd = randomPassword(12);
|
|
|
|
$("#inputPassword").attr('type', 'text').val(pwd)
|
|
|
|
$("#inputPasswordConfirm").attr('type', 'text').val(pwd)
|
|
|
|
return false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
|
|
|
{{end}}
|