#9, #11: Forgot/reset password screens updated to Bootstrap v4. Added confirmation messages to reset password flow. Corrected the text of the "test e-mail" function and localised the strings used.

This commit is contained in:
Andy Heathershaw 2017-04-10 20:48:47 +01:00
parent ce1c82b275
commit 2c7dba6728
10 changed files with 98 additions and 78 deletions

View File

@ -196,7 +196,7 @@ class DefaultController extends Controller
Mail::to(Auth::user())->send(new TestMailConfig($config['sender_name'], $config['sender_address']));
return response()->json(array('is_successful' => true, 'message' => 'sent_successfully'));
return response()->json(array('is_successful' => true, 'message' => trans('admin.settings_test_email_successful')));
}
catch (\Exception $ex)
{

View File

@ -5,6 +5,7 @@ namespace App\Http\Controllers\Auth;
use App\Facade\Theme;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
use Illuminate\Http\Request;
class ForgotPasswordController extends Controller
{
@ -36,8 +37,10 @@ class ForgotPasswordController extends Controller
*
* @return \Illuminate\Http\Response
*/
public function showLinkRequestForm()
public function showLinkRequestForm(Request $request)
{
return Theme::render('auth.passwords.email');
$resetStatus = $request->session()->get('status');
return Theme::render('auth.passwords.email', ['success' => $resetStatus]);
}
}

View File

@ -50,8 +50,9 @@ class ResetPasswordController extends Controller
*/
public function showResetForm(Request $request, $token = null)
{
return Theme::render('auth.passwords.reset')->with(
['token' => $token, 'email' => $request->email]
);
return Theme::render('auth.passwords.reset', [
'token' => $token,
'email' => $request->email
]);
}
}

View File

@ -15,10 +15,12 @@ class DefaultController extends Controller
public function index(Request $request)
{
$albums = DbHelper::getAlbumsForCurrentUser();
$resetStatus = $request->session()->get('status');
return Theme::render('gallery.index', [
'albums' => $albums,
'info' => $request->session()->get('info')
'info' => $request->session()->get('info'),
'success' => $resetStatus
]);
}
}

View File

