2017-02-15 23:47:37 +01:00
|
|
|
@extends('login')
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-02-15 23:47:37 +01:00
|
|
|
@section('form')
|
2015-03-16 22:45:25 +01:00
|
|
|
<div class="container">
|
|
|
|
|
2018-04-10 17:07:10 +02:00
|
|
|
{!! Former::open($url)
|
2017-11-15 08:51:49 +01:00
|
|
|
->addClass('form-signin')
|
|
|
|
->autocomplete('off')
|
|
|
|
->rules(array(
|
2018-04-10 17:07:10 +02:00
|
|
|
'email' => 'required|email',
|
2015-03-30 17:20:53 +02:00
|
|
|
'password' => 'required',
|
2016-08-22 15:45:34 +02:00
|
|
|
'password_confirmation' => 'required',
|
2015-03-30 17:20:53 +02:00
|
|
|
)) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2017-11-15 08:51:49 +01:00
|
|
|
@include('partials.autocomplete_fix')
|
|
|
|
|
2017-02-15 23:47:37 +01:00
|
|
|
<h2 class="form-signin-heading">{{ trans('texts.set_password') }}</h2>
|
|
|
|
<hr class="green">
|
2015-03-30 17:20:53 +02:00
|
|
|
|
|
|
|
@if (count($errors->all()))
|
|
|
|
<div class="alert alert-danger">
|
|
|
|
@foreach ($errors->all() as $error)
|
|
|
|
<li>{{ $error }}</li>
|
|
|
|
@endforeach
|
|
|
|
</div>
|
|
|
|
@endif
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
<!-- if there are login errors, show them here -->
|
|
|
|
@if (Session::has('warning'))
|
2017-02-15 23:47:37 +01:00
|
|
|
<div class="alert alert-warning">{{ Session::get('warning') }}</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
|
|
|
|
@if (Session::has('message'))
|
2017-02-15 23:47:37 +01:00
|
|
|
<div class="alert alert-info">{{ Session::get('message') }}</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
|
|
|
|
@if (Session::has('error'))
|
2017-02-15 23:47:37 +01:00
|
|
|
<div class="alert alert-danger">{{ Session::get('error') }}</div>
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
|
2017-02-15 23:47:37 +01:00
|
|
|
<input type="hidden" name="token" value="{{{ $token }}}">
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2018-04-10 17:07:10 +02:00
|
|
|
<div onkeyup="validateForm()" onclick="validateForm()" onkeydown="validateForm(event)">
|
2018-01-10 14:10:49 +01:00
|
|
|
{!! Former::text('email')->placeholder(trans('texts.email'))->raw() !!}
|
2017-11-15 08:51:49 +01:00
|
|
|
{!! Former::password('password')->placeholder(trans('texts.password'))->autocomplete('new-password')->raw() !!}
|
|
|
|
{!! Former::password('password_confirmation')->placeholder(trans('texts.confirm_password'))->autocomplete('new-password')->raw() !!}
|
2017-02-15 23:47:37 +01:00
|
|
|
</div>
|
|
|
|
|
2018-04-10 17:07:10 +02:00
|
|
|
<div id="passwordStrength" style="font-weight:normal;padding:16px">
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p>{!! Button::success(trans('texts.save'))->large()->submit()->withAttributes(['class' => 'green', 'id' => 'saveButton', 'disabled' => true])->block() !!}</p>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
|
|
|
|
2017-02-15 23:47:37 +01:00
|
|
|
{!! Former::close() !!}
|
|
|
|
</div>
|
2015-05-09 20:25:16 +02:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
2017-11-15 10:25:41 +01:00
|
|
|
$('#password').focus();
|
2018-04-10 17:07:10 +02:00
|
|
|
validateForm();
|
2015-05-09 20:25:16 +02:00
|
|
|
})
|
2018-04-10 17:07:10 +02:00
|
|
|
|
|
|
|
function validateForm() {
|
|
|
|
var isValid = true;
|
|
|
|
|
|
|
|
if (! $('#email').val()) {
|
|
|
|
isValid = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
var password = $('#password').val();
|
|
|
|
var confirm = $('#password_confirmation').val();
|
|
|
|
|
|
|
|
if (! password || password != confirm || password.length < 8) {
|
|
|
|
isValid = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
var score = scorePassword(password);
|
|
|
|
if (score < 50) {
|
|
|
|
isValid = false;
|
|
|
|
}
|
|
|
|
|
|
|
|
showPasswordStrength(password, score);
|
|
|
|
|
|
|
|
$('#saveButton').prop('disabled', ! isValid);
|
|
|
|
}
|
2015-05-09 20:25:16 +02:00
|
|
|
</script>
|
|
|
|
|
2017-02-15 23:47:37 +01:00
|
|
|
@endsection
|