intergrated the fipamo theme kit

a basic preview engine has been added to ease the process of editing
pages. currently it previews all basic templates and custom created
pages

this is will replace the external fipamo theme kit tool, which will be
archived
This commit is contained in:
ro 2024-04-25 15:03:06 -06:00
parent 8bf640ee18
commit 6cb9631a46
No known key found for this signature in database
GPG key ID: 29B551CDBD4D3B50
8 changed files with 135 additions and 17 deletions

View file

@ -7,6 +7,7 @@ use App\Interfaces\PageRepositoryInterface;
use App\Services\AuthService; use App\Services\AuthService;
use App\Services\SortingService; use App\Services\SortingService;
use App\Services\AssetService; use App\Services\AssetService;
use App\Services\ThemeService;
class ThemeController extends Controller class ThemeController extends Controller
{ {
@ -14,17 +15,33 @@ class ThemeController extends Controller
protected AuthService $auth; protected AuthService $auth;
protected AssetService $assets; protected AssetService $assets;
protected SortingService $sort; protected SortingService $sort;
protected ThemeService $themes;
public function __construct( public function __construct(
PageRepositoryInterface $pageRepository, PageRepositoryInterface $pageRepository,
AuthService $authService, AuthService $authService,
AssetService $assetService, AssetService $assetService,
SortingService $sortService, SortingService $sortService,
ThemeService $themeService,
) { ) {
$this->pages = $pageRepository; $this->pages = $pageRepository;
$this->auth = $authService; $this->auth = $authService;
$this->assets = $assetService; $this->assets = $assetService;
$this->sort = $sortService; $this->sort = $sortService;
$this->themes = $themeService;
}
public function start()
{
if ($this->auth::status()) {
return view('theme.start', [
"status" => $this->auth::status(),
"title" => "Fipamo Theme Kit",
"pages" => $this->themes->getCustomViews('page')
]);
} else {
return redirect('back.login');
}
} }
public function getView($view = 'index') public function getView($view = 'index')
@ -52,6 +69,10 @@ class ThemeController extends Controller
$template = $currentTheme . '.archive'; $template = $currentTheme . '.archive';
$pageData = $this->sort->archive(); $pageData = $this->sort->archive();
break; break;
default:
$template = $currentTheme . '.' . $view;
$page = $this->pages->getById('F4429D34-25E7-4CA9-9B0A-742810277505');
$pageData = $this->sort->page($page);
} }
if ($this->auth::status()) { if ($this->auth::status()) {
return view($template, $pageData); return view($template, $pageData);

View file

@ -0,0 +1,62 @@
@extends('fipamo-default-v2.base')
@section('title', $title)
@section('main-content')
<article>
<h1>{{ $title }}</h1>
<p>{!!$content!!}</p>
PAGE CUSTOM
</article>
<section class="page-meta">
<div>
<h2>Files</h2>
@foreach($files as $file)
@if($file['type'] != 'mp3')
@php
$fileName = explode("/", $file['file']);
@endphp
<a href="{{ $file['file'] }}">{{ $fileName[6] }}</a>
@endif
@endforeach
</div>
<div>
<h2>Sounds</h2>
@foreach($files as $file)
@if($file['type'] == 'mp3')
<audio controls>
<source src="{{ $file['file'] }}" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
@endif
@endforeach
</div>
<div>
<h2>Info</h2>
{{ $meta['who'] }}
dropped this
{{ $meta['when'] }}<br/>
</div>
<div>
<h2>Tags</h2>
@foreach($tags as $tag)
@if(isset($dynamicRender))
@if($dynamicRender == 'true')
<a href="{{ "/tags/".$tag['slug'] }}">
{{ $tag['label'] }}
</a>
@else
<a href="{{ "/tags/".$tag['slug'].".html" }}">
{{ $tag['label'] }}
</a>
@endif
@else
<a href="{{ "/tags/".$tag['slug'].".html" }}">
{{ $tag['label'] }}
</a>
@endif
@endforeach
</div>
</section>
@endsection

View file

@ -24,6 +24,13 @@ a {
transition: all 0.2s linear; transition: all 0.2s linear;
} }
a.secondary {
color: var(--secondary);
text-decoration: none;
border-bottom: 0;
transition: all 0.2s linear;
}
img.logo-medium { img.logo-medium {
width: 140px; width: 140px;
} }

View file

@ -105,32 +105,37 @@ article[class="settings"] button > span {
position: relative; position: relative;
} }
section[class="member-settings"] section[class="member-settings"] > div[class="features"] button[data-enabled="true"] {
> div[class="features"]
button[data-enabled="true"] {
color: var(--white); color: var(--white);
} }
section[class="member-settings"] section[class="member-settings"] > div[class="features"] button[data-enabled="false"] {
> div[class="features"]
button[data-enabled="false"] {
color: var(--primary); color: var(--primary);
background: var(--secondary); background: var(--secondary);
} }
section[class="member-settings"] section[class="member-settings"] > div[class="theme"] button[data-enabled="true"] {
> div[class="theme"]
button[data-enabled="true"] {
color: var(--white); color: var(--white);
background: var(--secondary-highlight); background: var(--secondary-highlight);
display: block; display: inline-block;
border-radius: 3px; border-radius: 3px;
padding: 3px; padding: 3px;
width: 83%;
margin-right: 5px;
} }
section[class="member-settings"] section[class="member-settings"] > div[class="theme"] a {
> div[class="theme"] background: var(--secondary-highlight);
button[data-enabled="false"] { display: inline-block;
width: 15%;
border-radius: 3px;
text-align: center;
vertical-align: top;
top: 13px;
position: relative;
}
section[class="member-settings"] > div[class="theme"] button[data-enabled="false"] {
color: var(--primary); color: var(--primary);
background: var(--secondary); background: var(--secondary);
display: block; display: block;

View file

@ -79,7 +79,7 @@
<use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-palette"/> <use id="nav-menu-icon" xlink:href="/assets/images/global/sprite.svg#entypo-palette"/>
</svg> </svg>
<span>{{ $theme['display-name'] }}</span> <span>{{ $theme['display-name'] }}</span>
</button> </button><a target="_blank" href='/theme'>Edit</a>
@else @else
<button href="#" id="{{ $theme['name'] }}" class="theme-select" data-enabled="false"> <button href="#" id="{{ $theme['name'] }}" class="theme-select" data-enabled="false">
<svg id="nav-menu-icon" class="icon"> <svg id="nav-menu-icon" class="icon">

View file

@ -13,7 +13,7 @@
</head> </head>
<body> <body>
<script>0</script>
<header> <header>
@if($status) @if($status)
<nav class="top-nav"> <nav class="top-nav">

View file

@ -0,0 +1,23 @@
@extends('frame')
@section('title', 'The Dash | Fipamo Theme Kit')
@section('main-content')
<section class="index-header">
<div class="index-header-left">
<h1>Templates</h1>
<h2>Base</h2>
<a class="secondary" href="/theme/view/index">Index</a><br />
<a class="secondary" href="/theme/view/page">Page</a><br />
<a class="secondary" href="/theme/view/tags">Tags</a><br />
<a class="secondary" href="/theme/view/archive">Archive</a><br />
<h2>Custom</h2>
@foreach($pages as $view)
@if($view != 'page')
<a href="/theme/view/{{ $view }}" class="secondary" href="">{{ $view }}</a><br />
@endif
@endforeach
</div>
<div class="index-header-right"></div>
</section>
@endsection

View file

@ -35,8 +35,8 @@ Route::group(['prefix' => 'dashboard', 'middleware' => 'member.check'], function
Route::get("/logout", [AuthController::class, 'exit']); Route::get("/logout", [AuthController::class, 'exit']);
}); });
//theming //theme kit
Route::group(['prefix' => 'theme', 'middleware' => 'member.check'], function () { Route::group(['prefix' => 'theme', 'middleware' => 'member.check'], function () {
Route::get("/", [ThemeController::class, 'start']);
Route::get("/view/{view?}", [ThemeController::class, 'getView']); Route::get("/view/{view?}", [ThemeController::class, 'getView']);
}); });