update plugi ui

This commit is contained in:
Paul Spenke
2023-06-09 17:04:38 +08:00
parent 186c88fe29
commit ec48164c46
14 changed files with 116 additions and 68 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+1 -1
View File
File diff suppressed because one or more lines are too long
+2 -1
View File
@@ -9,7 +9,7 @@ return [
'invalid-credentials' => 'Falsche Zugangsdaten', 'invalid-credentials' => 'Falsche Zugangsdaten',
], ],
'website-manager' => [ 'website-manager' => [
'title' => 'Website Manager', 'title' => 'Plugi Page Builder',
'logout' => 'Logout', 'logout' => 'Logout',
'pages' => 'Seiten', 'pages' => 'Seiten',
'menus' => 'Menus', 'menus' => 'Menus',
@@ -35,6 +35,7 @@ return [
'files' => 'Dateien', 'files' => 'Dateien',
'settings' => 'Einstellungen', 'settings' => 'Einstellungen',
'info' => 'Info',
'required' => 'Pflichtfeld', 'required' => 'Pflichtfeld',
'website-languages' => 'Website Sprachen', 'website-languages' => 'Website Sprachen',
'languages-selector-placeholder' => 'Wähle eine oder mehr Sprachen aus', 'languages-selector-placeholder' => 'Wähle eine oder mehr Sprachen aus',
+2 -1
View File
@@ -9,7 +9,7 @@ return [
'invalid-credentials' => 'Invalid username or password', 'invalid-credentials' => 'Invalid username or password',
], ],
'website-manager' => [ 'website-manager' => [
'title' => 'Website Manager', 'title' => 'Plugi Page Builder',
'logout' => 'Logout', 'logout' => 'Logout',
'pages' => 'Pages', 'pages' => 'Pages',
'menus' => 'Menus', 'menus' => 'Menus',
@@ -35,6 +35,7 @@ return [
'files' => 'Files', 'files' => 'Files',
'settings' => 'Settings', 'settings' => 'Settings',
'info' => 'Info',
'required' => 'Required', 'required' => 'Required',
'website-languages' => 'Website languages', 'website-languages' => 'Website languages',
'languages-selector-placeholder' => 'Select one or more languages', 'languages-selector-placeholder' => 'Select one or more languages',
+2 -1
View File
@@ -9,7 +9,7 @@ return [
'invalid-credentials' => 'Usuario o contraseña Inválidos', 'invalid-credentials' => 'Usuario o contraseña Inválidos',
], ],
'website-manager' => [ 'website-manager' => [
'title' => 'Webuilder Manager', 'title' => 'Plugi Page Builder',
'logout' => 'Salir', 'logout' => 'Salir',
'pages' => 'Páginas', 'pages' => 'Páginas',
'menus' => 'Menús', 'menus' => 'Menús',
@@ -35,6 +35,7 @@ return [
'files' => 'Files', 'files' => 'Files',
'settings' => 'Ajustes', 'settings' => 'Ajustes',
'info' => 'Info',
'required' => 'Required', 'required' => 'Required',
'website-languages' => 'Idiomas del sitio', 'website-languages' => 'Idiomas del sitio',
'languages-selector-placeholder' => 'Selecciona uno o más idiomas', 'languages-selector-placeholder' => 'Selecciona uno o más idiomas',
+2 -1
View File
@@ -9,7 +9,7 @@ return [
'invalid-credentials' => 'Ingevulde logingegevens zijn onjuist', 'invalid-credentials' => 'Ingevulde logingegevens zijn onjuist',
], ],
'website-manager' => [ 'website-manager' => [
'title' => 'Websitebeheer', 'title' => 'Plugi Page Builder',
'logout' => 'Uitloggen', 'logout' => 'Uitloggen',
'pages' => 'Pagina\'s', 'pages' => 'Pagina\'s',
'menus' => 'Menus', 'menus' => 'Menus',
@@ -35,6 +35,7 @@ return [
'files' => 'Files', 'files' => 'Files',
'settings' => 'Instellingen', 'settings' => 'Instellingen',
'info' => 'Info',
'required' => 'Required', 'required' => 'Required',
'website-languages' => 'Website talen', 'website-languages' => 'Website talen',
'languages-selector-placeholder' => 'Selecteer één of meerdere talen', 'languages-selector-placeholder' => 'Selecteer één of meerdere talen',
+1
View File
@@ -74,6 +74,7 @@ class Extensions
* @return void * @return void
*/ */
public static function registerBackend(string $slug, array $backend) { public static function registerBackend(string $slug, array $backend) {
$backend['icon'] = $backend['icon'] ?: '<i class="ph ph-circles-three-plus"></i>';
self::$backends['ext--'.$slug] = $backend; self::$backends['ext--'.$slug] = $backend;
} }
@@ -2,7 +2,9 @@ import Alpine from "alpinejs"
import './sass/app.scss' import './sass/app.scss'
import './js/app.js' import './js/app.js'
import "@phosphor-icons/web/thin";
import "@phosphor-icons/web/light"; import "@phosphor-icons/web/light";
import "@phosphor-icons/web/regular";
import "@phosphor-icons/web/bold"; import "@phosphor-icons/web/bold";
import "@phosphor-icons/web/fill"; import "@phosphor-icons/web/fill";
import "@phosphor-icons/web/duotone"; import "@phosphor-icons/web/duotone";
@@ -1,3 +1,10 @@
<?php
use Plugi\Extensions;
$tabs = include __DIR__ . '/../views/tabs/config.php';
$tabs = array_merge($tabs, Extensions::getBackends());
$activeSlug = $_GET['tab'] ?: array_key_first($tabs);
?>
<!doctype html> <!doctype html>
<html lang="en"> <html lang="en">
<head> <head>
@@ -10,17 +17,25 @@
</head> </head>
<body> <body>
<div class=""> <div class="drawer lg:drawer-open">
<?php <input id="my-drawer-2" type="checkbox" class="drawer-toggle" />
if (phpb_config('auth.use_login')): <div class="drawer-content flex flex-col items-center justify-top">
?> <!-- Page content here -->
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="absolute top-0 right-0 btn btn-light clear btn-sm mt-2 mr-2"> <div class="navbar bg-base-100 lg:hidden">
<i class="fas fa-sign-out-alt"></i> <?= phpb_trans('website-manager.logout') ?> <div class="navbar-start">
<label for="my-drawer-2" class="btn btn-square btn-ghost drawer-button">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" class="inline-block w-5 h-5 stroke-current"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16"></path></svg>
</label>
</div>
<div class="navbar-center">
<span class="text-xl"><?= phpb_trans('website-manager.title') ?></span>
</div>
<div class="navbar-end">
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="btn btn-square btn-ghost">
<i class="text-lg ph ph-sign-out"></i>
</a> </a>
<?php </div>
endif; </div>
?>
<?php <?php
require __DIR__ . '/../views/' . $viewFile . '.php'; require __DIR__ . '/../views/' . $viewFile . '.php';
?> ?>
@@ -28,6 +43,40 @@
<footer class="my-5 pt-5 text-muted text-center text-small"> <footer class="my-5 pt-5 text-muted text-center text-small">
<p class="mb-1">Powered by <a href="https://github.com/deepDiverPaul/plugi" target="_blank">Plugi Page Builder</a></p> <p class="mb-1">Powered by <a href="https://github.com/deepDiverPaul/plugi" target="_blank">Plugi Page Builder</a></p>
</footer> </footer>
</div>
<div class="drawer-side">
<label for="my-drawer-2" class="drawer-overlay"></label>
<ul class="menu p-4 w-80 h-full bg-base-200 text-base-content">
<!-- Sidebar content here -->
<div class="py-5 text-2xl text-center">
<h2><?= phpb_trans('website-manager.title') ?></h2>
</div>
<?php
foreach ($tabs as $slug => $tab) :
?>
<li class="mb-1">
<a class="<?= phpb_e($slug === $activeSlug ? 'bg-base-100' : '' ) ?>" href="?tab=<?= phpb_e($slug) ?>">
<?= $tab['icon'] ?: '<i class="ph ph-circles-four"></i>' ?> <?= phpb_e($tab['title']) ?>
</a>
</li>
<?php
endforeach;
?>
<?php
if (phpb_config('auth.use_login')):
?>
<li class="lg:flex hidden">
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="">
<i class="ph ph-sign-out"></i> <?= phpb_trans('website-manager.logout') ?>
</a>
</li>
<?php
endif;
?>
</ul>
</div>
</div> </div>
<script src="<?= phpb_asset('WebsiteManager.js') ?>"></script> <script src="<?= phpb_asset('WebsiteManager.js') ?>"></script>
@@ -1,34 +1,10 @@
<?php <div class="max-w-4xl p-8 mx-auto w-full">
<div class="text-center text-3xl font-bold mb-8 mt-2">
use Plugi\Extensions; <?= phpb_e($tabs[$activeSlug]['title']) ?>
$tabs = include 'tabs/config.php';
$tabs = array_merge($tabs, Extensions::getBackends());
$activeSlug = $_GET['tab'] ?: array_key_first($tabs);
?>
<div class="py-5 text-center">
<h2><?= phpb_trans('website-manager.title') ?></h2>
</div>
<div class="row">
<div class="col-12">
<div class="flex justify-center mb-4">
<div class="tabs tabs-boxed border">
<?php
foreach ($tabs as $slug => $tab) :
?>
<a class="tab <?= phpb_e($slug === $activeSlug ? 'tab-active' : '' ) ?>" href="?tab=<?= phpb_e($slug) ?>"><?= phpb_e($tab['title']) ?></a>
<?php
endforeach;
?>
</div> </div>
</div> <div class="">
<div class="max-w-4xl p-4 mx-auto">
<div id="pages" class="tab-pane">
<?php <?php
include $tabs[$activeSlug]['include']; include $tabs[$activeSlug]['include'];
?> ?>
</div> </div>
</div>
</div>
</div> </div>
@@ -4,17 +4,26 @@ return [
'pages' => [ 'pages' => [
'title' => phpb_trans('website-manager.pages'), 'title' => phpb_trans('website-manager.pages'),
'include' => __DIR__ . '/pages.php', 'include' => __DIR__ . '/pages.php',
'icon' => '<i class="ph ph-file"></i>',
], ],
'menus' => [ 'menus' => [
'title' => phpb_trans('website-manager.menus'), 'title' => phpb_trans('website-manager.menus'),
'include' => __DIR__ . '/menus.php', 'include' => __DIR__ . '/menus.php',
'icon' => '<i class="ph ph-list"></i>',
], ],
'files' => [ 'files' => [
'title' => phpb_trans('website-manager.files'), 'title' => phpb_trans('website-manager.files'),
'include' => __DIR__ . '/files.php', 'include' => __DIR__ . '/files.php',
'icon' => '<i class="ph ph-folder-notch-open"></i>',
], ],
'settings' => [ 'settings' => [
'title' => phpb_trans('website-manager.settings'), 'title' => phpb_trans('website-manager.settings'),
'include' => __DIR__ . '/settings.php', 'include' => __DIR__ . '/settings.php',
'icon' => '<i class="ph ph-gear"></i>',
],
'info' => [
'title' => phpb_trans('website-manager.info'),
'include' => __DIR__ . '/info.php',
'icon' => '<i class="ph ph-info"></i>',
], ],
]; ];
@@ -2,7 +2,7 @@
<input type="file" id="fileupload" class="file-input file-input-bordered file-input-sm file-input-primary w-full max-w-md" name="fileupload" onchange="uploadFile()" onselect="uploadFile()" /> <input type="file" id="fileupload" class="file-input file-input-bordered file-input-sm file-input-primary w-full max-w-md" name="fileupload" onchange="uploadFile()" onselect="uploadFile()" />
</div> </div>
<div class="flex flex-wrap gap-4"> <div class="flex flex-wrap justify-center gap-4">
<?php <?php
foreach ($files as $file) : foreach ($files as $file) :
?> ?>
@@ -17,6 +17,15 @@ foreach ($files as $file) :
<?php <?php
endforeach; endforeach;
?> ?>
<?php
if (count($files) === 0) :
?>
<div class="relative">
No files...
</div>
<?php
endif;
?>
</div> </div>
<script> <script>
@@ -1,4 +1,4 @@
<div class="main-spacing">
<?php <?php
if (phpb_flash('message')): if (phpb_flash('message')):
?> ?>
@@ -9,8 +9,7 @@
endif; endif;
?> ?>
<div class="table-responsive"> <table class="table table-zebra w-full">
<table class="table table-zebra">
<thead> <thead>
<tr> <tr>
<th class="w-5">ID</th> <th class="w-5">ID</th>
@@ -57,8 +56,7 @@
?> ?>
</tbody> </tbody>
</table> </table>
</div>
</div>
<div class="text-center mt-8"> <div class="text-center mt-8">
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'create']) ?>" class="btn btn-primary btn-sm"> <a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'create']) ?>" class="btn btn-primary btn-sm">