From 76738d07e9b4203f5ea82840e3f66d0bea91e586 Mon Sep 17 00:00:00 2001 From: Kekskurse Date: Wed, 27 Jan 2021 01:11:16 +0100 Subject: [PATCH] Stuff --- app/Http/Controllers/TenantController.php | 12 +++++++++++- resources/views/gallery/index.blade.php | 1 + resources/views/layout/template.blade.php | 1 + resources/views/tenant/theme.blade.php | 21 +++++++++++++++++++++ routes/web.php | 1 + 5 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 resources/views/tenant/theme.blade.php diff --git a/app/Http/Controllers/TenantController.php b/app/Http/Controllers/TenantController.php index 00a0536..bd71edd 100644 --- a/app/Http/Controllers/TenantController.php +++ b/app/Http/Controllers/TenantController.php @@ -4,6 +4,7 @@ namespace App\Http\Controllers; use App\Models\Image; use App\Models\Tenant; +use App\Models\Theme; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Illuminate\Foundation\Bus\DispatchesJobs; use Illuminate\Foundation\Validation\ValidatesRequests; @@ -32,7 +33,8 @@ class TenantController extends BaseController $tenant = new Tenant(); $tenant->name = $validated["name"]; $tenant->url = $validated["url"]; - $tenant->template = "default"; + $tenant->template = "kuvia-blog"; + $tenant->gallery_default_theme = "kuvia-gallery"; $tenant->owner = Auth::user()->id; $tenant->saveOrFail(); @@ -113,4 +115,12 @@ class TenantController extends BaseController return \redirect("/s/watermark"); } + + public function tenantThemeView() { + $themes = Theme::query() + ->where("status", "=", "public") + ->where("typ", "=", "tenant") + ->get(); + return view("tenant.theme", ["themes" => $themes]); + } } diff --git a/resources/views/gallery/index.blade.php b/resources/views/gallery/index.blade.php index 7a344c9..47f9248 100644 --- a/resources/views/gallery/index.blade.php +++ b/resources/views/gallery/index.blade.php @@ -38,6 +38,7 @@ Upload Images Bilder Bearbeiten + Anschauen diff --git a/resources/views/layout/template.blade.php b/resources/views/layout/template.blade.php index 87e272a..ba97da8 100644 --- a/resources/views/layout/template.blade.php +++ b/resources/views/layout/template.blade.php @@ -26,6 +26,7 @@ diff --git a/resources/views/tenant/theme.blade.php b/resources/views/tenant/theme.blade.php new file mode 100644 index 0000000..132c099 --- /dev/null +++ b/resources/views/tenant/theme.blade.php @@ -0,0 +1,21 @@ +@extends('layout/template') + +@section('content') +

Themes

+ + + + + + + @foreach($themes as $theme) + + + + + + @endforeach +
NameVorschauAction
{{ $theme->name }}VorschauAuswählen
+ +@endsection + diff --git a/routes/web.php b/routes/web.php index 880618e..1053f4c 100644 --- a/routes/web.php +++ b/routes/web.php @@ -33,6 +33,7 @@ Route::middleware([\App\Http\Middleware\TenanMiddleware::class])->group(function Route::get("/t/new", [\App\Http\Controllers\TenantController::class, 'newView']); Route::post("/t/new", [\App\Http\Controllers\TenantController::class, 'newTenant']); Route::get("/t/select/{name}", [\App\Http\Controllers\TenantController::class, 'switchTenant']); + Route::get("/s/theme", [\App\Http\Controllers\TenantController::class, 'tenantThemeView']); Route::get("/g", [\App\Http\Controllers\GalleryController::class, 'listView']); Route::get("/g/new", [\App\Http\Controllers\GalleryController::class, 'newView']);