Skip to content

Commit

Permalink
Refactored center layout for login
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcage committed Sep 21, 2022
1 parent ec453f1 commit 66dc424
Show file tree
Hide file tree
Showing 4 changed files with 63 additions and 52 deletions.
4 changes: 3 additions & 1 deletion resources/views/auth/privacy.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
@extends('layouts.login')
@extends('layouts.login', [
'width' => 600,
])

@section('title', __('Privacy Policy'))

Expand Down
13 changes: 13 additions & 0 deletions resources/views/layouts/centered.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="{{ config('app.locale') }}" class="h-100">
@include('layouts.include.head')
<body class="h-100 d-flex bg-light">
<div class="my-auto mx-auto p-3" style="width: {{ $width ?? 450 }}px">
@yield('centered-content')
</div>

<script src="{{ mix('js/manifest.js') }}"></script>
<script src="{{ mix('js/vendor.js') }}"></script>
<script src="{{ mix('js/app.js') }}"></script>
</body>
</html>
96 changes: 46 additions & 50 deletions resources/views/layouts/login.blade.php
Original file line number Diff line number Diff line change
@@ -1,53 +1,49 @@
<!doctype html>
<html lang="{{ config('app.locale') }}">
@include('layouts.include.head')
<body class="p-0 m-0 bg-light">

<div class="container">
<div class="row justify-content-center">
<div class="col-md-8 col-lg-6 mt-md-4">

@isset($logo_url)
<div class="px-5 px-sm-0">
<img src="{{ $logo_url }}" class="img-fluid text-center my-sm-0 p-4" alt="Logo"/>
</div>
@endisset

<div class="card shadow mb-4 @unless($logo_url)mt-5 @endunless">
<div class="card-body">

<h1 class="display-4 text-center mb-4">@yield('title')</h1>

{{-- Error message --}}
@if (session('error'))
<x-alert type="danger" dismissible>
{{ session('error') }}
</x-alert>
@endif

@yield('content')

</div>
</div>
<p class="text-center">
<small>
@foreach (language()->allowed() as $code => $name)
<a href="{{ language()->back($code) }}">@if(App::getLocale() == $code)<strong>{{ $name }}</strong>@else{{ $name }}@endif</a> &nbsp;
@endforeach
</small>
</p>
<p class="text-center border-top pt-3">
<small>
{!! __('By using this service, you accept our <a href=":url" target="_blank">privacy policy</a>.', [ 'url' => route('privacyPolicy') ]) !!}
</small>
</p>
</div>
</div>
@extends('layouts.centered')

@section('title', __('Login'))

@section('centered-content')

@isset($logo_url)
<div>
<img src="{{ $logo_url }}" class="img-fluid text-center my-sm-0 p-4" alt="Logo" />
</div>
@endisset

<div class="card shadow mb-4">
<div class="card-body">

<script src="{{ mix('js/manifest.js') }}"></script>
<script src="{{ mix('js/vendor.js') }}"></script>
<script src="{{ mix('js/app.js') }}"></script>
<h1 class="display-4 text-center mb-4">@yield('title')</h1>

</body>
</html>
@if (session('error'))
<x-alert type="danger" dismissible>
{{ session('error') }}
</x-alert>
@endif

@yield('content')

</div>
</div>

<p class="text-center">
<small>
@foreach (language()->allowed() as $code => $name)
<a href="{{ language()->back($code) }}">
@if (App::getLocale() == $code)
<strong>{{ $name }}</strong>@else{{ $name }}
@endif
</a> &nbsp;
@endforeach
</small>
</p>

<footer class="text-center border-top pt-3 pb-2">
<small>
{!! __('By using this service, you accept our <a href=":url" target="_blank">privacy policy</a>.', [
'url' => route('privacyPolicy'),
]) !!}
</small>
</footer>

@endsection
2 changes: 1 addition & 1 deletion routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
->where('driver', implode('|', $socialite_drivers));

// Privacy policy
Route::get('privacyPolicy', PrivacyPolicyController::class)
Route::get('privacy', PrivacyPolicyController::class)
->name('privacyPolicy');

// Settings
Expand Down

0 comments on commit 66dc424

Please sign in to comment.