Skip to content

Commit

Permalink
Updating the auth forms and translations
Browse files Browse the repository at this point in the history
  • Loading branch information
arcanedev-maroc committed Aug 19, 2016
1 parent a154a27 commit 4577791
Show file tree
Hide file tree
Showing 12 changed files with 170 additions and 57 deletions.
11 changes: 11 additions & 0 deletions resources/lang/en/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

return [
'heading' => 'Welcome Back!',
'remember' => 'Remember Me',
'submit' => 'Sign in',
'links' => [
'register' => 'Don\'t have an account ? Sign up',
'reset' => 'Have you forgotten your password?',
],
];
9 changes: 9 additions & 0 deletions resources/lang/en/register.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

return [
'heading' => 'Welcome!',
'submit' => 'Sign up',
'links' => [
'login' => 'Already have an account ? Sign in',
],
];
10 changes: 10 additions & 0 deletions resources/lang/en/reset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return [
'heading' => 'Have you forgotten your password?',
'submit' => 'Send Password Reset Link',
'links' => [
'login' => 'You\'ve remembered your password ? Sign in',
'register' => 'Don\'t have an account ? Sign up',
],
];
15 changes: 15 additions & 0 deletions resources/lang/en/users.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<?php

return [
/* ------------------------------------------------------------------------------------------------
| Attributes
| ------------------------------------------------------------------------------------------------
*/
'email' => 'Email address',
'username' => 'Username',
'password' => 'Password',
'password_confirmation' => 'Password Confirmation',
'first_name' => 'First Name',
'last_name' => 'Last Name',

/* ------------------------------------------------------------------------------------------------
| Messages
| ------------------------------------------------------------------------------------------------
*/
'since' => 'Member since :date',
];
11 changes: 11 additions & 0 deletions resources/lang/fr/login.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php

return [
'heading' => 'Bienvenu!',
'remember' => 'Se souvenir de moi',
'submit' => 'Se connecter',
'links' => [
'register' => 'Vous n\'avez pas un compte? Inscrivez-vous',
'reset' => 'Avez-vous oublié votre mot de passe?',
],
];
9 changes: 9 additions & 0 deletions resources/lang/fr/register.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

return [
'heading' => 'Bienvenu!',
'submit' => 'S\'inscrire',
'links' => [
'login' => 'Avez-vous déjà un compte ? Connectez-vous',
],
];
10 changes: 10 additions & 0 deletions resources/lang/fr/reset.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

return [
'heading' => 'Avez-vous oublié votre mot de passe?',
'submit' => 'Envoyer le lien de réinitialisation d\'un mot de passe',
'links' => [
'login' => 'Avez-vous souvenu de votre mot de passe? Connectez-vous',
'register' => 'Vous n\'avez pas un compte? Inscrivez-vous',
],
];
15 changes: 15 additions & 0 deletions resources/lang/fr/users.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
<?php

return [
/* ------------------------------------------------------------------------------------------------
| Attributes
| ------------------------------------------------------------------------------------------------
*/
'email' => 'Email',
'username' => 'Nom d\'utilisateur',
'password' => 'Mot de passe',
'password_confirmation' => 'Confirmation mot de passe',
'first_name' => 'Prénom',
'last_name' => 'Nom',

/* ------------------------------------------------------------------------------------------------
| Messages
| ------------------------------------------------------------------------------------------------
*/
'since' => 'Membre depuis :date',
];
14 changes: 7 additions & 7 deletions resources/views/public/_template/master.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
Expand All @@ -9,12 +9,12 @@
<meta name="author" content="">
<link rel="icon" href="{{ asset('favicon.ico') }}">
{{-- STYLE --}}
{!! Html::style('assets/css/style.css') !!}
{{ Html::style('assets/css/style.css') }}

{{-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries --}}
<!--[if lt IE 9]>
{!! Html::script('https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js') !!}
{!! Html::script('https://oss.maxcdn.com/respond/1.4.2/respond.min.js') !!}
{{ Html::script('https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js')}}
{{ Html::script('https://oss.maxcdn.com/respond/1.4.2/respond.min.js') }}
<![endif]-->
</head>
<body class="auth-page">
Expand All @@ -27,9 +27,9 @@
@include('auth::public._template.footer')

{{-- SCRIPTS --}}
{!! Html::script('assets/js/vendors.js') !!}
{!! Html::script('assets/js/app.js') !!}
{!! Html::script('assets/js/auth.js') !!}
{{ Html::script('assets/js/vendors.js') }}
{{ Html::script('assets/js/app.js') }}
{{ Html::script('assets/js/auth.js') }}

