From 1287fa0bc952da661c559e17c4ab99ce6babf904 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Sat, 27 Jun 2020 00:23:57 +0200 Subject: [PATCH] MAPG-89 rewrite views and view templates to the new concept --- views/account/account.php | 8 +-- views/account/delete.php | 8 +-- views/admin/map_editor.php | 32 ++++++----- views/error/404.php | 8 +-- views/game.php | 27 +++++---- views/login/activate.php | 8 +-- views/login/cancel.php | 8 +-- views/login/google_login.php | 8 +-- views/login/google_signup.php | 11 ++-- views/login/login.php | 8 +-- views/login/signup.php | 11 ++-- views/login/signup_success.php | 8 +-- views/maps.php | 11 ++-- views/templates/footer.php | 5 -- views/templates/layout_full.php | 18 ++++++ .../{header.php => layout_normal.php} | 11 +++- views/templates/main_footer.php | 50 ----------------- .../{main_header.php => mapguesser.php} | 55 ++++++++++++++++++- 18 files changed, 165 insertions(+), 130 deletions(-) delete mode 100644 views/templates/footer.php create mode 100644 views/templates/layout_full.php rename views/templates/{header.php => layout_normal.php} (79%) delete mode 100644 views/templates/main_footer.php rename views/templates/{main_header.php => mapguesser.php} (50%) diff --git a/views/account/account.php b/views/account/account.php index dd3c698..f6186b6 100644 --- a/views/account/account.php +++ b/views/account/account.php @@ -1,5 +1,6 @@ - - +@extends('templates/layout_normal') + +@section('main')

Account

@@ -19,5 +20,4 @@
- - \ No newline at end of file +@endsection diff --git a/views/account/delete.php b/views/account/delete.php index 75deec5..1b190e7 100644 --- a/views/account/delete.php +++ b/views/account/delete.php @@ -1,5 +1,6 @@ - - +@extends('templates/layout_normal') + +@section('main')

Delete account

@@ -11,5 +12,4 @@
- - \ No newline at end of file +@endsection diff --git a/views/admin/map_editor.php b/views/admin/map_editor.php index 0e58851..1ca983f 100644 --- a/views/admin/map_editor.php +++ b/views/admin/map_editor.php @@ -1,3 +1,4 @@ +@extra - -
-

- - - -

-

