From 2ded673624cd73614f34564af88eb12f532ac1b0 Mon Sep 17 00:00:00 2001 From: Dries Vints Date: Thu, 13 Aug 2020 21:33:31 +0200 Subject: [PATCH] Refactor to component layouts --- resources/views/auth/login.blade.php | 18 ++++++++---------- .../views/auth/passwords/confirm.blade.php | 12 +++++------- resources/views/auth/passwords/email.blade.php | 18 ++++++++---------- resources/views/auth/passwords/reset.blade.php | 6 ++---- resources/views/auth/register.blade.php | 18 ++++++++---------- resources/views/auth/verify.blade.php | 14 ++++++-------- .../views/components/layouts/app.blade.php | 5 +++++ .../{ => components}/layouts/auth.blade.php | 18 +++++++++--------- .../{ => components}/layouts/base.blade.php | 9 ++++++--- .../{ => components}/layouts/footer.blade.php | 0 .../layouts/navigation.blade.php | 2 +- resources/views/home.blade.php | 6 ++---- resources/views/layouts/app.blade.php | 7 ------- resources/views/settings.blade.php | 6 ++---- resources/views/welcome.blade.php | 6 ++---- 15 files changed, 64 insertions(+), 81 deletions(-) create mode 100644 resources/views/components/layouts/app.blade.php rename resources/views/{ => components}/layouts/auth.blade.php (73%) rename resources/views/{ => components}/layouts/base.blade.php (75%) rename resources/views/{ => components}/layouts/footer.blade.php (100%) rename resources/views/{ => components}/layouts/navigation.blade.php (95%) delete mode 100644 resources/views/layouts/app.blade.php diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index 9d9b032..2d9dc7d 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,13 +1,11 @@ -@extends('layouts.auth', ['title' => 'Sign in to your account']) + + + Or + + register a new account + + -@section('description') - Or - - register a new account - -@endsection - -@section('content')
@@ -55,4 +53,4 @@
-@endsection +
diff --git a/resources/views/auth/passwords/confirm.blade.php b/resources/views/auth/passwords/confirm.blade.php index 5285500..faa09a5 100644 --- a/resources/views/auth/passwords/confirm.blade.php +++ b/resources/views/auth/passwords/confirm.blade.php @@ -1,10 +1,8 @@ -@extends('layouts.auth', ['title' => __('Confirm Password')]) + + + {{ __('Please confirm your password before continuing.') }} + -@section('description') - {{ __('Please confirm your password before continuing.') }} -@endsection - -@section('content')
@@ -31,4 +29,4 @@
-@endsection +
diff --git a/resources/views/auth/passwords/email.blade.php b/resources/views/auth/passwords/email.blade.php index 89b41d1..01ebec9 100644 --- a/resources/views/auth/passwords/email.blade.php +++ b/resources/views/auth/passwords/email.blade.php @@ -1,13 +1,11 @@ -@extends('layouts.auth', ['title' => __('Reset Password')]) + + + Or + + go back to login + + -@section('description') - Or - - go back to login - -@endsection - -@section('content')
@@ -28,4 +26,4 @@
-@endsection +
diff --git a/resources/views/auth/passwords/reset.blade.php b/resources/views/auth/passwords/reset.blade.php index be815e4..6e6308c 100644 --- a/resources/views/auth/passwords/reset.blade.php +++ b/resources/views/auth/passwords/reset.blade.php @@ -1,6 +1,4 @@ -@extends('layouts.auth', ['title' => __('Reset Password')]) - -@section('content') + @@ -42,4 +40,4 @@ -@endsection + diff --git a/resources/views/auth/register.blade.php b/resources/views/auth/register.blade.php index f54ec57..4744bad 100644 --- a/resources/views/auth/register.blade.php +++ b/resources/views/auth/register.blade.php @@ -1,13 +1,11 @@ -@extends('layouts.auth', ['title' => 'Register a new account']) + + + Or + + sign in to your account + + -@section('description') - Or - - sign in to your account - -@endsection - -@section('content')
@@ -61,4 +59,4 @@
-@endsection +
diff --git a/resources/views/auth/verify.blade.php b/resources/views/auth/verify.blade.php index 253d086..476d20a 100644 --- a/resources/views/auth/verify.blade.php +++ b/resources/views/auth/verify.blade.php @@ -1,11 +1,9 @@ -@extends('layouts.auth', ['title' => __('Verify Your Email Address')]) + + + {{ __('Before proceeding, please check your email for a verification link.') }} + {{ __('If you did not receive the email, click the button below to request another one.') }} + -@section('description') - {{ __('Before proceeding, please check your email for a verification link.') }} - {{ __('If you did not receive the email, click the button below to request another one.') }} -@endsection - -@section('content')
@@ -15,5 +13,5 @@
-@endsection +
diff --git a/resources/views/components/layouts/app.blade.php b/resources/views/components/layouts/app.blade.php new file mode 100644 index 0000000..2070276 --- /dev/null +++ b/resources/views/components/layouts/app.blade.php @@ -0,0 +1,5 @@ + + + + {{ $slot }} + diff --git a/resources/views/layouts/auth.blade.php b/resources/views/components/layouts/auth.blade.php similarity index 73% rename from resources/views/layouts/auth.blade.php rename to resources/views/components/layouts/auth.blade.php index b3375f3..d71b744 100644 --- a/resources/views/layouts/auth.blade.php +++ b/resources/views/components/layouts/auth.blade.php @@ -1,19 +1,19 @@ -@extends('layouts.base') - -@section('body') +
- + + +

{{ $title }}

- @hasSection('description') + @isset($description)

- @yield('description') + {{ $description }}

- @endif + @endisset @@ -23,8 +23,8 @@
- @yield('content') + {{ $slot }}
-@endsection + diff --git a/resources/views/layouts/base.blade.php b/resources/views/components/layouts/base.blade.php similarity index 75% rename from resources/views/layouts/base.blade.php rename to resources/views/components/layouts/base.blade.php index 39f70e8..a26339a 100644 --- a/resources/views/layouts/base.blade.php +++ b/resources/views/components/layouts/base.blade.php @@ -1,4 +1,7 @@ - + - @yield('body') + {{ $slot }} - @include('layouts.footer') + @livewireScripts @bukScripts diff --git a/resources/views/layouts/footer.blade.php b/resources/views/components/layouts/footer.blade.php similarity index 100% rename from resources/views/layouts/footer.blade.php rename to resources/views/components/layouts/footer.blade.php diff --git a/resources/views/layouts/navigation.blade.php b/resources/views/components/layouts/navigation.blade.php similarity index 95% rename from resources/views/layouts/navigation.blade.php rename to resources/views/components/layouts/navigation.blade.php index c26e314..c9bf559 100644 --- a/resources/views/layouts/navigation.blade.php +++ b/resources/views/components/layouts/navigation.blade.php @@ -62,7 +62,7 @@ -->