From 32a796181a6100240e6edfdf978a090c8cce5301 Mon Sep 17 00:00:00 2001 From: Julian Prieber <60265788+JulianPrieber@users.noreply.github.com> Date: Wed, 6 Dec 2023 16:57:35 +0100 Subject: [PATCH] Refactored code --- app/Http/Controllers/UserController.php | 4 +- .../views/linkstack/elements/avatar.blade.php | 8 + .../views/linkstack/elements/bio.blade.php | 3 + .../linkstack/elements/buttons.blade.php | 51 +++ .../linkstack/elements/heading.blade.php | 3 + .../views/linkstack/elements/icons.blade.php | 9 + resources/views/linkstack/linkstack.blade.php | 30 ++ .../views/linkstack/modules/assets.blade.php | 7 + .../views/linkstack/modules/meta.blade.php | 74 ++++ .../linkstack/modules/share-button.blade.php | 31 ++ .../views/linkstack/modules/theme.blade.php | 109 ++++++ resources/views/littlelink.blade.php | 349 ------------------ 12 files changed, 327 insertions(+), 351 deletions(-) create mode 100644 resources/views/linkstack/elements/avatar.blade.php create mode 100644 resources/views/linkstack/elements/bio.blade.php create mode 100644 resources/views/linkstack/elements/buttons.blade.php create mode 100644 resources/views/linkstack/elements/heading.blade.php create mode 100644 resources/views/linkstack/elements/icons.blade.php create mode 100644 resources/views/linkstack/linkstack.blade.php create mode 100644 resources/views/linkstack/modules/assets.blade.php create mode 100644 resources/views/linkstack/modules/meta.blade.php create mode 100644 resources/views/linkstack/modules/share-button.blade.php create mode 100644 resources/views/linkstack/modules/theme.blade.php delete mode 100644 resources/views/littlelink.blade.php diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index 57622f8..c0c7b11 100755 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -100,7 +100,7 @@ class UserController extends Controller $links = DB::table('links')->join('buttons', 'buttons.id', '=', 'links.button_id')->select('links.link', 'links.id', 'links.button_id', 'links.title', 'links.custom_css', 'links.custom_icon', 'buttons.name')->where('user_id', $id)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->get(); - return view('littlelink', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); + return view('linkstack.linkstack', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); } //Redirect to user page @@ -135,7 +135,7 @@ class UserController extends Controller $links = DB::table('links')->join('buttons', 'buttons.id', '=', 'links.button_id')->select('links.link', 'links.id', 'links.button_id', 'links.title', 'links.custom_css', 'links.custom_icon', 'buttons.name')->where('user_id', $id)->orderBy('up_link', 'asc')->orderBy('order', 'asc')->get(); - return view('littlelink', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); + return view('linkstack.linkstack', ['userinfo' => $userinfo, 'information' => $information, 'links' => $links, 'littlelink_name' => $littlelink_name]); } //Show add/update form diff --git a/resources/views/linkstack/elements/avatar.blade.php b/resources/views/linkstack/elements/avatar.blade.php new file mode 100644 index 0000000..aa03daa --- /dev/null +++ b/resources/views/linkstack/elements/avatar.blade.php @@ -0,0 +1,8 @@ + + @if(file_exists(base_path(findAvatar($userinfo->id)))) + + @elseif(file_exists(base_path("assets/linkstack/images/").findFile('avatar'))) + + @else + + @endif \ No newline at end of file diff --git a/resources/views/linkstack/elements/bio.blade.php b/resources/views/linkstack/elements/bio.blade.php new file mode 100644 index 0000000..7448271 --- /dev/null +++ b/resources/views/linkstack/elements/bio.blade.php @@ -0,0 +1,3 @@ + + +
@if(env('ALLOW_USER_HTML') === true){!! $info->littlelink_description !!}@else{{ $info->littlelink_description }}@endif