1
0
mirror of https://github.com/raseels-repos/golang-saas-starter-kit.git synced 2025-06-08 23:56:37 +02:00
golang-saas-starter-kit/cmd/web-app/templates/content/users-invite-accept.gohtml

135 lines
8.5 KiB
Plaintext
Raw Permalink Normal View History

2019-08-05 13:27:23 -08:00
{{define "title"}}Invite Accept{{end}}
{{define "description"}}{{end}}
{{define "style"}}
{{end}}
{{ define "partials/app-wrapper" }}
<div class="container" id="page-content">
<!-- Outer Row -->
<div class="row justify-content-center">
<div class="col-xl-10 col-lg-12 col-md-9">
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body p-0">
<!-- Nested Row within Card Body -->
<div class="row">
<div class="col-lg-6 d-none d-lg-block bg-login-image"></div>
<div class="col-lg-6">
<div class="p-5">
{{ template "app-flashes" . }}
<div class="text-center">
<h1 class="h4 text-gray-900 mb-2">Invite Accept</h1>
<p class="mb-4">.....</p>
</div>
{{ template "validation-error" . }}
<form class="user" method="post" novalidate>
2019-08-05 14:32:45 -08:00
<div class="card shadow">
<div class="card-body">
<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" id="inputFirstName"
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 14:32:45 -08:00
</div>
<div class="form-group">
<label for="inputLastName">Last Name</label>
2019-08-06 13:02:44 -08:00
<input type="text" id="inputLastName"
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 14:32:45 -08:00
</div>
<div class="form-group">
<label for="inputEmail">Email</label>
2019-08-06 13:02:44 -08:00
<input type="text" id="inputEmail"
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 14:32:45 -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 14:32:45 -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" $.validationDefaults "validationErrors" $.validationErrors }}
2019-08-05 14:32:45 -08:00
</div>
<div class="form-group">
<label for="inputPassword">Password</label>
2019-08-06 13:02:44 -08:00
<input type="password" class="form-control"
id="inputPassword" placeholder="" name="Password" value="" required>
2019-08-05 14:32:45 -08:00
<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>
2019-08-06 13:02:44 -08:00
{{template "invalid-feedback" dict "fieldName" "Password" "validationDefaults" $.validationDefaults "validationErrors" $.validationErrors }}
2019-08-05 14:32:45 -08:00
</div>
<div class="form-group">
<label for="inputPasswordConfirm">Confirm Password</label>
2019-08-06 13:02:44 -08:00
<input type="password" class="form-control"
id="inputPasswordConfirm" placeholder="" name="PasswordConfirm" value="" required>
{{template "invalid-feedback" dict "fieldName" "PasswordConfirm" "validationDefaults" $.validationDefaults "validationErrors" $.validationErrors }}
2019-08-05 14:32:45 -08:00
</div>
</div>
</div>
<div class="row">
<div class="col">
<input type="submit" value="Save" class="btn btn-primary"/>
<a href="/users/{{ .user.ID }}" class="ml-2 btn btn-secondary" >Cancel</a>
</div>
</div>
2019-08-05 13:27:23 -08:00
</div>
</div>
2019-08-05 14:32:45 -08:00
2019-08-05 13:27:23 -08:00
</form>
2019-08-05 14:32:45 -08:00
2019-08-05 13:27:23 -08:00
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{end}}
{{define "js"}}
<script>
2019-08-05 14:32:45 -08:00
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;
}
2019-08-05 13:27:23 -08:00
$(document).ready(function() {
$(document).find('body').addClass('bg-gradient-primary');
2019-08-05 14:32:45 -08:00
$("#btnGeneratePassword").on("click", function() {
pwd = randomPassword(12);
$("#inputPassword").attr('type', 'text').val(pwd)
$("#inputPasswordConfirm").attr('type', 'text').val(pwd)
return false;
});
2019-08-05 13:27:23 -08:00
});
</script>
{{end}}