@ -137,6 +137,9 @@ return [
'settings_save_action' => 'Update Settings',
'settings_saved_message' => 'The settings were updated successfully.',
'settings_test_email_action' => 'Send a test e-mail',
'settings_test_email_summary_failed' => 'Failed!',
'settings_test_email_summary_successful' => 'Successful!',
'settings_test_email_successful' => 'A test e-mail was submitted to your mail server successfully.',
'settings_title' => 'Settings',
'stats_widget' => [
'albums' => 'album|albums',

View File

@ -20,9 +20,12 @@ return [
'and password you provided when you registered.',
'activation_required_message' => 'An e-mail containing an activation link has been sent to the e-mail address you provided. ' .
'Please click the link in this e-mail to activate your account.',
'forgot_password_action' => 'Send Reset E-mail',
'forgot_password_link' => 'Forgotten your password?',
'forgot_password_title' => 'Send password reset link',
'login_page_title' => 'Login',
'recaptcha_failed_message' => 'The reCAPTCHA verfication failed. Please ensure you have completed the reCAPTCHA challenge and try again.',
'register_page_title' => 'Create an account'
'register_page_title' => 'Create an account',
'reset_password_action' => 'Reset Password',
'reset_password_title' => 'Reset your password'
];

View File

@ -15,7 +15,7 @@ return [
'password' => 'Passwords must be at least six characters and match the confirmation.',
'reset' => 'Your password has been reset!',
'sent' => 'We have e-mailed your password reset link!',
'sent' => 'We have sent your password reset link to your e-mail address.',
'token' => 'This password reset token is invalid.',
'user' => "We can't find a user with that e-mail address.",

View File

@ -189,7 +189,8 @@
</div>
<div class="alert" id="test-email-result" style="display: none;">
<p><strong id="test-email-result-summary"></strong> <span id="test-email-result-message"></span></p>
<i class="fa fa-fw fa-info-circle"></i>
<strong id="test-email-result-summary"></strong> <span id="test-email-result-message"></span>
</div>
</div>
</div>
@ -295,12 +296,12 @@
if (data.is_successful)
{
$('#test-email-result').addClass('alert-success');
$('#test-email-result-summary').html('Successful');
$('#test-email-result-summary').html('@lang('admin.settings_test_email_summary_successful')');
}
else
{
$('#test-email-result').addClass('alert-danger');
$('#test-email-result-summary').html('Failed');
$('#test-email-result-summary').html('@lang('admin.settings_test_email_summary_failed')');
}
$('#test-email-result-message').html(data.message);

View File

@ -4,37 +4,38 @@
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">@yield('title')</div>
<div class="panel-body">
@if (session('status'))
<div class="alert alert-success">
{{ session('status') }}
</div>
@endif
<form class="form-horizontal" role="form" method="POST" action="{{ url('/password/email') }}">
<div class="col-md-8 offset-md-2">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a class="nav-link active" href="{{ url('/password/reset') }}">@yield('title')</a>
</li>
</ul>
</div>
<div class="card-block">
<form role="form" method="POST" action="{{ url('/password/email') }}">
{{ csrf_field() }}
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">@lang('forms.email_label')</label>
<div class="form-group row{{ $errors->has('email') ? ' has-danger' : '' }}">
<label for="email" class="col-md-4 col-form-label text-md-right">@lang('forms.email_label')</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ old('email') }}">
@if ($errors->has('email'))
<span class="help-block">
<div class="form-control-feedback">
<strong>{{ $errors->first('email') }}</strong>
</span>
</div>
@endif
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4 text-right">
<div class="form-group row">
<div class="col-md-6 offset-md-4 text-right">
<a href="{{ url('/login') }}" class="btn btn-link">@lang('forms.cancel_action')</a>
<button type="submit" class="btn btn-success">
Send Password Reset Link
<i class="fa fa-fw fa-check"></i> @lang('auth.forgot_password_action')
</button>
</div>
</div>

View File

@ -2,70 +2,76 @@
@section('title', trans('auth.reset_password_title'))
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">@yield('title')</div>
<div class="container">
<div class="row">
<div class="col-md-8 offset-md-2">
<div class="card">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs">
<li class="nav-item">
<a class="nav-link active" href="{{ url('/password/reset') }}">@yield('title')</a>
</li>
</ul>
</div>
<div class="card-block">
<form role="form" method="POST" action="{{ url('/password/reset') }}">
{{ csrf_field() }}
<div class="panel-body">
<form class="form-horizontal" role="form" method="POST" action="{{ url('/password/reset') }}">
{{ csrf_field() }}
<input type="hidden" name="token" value="{{ $token }}">
<input type="hidden" name="token" value="{{ $token }}">
<div class="form-group row{{ $errors->has('email') ? ' has-danger' : '' }}">
<label for="email" class="col-md-4 col-form-label text-md-right">@lang('forms.email_label')</label>
<div class="form-group{{ $errors->has('email') ? ' has-error' : '' }}">
<label for="email" class="col-md-4 control-label">@lang('forms.email_label')</label>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" autofocus>
<div class="col-md-6">
<input id="email" type="email" class="form-control" name="email" value="{{ $email or old('email') }}" autofocus>
@if ($errors->has('email'))
<span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
@if ($errors->has('email'))
<div class="form-control-feedback">
<strong>{{ $errors->first('email') }}</strong>
</div>
@endif
</div>
</div>
</div>
<div class="form-group{{ $errors->has('password') ? ' has-error' : '' }}">
<label for="password" class="col-md-4 control-label">Password</label>
<div class="form-group row{{ $errors->has('password') ? ' has-danger' : '' }}">
<label for="password" class="col-md-4 col-form-label text-md-right">@lang('forms.password_label')</label>
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password">
<div class="col-md-6">
<input id="password" type="password" class="form-control" name="password">
@if ($errors->has('password'))
<span class="help-block">
<strong>{{ $errors->first('password') }}</strong>
</span>
@endif
@if ($errors->has('password'))
<div class="form-control-feedback">
<strong>{{ $errors->first('password') }}</strong>
</div>
@endif
</div>
</div>
</div>
<div class="form-group{{ $errors->has('password_confirmation') ? ' has-error' : '' }}">
<label for="password-confirm" class="col-md-4 control-label">Confirm Password</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation">
<div class="form-group row{{ $errors->has('password_confirmation') ? ' has-danger' : '' }}">
<label for="password-confirm" class="col-md-4 col-form-label text-md-right">@lang('forms.password_confirm_label')</label>
<div class="col-md-6">
<input id="password-confirm" type="password" class="form-control" name="password_confirmation">
@if ($errors->has('password_confirmation'))
<span class="help-block">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</span>
@endif
@if ($errors->has('password_confirmation'))
<div class="form-control-feedback">
<strong>{{ $errors->first('password_confirmation') }}</strong>
</div>
@endif
</div>
</div>
</div>
<div class="form-group">
<div class="col-md-6 col-md-offset-4">
<button type="submit" class="btn btn-primary">
Reset Password
</button>
<div class="form-group row">
<div class="col-md-6 offset-md-4 text-right">
<a href="{{ url('/login') }}" class="btn btn-link">@lang('forms.cancel_action')</a>
<button type="submit" class="btn btn-success">
<i class="fa fa-fw fa-check"></i> @lang('auth.reset_password_action')
</button>
</div>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
@endsection