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',
],
'website-manager' => [
'title' => 'Website Manager',
'title' => 'Plugi Page Builder',
'logout' => 'Logout',
'pages' => 'Seiten',
'menus' => 'Menus',
@@ -35,6 +35,7 @@ return [
'files' => 'Dateien',
'settings' => 'Einstellungen',
'info' => 'Info',
'required' => 'Pflichtfeld',
'website-languages' => 'Website Sprachen',
'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',
],
'website-manager' => [
'title' => 'Website Manager',
'title' => 'Plugi Page Builder',
'logout' => 'Logout',
'pages' => 'Pages',
'menus' => 'Menus',
@@ -35,6 +35,7 @@ return [
'files' => 'Files',
'settings' => 'Settings',
'info' => 'Info',
'required' => 'Required',
'website-languages' => 'Website 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',
],
'website-manager' => [
'title' => 'Webuilder Manager',
'title' => 'Plugi Page Builder',
'logout' => 'Salir',
'pages' => 'Páginas',
'menus' => 'Menús',
@@ -35,6 +35,7 @@ return [
'files' => 'Files',
'settings' => 'Ajustes',
'info' => 'Info',
'required' => 'Required',
'website-languages' => 'Idiomas del sitio',
'languages-selector-placeholder' => 'Selecciona uno o más idiomas',
+2 -1
View File
@@ -9,7 +9,7 @@ return [
'invalid-credentials' => 'Ingevulde logingegevens zijn onjuist',
],
'website-manager' => [
'title' => 'Websitebeheer',
'title' => 'Plugi Page Builder',
'logout' => 'Uitloggen',
'pages' => 'Pagina\'s',
'menus' => 'Menus',
@@ -35,6 +35,7 @@ return [
'files' => 'Files',
'settings' => 'Instellingen',
'info' => 'Info',
'required' => 'Required',
'website-languages' => 'Website talen',
'languages-selector-placeholder' => 'Selecteer één of meerdere talen',
+1
View File
@@ -74,6 +74,7 @@ class Extensions
* @return void
*/
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;
}
@@ -2,7 +2,9 @@ import Alpine from "alpinejs"
import './sass/app.scss'
import './js/app.js'
import "@phosphor-icons/web/thin";
import "@phosphor-icons/web/light";
import "@phosphor-icons/web/regular";
import "@phosphor-icons/web/bold";
import "@phosphor-icons/web/fill";
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>
<html lang="en">
<head>
@@ -10,24 +17,66 @@
</head>
<body>
<div class="">
<?php
if (phpb_config('auth.use_login')):
?>
<a href="<?= phpb_url('auth', ['action' => 'logout']) ?>" class="absolute top-0 right-0 btn btn-light clear btn-sm mt-2 mr-2">
<i class="fas fa-sign-out-alt"></i> <?= phpb_trans('website-manager.logout') ?>
</a>
<?php
endif;
?>
<div class="drawer lg:drawer-open">
<input id="my-drawer-2" type="checkbox" class="drawer-toggle" />
<div class="drawer-content flex flex-col items-center justify-top">
<!-- Page content here -->
<div class="navbar bg-base-100 lg:hidden">
<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>
</div>
</div>
<?php
require __DIR__ . '/../views/' . $viewFile . '.php';
?>
<?php
require __DIR__ . '/../views/' . $viewFile . '.php';
?>
<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>
</footer>
<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>
</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>
<script src="<?= phpb_asset('WebsiteManager.js') ?>"></script>
@@ -1,34 +1,10 @@
<?php
use Plugi\Extensions;
$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 class="max-w-4xl p-4 mx-auto">
<div id="pages" class="tab-pane">
<?php
include $tabs[$activeSlug]['include'];
?>
</div>
</div>
<div class="max-w-4xl p-8 mx-auto w-full">
<div class="text-center text-3xl font-bold mb-8 mt-2">
<?= phpb_e($tabs[$activeSlug]['title']) ?>
</div>
<div class="">
<?php
include $tabs[$activeSlug]['include'];
?>
</div>
</div>
@@ -2,19 +2,28 @@
return [
'pages' => [
'title' => phpb_trans('website-manager.pages'),
'include' => __DIR__ . '/pages.php',
'title' => phpb_trans('website-manager.pages'),
'include' => __DIR__ . '/pages.php',
'icon' => '<i class="ph ph-file"></i>',
],
'menus' => [
'title' => phpb_trans('website-manager.menus'),
'include' => __DIR__ . '/menus.php',
'title' => phpb_trans('website-manager.menus'),
'include' => __DIR__ . '/menus.php',
'icon' => '<i class="ph ph-list"></i>',
],
'files' => [
'title' => phpb_trans('website-manager.files'),
'include' => __DIR__ . '/files.php',
'title' => phpb_trans('website-manager.files'),
'include' => __DIR__ . '/files.php',
'icon' => '<i class="ph ph-folder-notch-open"></i>',
],
'settings' => [
'title' => phpb_trans('website-manager.settings'),
'include' => __DIR__ . '/settings.php',
'title' => phpb_trans('website-manager.settings'),
'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()" />
</div>
<div class="flex flex-wrap gap-4">
<div class="flex flex-wrap justify-center gap-4">
<?php
foreach ($files as $file) :
?>
@@ -17,6 +17,15 @@ foreach ($files as $file) :
<?php
endforeach;
?>
<?php
if (count($files) === 0) :
?>
<div class="relative">
No files...
</div>
<?php
endif;
?>
</div>
<script>
@@ -1,4 +1,4 @@
<div class="main-spacing">
<?php
if (phpb_flash('message')):
?>
@@ -9,8 +9,7 @@
endif;
?>
<div class="table-responsive">
<table class="table table-zebra">
<table class="table table-zebra w-full">
<thead>
<tr>
<th class="w-5">ID</th>
@@ -57,8 +56,7 @@
?>
</tbody>
</table>
</div>
</div>
<div class="text-center mt-8">
<a href="<?= phpb_url('website_manager', ['route' => 'page_settings', 'action' => 'create']) ?>" class="btn btn-primary btn-sm">