@yield('scripts')
</body>
Expand Down
40 changes: 25 additions & 15 deletions resources/views/public/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,41 +1,51 @@
@extends('auth::public._template.master')

<?php
$hasRegisterForm = Route::has('auth::register.get');
$hasResetForm = Route::has('auth::password.email.get');
?>
@section('content')
<div class="row">
<div class="col-sm-offset-2 col-sm-8 col-md-offset-3 col-md-6 col-lg-offset-4 col-lg-4">
{!! Form::open(['route' => 'auth::login.post', 'method' => 'POST', 'class' => 'form-auth form-login']) !!}
<h2 class="heading">Welcome Back!</h2>
{{ Form::open(['route' => 'auth::login.post', 'method' => 'POST', 'class' => 'form-auth form-login']) }}
<h2 class="heading">{{ trans('auth::login.heading') }}</h2>
{{-- EMAIL --}}
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{!! Form::label('email', 'Email address', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('email', 'has-error') }}">
{{ Form::label('email', trans('auth::users.email'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-at"></i></span>
{!! Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => 'Email address', 'required' => '', 'autofocus' => '']) !!}
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => trans('auth::users.email'), 'required' => '', 'autofocus' => '']) }}
</div>
{!! $errors->first('email', '<span class="help-block">:message</span>') !!}
</div>
{{-- PASSWORD --}}
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{!! Form::label('password', 'Password', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('password', 'has-error') }}">
{{ Form::label('password', trans('auth::users.password'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
{!! Form::password('password', ['class' => 'form-control', 'placeholder' => 'Password', 'required' => '']) !!}
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => trans('auth::users.password'), 'required' => '']) }}
</div>
{!! $errors->first('password', '<span class="help-block">:message</span>') !!}
</div>
{{-- REMEMBER ME --}}
<div class="checkbox">
<label>
{!! Form::checkbox('remember') !!} Remember Me
{{ Form::checkbox('remember') }} {{ trans('auth::login.remember') }}
</label>
</div>
{!! Form::submit('Sign in', ['class' => 'btn btn-lg btn-success btn-block']) !!}
{!! Form::close() !!}
{{ Form::button(trans('auth::login.submit'), ['type' => 'submit', 'class' => 'btn btn-lg btn-success btn-block']) }}
{{ Form::close() }}

<div class="form-info">
{!! link_to_route('auth::register.get', 'Don\'t have an account? Sign up', [], ['class' => 'btn btn-primary btn-block']) !!}
{!! link_to_route('auth::password.email.get', 'Have you forgotten your password?', [], ['class' => 'btn btn-warning btn-block']) !!}
</div>
@if ($hasRegisterForm || $hasResetForm)
<div class="form-info">
@if ($hasRegisterForm)
{{ link_to_route('auth::register.get', trans('auth::login.links.register'), [], ['class' => 'btn btn-primary btn-block']) }}
@endif
@if ($hasResetForm)
{{ link_to_route('auth::password.email.get', trans('auth::login.links.reset'), [], ['class' => 'btn btn-warning btn-block']) }}
@endif
</div>
@endif
</div>
</div>
@endsection
Expand Down
55 changes: 30 additions & 25 deletions resources/views/public/register.blade.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
@extends('auth::public._template.master')