- @@ -46,8 +43,9 @@ $jsFiles = [ 0 -

-
+@endsection + +@section('pagemodal') -
+@endsection + +@section('main')
@@ -73,7 +73,9 @@ $jsFiles = [
-
+@endsection + +@section('pagescript') - \ No newline at end of file +@endsection diff --git a/views/error/404.php b/views/error/404.php index f50146f..7564012 100644 --- a/views/error/404.php +++ b/views/error/404.php @@ -1,6 +1,6 @@ - - +@extends('templates/layout_normal') + +@section('main')

404 | Page not found

The requested URL was not found on this server. Back to start.

- - \ No newline at end of file +@endsection diff --git a/views/game.php b/views/game.php index 8d971fd..bc4c63a 100644 --- a/views/game.php +++ b/views/game.php @@ -1,3 +1,4 @@ +@extra - -
-

- - - -

-

+@endextra + +@extends('templates/layout_full') + +@section('subheader') Round Score -

-
-
+@endsection + +@section('main')
@@ -56,9 +53,11 @@ $jsFiles = [
- +@endsection + +@section('pagescript') - \ No newline at end of file +@endsection diff --git a/views/login/activate.php b/views/login/activate.php index 428ca72..e28c707 100644 --- a/views/login/activate.php +++ b/views/login/activate.php @@ -1,8 +1,8 @@ - - +@extends('templates/layout_normal') + +@section('main')

Account activation

Activation failed. Please check the link you entered or retry sign up!

- - \ No newline at end of file +@endsection diff --git a/views/login/cancel.php b/views/login/cancel.php index 2f37e59..980c125 100644 --- a/views/login/cancel.php +++ b/views/login/cancel.php @@ -1,5 +1,6 @@ - - +@extends('templates/layout_normal') + +@section('main')

Account cancellation

@@ -8,5 +9,4 @@

Cancellation failed. Please check the link you entered! Maybe the account was already deleted, in this case no further action is required.

- - \ No newline at end of file +@endsection diff --git a/views/login/google_login.php b/views/login/google_login.php index da33385..65020f0 100644 --- a/views/login/google_login.php +++ b/views/login/google_login.php @@ -1,8 +1,8 @@ - - +@extends('templates/layout_normal') + +@section('main')

Login up with Google

Authenticating with Google failed. Please retry!

- - \ No newline at end of file +@endsection diff --git a/views/login/google_signup.php b/views/login/google_signup.php index 8b741de..0f9fe9c 100644 --- a/views/login/google_signup.php +++ b/views/login/google_signup.php @@ -1,10 +1,14 @@ +@extra - - +@endextra + +@extends('templates/layout_normal') + +@section('main')

Sign up

@@ -26,5 +30,4 @@ $jsFiles = [
- - \ No newline at end of file +@endsection diff --git a/views/login/login.php b/views/login/login.php index 5170136..e2eef46 100644 --- a/views/login/login.php +++ b/views/login/login.php @@ -1,5 +1,6 @@ - - +@extends('templates/layout_normal') + +@section('main')

Login

@@ -15,5 +16,4 @@
- - \ No newline at end of file +@endsection diff --git a/views/login/signup.php b/views/login/signup.php index c0d11bd..6912a27 100644 --- a/views/login/signup.php +++ b/views/login/signup.php @@ -1,10 +1,14 @@ +@extra - - +@endextra + +@extends('templates/layout_normal') + +@section('main')

Sign up

@@ -30,5 +34,4 @@ $jsFiles = [
- - \ No newline at end of file +@endsection diff --git a/views/login/signup_success.php b/views/login/signup_success.php index e727ee1..f2a42f1 100644 --- a/views/login/signup_success.php +++ b/views/login/signup_success.php @@ -1,8 +1,8 @@ - - +@extends('templates/layout_normal') + +@section('main')

Sign up

Sign up was successful. Please check your email and click on the activation link to activate your account!

- - \ No newline at end of file +@endsection diff --git a/views/maps.php b/views/maps.php index 64ec1db..002d3bb 100644 --- a/views/maps.php +++ b/views/maps.php @@ -1,3 +1,4 @@ +@extra - - +@endextra + +@extends('templates/layout_normal') + +@section('main')
@@ -66,5 +70,4 @@ if ($isAdmin) {
- - \ No newline at end of file +@endsection diff --git a/views/templates/footer.php b/views/templates/footer.php deleted file mode 100644 index 8c3ff6f..0000000 --- a/views/templates/footer.php +++ /dev/null @@ -1,5 +0,0 @@ - -
-

© Pőcze Bence format('Y') ?>

-
\ No newline at end of file diff --git a/views/templates/layout_full.php b/views/templates/layout_full.php new file mode 100644 index 0000000..4a8fd24 --- /dev/null +++ b/views/templates/layout_full.php @@ -0,0 +1,18 @@ +@extends('templates/mapguesser') + +@section('content') +
+

+ + + +

+

+ @yields('subheader') +

+
+
+@yields('main') +
+@endsection diff --git a/views/templates/header.php b/views/templates/layout_normal.php similarity index 79% rename from views/templates/header.php rename to views/templates/layout_normal.php index c903207..1b5dd61 100644 --- a/views/templates/header.php +++ b/views/templates/layout_normal.php @@ -1,3 +1,5 @@ +@extends('templates/mapguesser') +@section('content')

@@ -21,4 +23,11 @@

-
\ No newline at end of file +
+@yields('main') +
+
+

© Pőcze Bence format('Y') ?>

+
+@endsection diff --git a/views/templates/main_footer.php b/views/templates/main_footer.php deleted file mode 100644 index 378e2ff..0000000 --- a/views/templates/main_footer.php +++ /dev/null @@ -1,50 +0,0 @@ - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/views/templates/main_header.php b/views/templates/mapguesser.php similarity index 50% rename from views/templates/main_header.php rename to views/templates/mapguesser.php index a88457d..083fbb7 100644 --- a/views/templates/main_header.php +++ b/views/templates/mapguesser.php @@ -38,4 +38,57 @@

-
\ No newline at end of file + + @yields('pagemodal') + @yields('content') + + @yields('pagescript') + + + + + + + + + + + + + + + +