<?php
$hasLoginForm = Route::has('auth::login.get');
?>
@section('content')
<div class="row">
<div class="col-sm-offset-2 col-sm-8 col-md-offset-3 col-md-6 col-lg-offset-3 col-lg-6">
{!! Form::open(['route' => 'auth::register.post', 'method' => 'POST', 'class' => 'form-auth form-register']) !!}
<h2 class="heading">Welcome!</h2>
{{ Form::open(['route' => 'auth::register.post', 'method' => 'POST', 'class' => 'form-auth form-register']) }}
<h2 class="heading">{{ trans('auth::register.heading') }}</h2>
<div class="row">
{{-- EMAIL --}}
<div class="col-lg-6">
<div class="form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{!! Form::label('email', 'Email address', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('email', 'has-error') }}">
{{ Form::label('email', trans('auth::users.email'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-at"></i></span>
{!! Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => 'Email address', 'required' => '', 'autofocus' => '']) !!}
{{ Form::email('email', old('email'), ['class' => 'form-control', 'placeholder' => trans('auth::users.email'), 'required' => '', 'autofocus' => '']) }}
</div>
{!! $errors->first('email', '<span class="help-block">:message</span>') !!}
</div>
</div>
{{-- USERNAME --}}
<div class="col-lg-6">
<div class="form-group {{ $errors->has('username') ? 'has-error' : '' }}">
{!! Form::label('username', 'Username', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('username', 'has-error') }}">
{{ Form::label('username', trans('auth::users.username'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
{!! Form::text('username', old('username'), ['class' => 'form-control', 'placeholder' => 'Username', 'required' => '', 'autofocus' => '']) !!}
{{ Form::text('username', old('username'), ['class' => 'form-control', 'placeholder' => trans('auth::users.username'), 'required' => '', 'autofocus' => '']) }}
</div>
{!! $errors->first('username', '<span class="help-block">:message</span>') !!}
</div>
Expand All @@ -33,22 +36,22 @@

{{-- PASSWORD --}}
<div class="col-lg-6">
<div class="form-group {{ $errors->has('password') ? 'has-error' : '' }}">
{!! Form::label('password', 'Password', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('password', 'has-error') }}">
{{ Form::label('password', trans('auth::users.password'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
{!! Form::password('password', ['class' => 'form-control', 'placeholder' => 'Password', 'required' => '', 'autofocus' => '']) !!}
{{ Form::password('password', ['class' => 'form-control', 'placeholder' => trans('auth::users.password'), 'required' => '', 'autofocus' => '']) }}
</div>
{!! $errors->first('password', '<span class="help-block">:message</span>') !!}
</div>
</div>
{{-- PASSWORD CONFIRMATION --}}
<div class="col-lg-6">
<div class="form-group {{ $errors->has('password_confirmation') ? 'has-error' : '' }}">
{!! Form::label('password_confirmation', 'Password Confirmation', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('password_confirmation', 'has-error') }}">
{{ Form::label('password_confirmation', trans('auth::users.email'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
{!! Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => 'Password confirmation', 'required' => '', 'autofocus' => '']) !!}
{{ Form::password('password_confirmation', ['class' => 'form-control', 'placeholder' => trans('auth::users.password_confirmation'), 'required' => '', 'autofocus' => '']) }}
</div>
{!! $errors->first('password_confirmation', '<span class="help-block">:message</span>') !!}
</div>
Expand All @@ -58,34 +61,36 @@

{{-- FIRST NAME --}}
<div class="col-lg-6">
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{!! Form::label('first_name', 'First Name', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('first_name', 'has-error') }}">
{{ Form::label('first_name', trans('auth::users.first_name'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
{!! Form::text('first_name', old('first_name'), ['class' => 'form-control', 'placeholder' => 'First Name', 'required' => '', 'autofocus' => '']) !!}
{{ Form::text('first_name', old('first_name'), ['class' => 'form-control', 'placeholder' => trans('auth::users.first_name'), 'required' => '', 'autofocus' => '']) }}
</div>
{!! $errors->first('first_name', '<span class="help-block">:message</span>') !!}
</div>
</div>

{{-- LAST NAME --}}
<div class="col-lg-6">
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
{!! Form::label('last_name', 'Last Name', ['class' => 'control-label sr-only']) !!}
<div class="form-group {{ $errors->first('last_name', 'has-error') }}">
{{ Form::label('last_name', trans('auth::users.last_name'), ['class' => 'control-label sr-only']) }}
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
{!! Form::text('last_name', old('last_name'), ['class' => 'form-control', 'placeholder' => 'Last Name', 'required' => '', 'autofocus' => '']) !!}
{{ Form::text('last_name', old('last_name'), ['class' => 'form-control', 'placeholder' => trans('auth::users.last_name'), 'required' => '', 'autofocus' => '']) }}
</div>
{!! $errors->first('last_name', '<span class="help-block">:message</span>') !!}
</div>
</div>
</div>
{!! Form::submit('Sign up', ['class' => 'btn btn-lg btn-success btn-block']) !!}
{!! Form::close() !!}
{{ Form::button(trans('auth::register.submit'), ['type' => 'submit', 'class' => 'btn btn-lg btn-success btn-block']) }}
{{ Form::close() }}

<div class="form-info">
{!! link_to_route('auth::login.get', 'Already have an account ? Sign in', [], ['class' => 'btn btn-primary btn-block']) !!}
</div>
@if ($hasLoginForm)
<div class="form-info">
{{ link_to_route('auth::login.get', trans('auth::register.links.login'), [], ['class' => 'btn btn-primary btn-block']) }}
</div>
@endif
</div>
</div>
@endsection
Expand Down
Loading

0 comments on commit 4577791

Please sign in to comment.