refresh admin interface layouts

Redesign authentication and website manager views with responsive layouts, clearer navigation, and accessibility improvements. Refresh page, menu, file, system information, settings, overview, welcome, page settings, and block thumbnail screens. Add the shared Admin stylesheet and Plugi theme, update the build configuration, and regenerate the admin CSS.
This commit is contained in:
2026-11-25 12:02:54 +01:00
parent 151ac9df4c
commit 9d192c2141
22 changed files with 677 additions and 378 deletions
@@ -19,17 +19,19 @@ if(isset($_GET['id']))
$isEditing = isset($form['id']) && $form['id'] > 0;
?>
<div class="mb-6">
<header class="mb-6 flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
<div class="flex items-center gap-3">
<a href="?tab=ext--form" class="btn btn-ghost btn-sm btn-circle" aria-label="Back to forms" title="Back to forms">
<i class="ph-duotone ph-arrow-left text-xl"></i>
<a href="?tab=ext--form" class="btn btn-ghost btn-square btn-sm" aria-label="Back to forms" title="Back to forms">
<i class="ph-duotone ph-arrow-left text-xl" aria-hidden="true"></i>
</a>
<div>
<h2 class="text-xl font-bold"><?= $isEditing ? 'Edit form' : 'New form' ?></h2>
<div class="space-y-1">
<p class="text-xs font-semibold uppercase tracking-[0.18em] text-primary">Form builder</p>
<h2 class="text-xl font-bold tracking-tight"><?= $isEditing ? 'Edit form' : 'New form' ?></h2>
<p class="text-sm text-base-content/60"><?= $isEditing ? 'Change your form settings.' : 'Create a new form with fields and actions.' ?></p>
</div>
</div>
</div>
<span class="badge badge-outline self-start sm:self-center"><?= $isEditing ? 'Editing form' : 'New form' ?></span>
</header>
<script>
const fields = <?= $form["fields"] ?>;
@@ -37,7 +39,7 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
const finisherDefinitions = <?= json_encode($finisherDefinitions, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT) ?>;
</script>
<form action="/ext--form/save-form" method="post" x-data="{
<form action="/ext--form/save-form" method="post" class="space-y-6" x-data="{
fields: fields,
finishers: finishers,
defaultField: {name: 'form_field', label: 'Form field', type: 'text', required: false, options: []},
@@ -104,42 +106,52 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
if(isset($form['id'])) echo '<input type="hidden" name="id" value="'.$form['id'].'">';
?>
<div class="card mb-6 border border-base-300/60 bg-base-100 shadow-sm">
<div class="card-body">
<div class="flex items-center gap-2 mb-4">
<i class="ph-duotone ph-text-aa text-2xl text-primary" aria-hidden="true"></i>
<h3 class="card-title text-lg">Basics</h3>
</div>
<div class="form-control">
<section class="card border border-base-300 bg-base-100 shadow-sm" aria-labelledby="form-basics-title">
<div class="card-body gap-5 p-4 sm:p-6 lg:p-8">
<header class="flex items-start gap-3 border-b border-base-300 pb-4">
<span class="grid size-10 shrink-0 place-items-center rounded-xl bg-primary/10 text-primary">
<i class="text-xl ph-duotone ph-text-aa" aria-hidden="true"></i>
</span>
<div>
<h3 class="card-title text-lg" id="form-basics-title">Basics</h3>
<p class="mt-1 text-sm text-base-content/60">Give the form a name that will be easy to identify later.</p>
</div>
</header>
<div class="form-control w-full max-w-2xl gap-1">
<label class="label" for="form-name">
<span class="label-text font-medium">Form name</span>
<span class="label-text-alt">Required</span>
</label>
<input id="form-name" type="text" name="name" value="<?= phpb_e($form['name']) ?>" placeholder="e.g. Contact form" class="input input-bordered w-full" required />
<span class="label-text-alt text-base-content/60">A unique name for your form.</span>
<input id="form-name" type="text" name="name" value="<?= phpb_e($form['name']) ?>" placeholder="e.g. Contact form" class="input input-bordered w-full" required aria-describedby="form-name-help" />
<span class="label-text-alt mt-1 text-base-content/60" id="form-name-help">A unique name for your form.</span>
</div>
</div>
</div>
</section>
<div class="card mb-6 border border-base-300/60 bg-base-100 shadow-sm">
<div class="card-body">
<div class="flex items-center gap-2 mb-4">
<i class="ph-duotone ph-list-dashes text-2xl text-primary" aria-hidden="true"></i>
<h3 class="card-title text-lg">Form fields</h3>
</div>
<p class="text-sm text-base-content/60 mb-4">Define the fields users can fill out.</p>
<section class="card border border-base-300 bg-base-100 shadow-sm" aria-labelledby="form-fields-title">
<div class="card-body gap-5 p-4 sm:p-6 lg:p-8">
<header class="flex items-start gap-3 border-b border-base-300 pb-4">
<span class="grid size-10 shrink-0 place-items-center rounded-xl bg-secondary/10 text-secondary">
<i class="text-xl ph-duotone ph-list-dashes" aria-hidden="true"></i>
</span>
<div>
<h3 class="card-title text-lg" id="form-fields-title">Form fields</h3>
<p class="mt-1 text-sm text-base-content/60">Define the fields people can fill out. Drag a field to change its order.</p>
</div>
</header>
<input type="hidden" name="fields" :value="JSON.stringify(fields)">
<div x-show="fields.length === 0" class="rounded-box border-2 border-dashed border-base-300 px-4 py-8 text-center">
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30"></i>
<p class="text-sm text-base-content/50 mt-2">No fields added yet</p>
<button type="button" @click="addField()" class="btn btn-sm btn-primary mt-2">Add your first field</button>
<div x-show="fields.length === 0" class="rounded-box border border-dashed border-base-300 bg-base-200/40 px-4 py-10 text-center">
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30" aria-hidden="true"></i>
<p class="mt-2 text-sm text-base-content/60">No fields added yet</p>
<button type="button" @click="addField()" class="btn btn-primary btn-sm mt-3">Add your first field</button>
</div>
<div x-show="fields.length > 0" class="space-y-3">
<div x-show="fields.length > 0" class="space-y-4">
<template x-for="(field, index) in fields">
<div
class="border rounded-lg p-3 bg-base-200/50 transition-colors"
class="rounded-box border border-base-300 bg-base-200/40 p-4 shadow-sm transition-colors sm:p-5"
:class="{
'border-error': getValidationErrors(field, index).length > 0,
'border-base-300': getValidationErrors(field, index).length === 0,
@@ -151,10 +163,10 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
@drop.prevent="moveField(dragIndex, index)"
@dragend="dragIndex = null"
>
<div class="mb-2 flex flex-col gap-2 sm:flex-row sm:items-center">
<div class="mb-3 flex flex-col gap-2 sm:flex-row sm:items-center">
<!-- Drag handle -->
<button type="button" class="btn btn-ghost btn-xs btn-square cursor-grab active:cursor-grabbing text-base-content/40 hover:text-base-content" title="Drag to move" aria-label="Drag to move field">
<i class="ph-duotone ph-dots-six-vertical text-lg"></i>
<i class="ph-duotone ph-dots-six-vertical text-lg" aria-hidden="true"></i>
</button>
<span class="text-xs font-mono text-base-content/40 w-6">#[<span x-text="index + 1"></span>]</span>
<div class="w-full flex-1">
@@ -179,10 +191,10 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
</div>
</div>
<!-- Validation errors -->
<div x-show="getValidationErrors(field, index).length > 0" x-transition class="mb-2 rounded border border-error/30 bg-error/10 p-2 text-xs text-error" role="alert" aria-live="polite">
<div x-show="getValidationErrors(field, index).length > 0" x-transition class="alert alert-error alert-soft mb-3 px-3 py-2 text-xs" role="alert" aria-live="polite">
<template x-for="(error, errIndex) in getValidationErrors(field, index)">
<div :key="errIndex" class="flex items-center gap-1">
<i class="ph-duotone ph-warning text-sm"></i>
<i class="ph-duotone ph-warning text-sm" aria-hidden="true"></i>
<span x-text="error"></span>
</div>
</template>
@@ -204,11 +216,11 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
<i class="ph-duotone ph-trash"></i>
</button>
</div>
<div x-show="field.type === 'select' || field.type === 'checkbox' || field.type === 'radio'" x-transition class="mt-3 border-l-2 border-primary/30 pl-3 sm:ml-2 sm:pl-4">
<div class="flex items-center gap-2 mb-2">
<span class="text-xs font-medium text-base-content/60 uppercase tracking-wide" x-text="getOptionsLabel(field.type)"></span>
<div x-show="field.type === 'select' || field.type === 'checkbox' || field.type === 'radio'" x-transition class="mt-4 rounded-box border-l-2 border-primary/50 bg-base-100 p-3 sm:ml-2 sm:p-4">
<div class="mb-3 flex items-center gap-2">
<span class="text-xs font-semibold uppercase tracking-wide text-base-content/60" x-text="getOptionsLabel(field.type)"></span>
<button type="button" @click="field.options.push({label: 'Option', value: 'option'})" class="btn btn-xs btn-ghost btn-primary">
<i class="ph-duotone ph-plus"></i>
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
Add
</button>
</div>
@@ -229,35 +241,39 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
</template>
</div>
<div class="mt-4">
<div class="border-t border-base-300 pt-4">
<button type="button" @click="addField()" class="btn btn-outline btn-sm btn-primary">
<i class="ph-duotone ph-plus"></i>
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
Add field
</button>
</div>
</div>
</div>
</section>
<div class="card mb-6 border border-base-300/60 bg-base-100 shadow-sm">
<div class="card-body">
<div class="flex items-center gap-2 mb-4">
<i class="ph-duotone ph-gear text-2xl text-primary" aria-hidden="true"></i>
<h3 class="card-title text-lg">Actions</h3>
</div>
<p class="text-sm text-base-content/60 mb-4">What should happen when a form is submitted?</p>
<section class="card border border-base-300 bg-base-100 shadow-sm" aria-labelledby="form-actions-title">
<div class="card-body gap-5 p-4 sm:p-6 lg:p-8">
<header class="flex items-start gap-3 border-b border-base-300 pb-4">
<span class="grid size-10 shrink-0 place-items-center rounded-xl bg-accent/15 text-base-content">
<i class="text-xl ph-duotone ph-gear" aria-hidden="true"></i>
</span>
<div>
<h3 class="card-title text-lg" id="form-actions-title">Actions</h3>
<p class="mt-1 text-sm text-base-content/60">Choose what should happen when someone submits this form.</p>
</div>
</header>
<input type="hidden" name="finishers" :value="JSON.stringify(finishers)">
<div x-show="finishers.length === 0" class="rounded-box border-2 border-dashed border-base-300 px-4 py-8 text-center">
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30"></i>
<p class="text-sm text-base-content/50 mt-2">No actions added yet</p>
<button type="button" @click="addFinisher()" class="btn btn-sm btn-primary mt-2">Add your first action</button>
<div x-show="finishers.length === 0" class="rounded-box border border-dashed border-base-300 bg-base-200/40 px-4 py-10 text-center">
<i class="ph-duotone ph-plus-circle text-4xl text-base-content/30" aria-hidden="true"></i>
<p class="mt-2 text-sm text-base-content/60">No actions added yet</p>
<button type="button" @click="addFinisher()" class="btn btn-primary btn-sm mt-3">Add your first action</button>
</div>
<div x-show="finishers.length > 0" class="space-y-2">
<div x-show="finishers.length > 0" class="space-y-4">
<template x-for="(finisher, index) in finishers">
<div class="p-3 border border-base-300 rounded-lg bg-base-200/50 space-y-3">
<div class="flex items-center gap-3">
<div class="space-y-4 rounded-box border border-base-300 bg-base-200/40 p-4 shadow-sm sm:p-5">
<div class="flex flex-col gap-3 sm:flex-row sm:items-center">
<span class="text-xs font-mono text-base-content/40">#[<span x-text="index + 1"></span>]</span>
<select :value="finisher.type" @change="setFinisherType(finisher, $event.target.value)" class="select select-bordered select-sm min-w-40 flex-1" :aria-label="'Action ' + (index + 1) + ' type'">
<template x-for="(definition, type) in finisherDefinitions" :key="type">
@@ -265,10 +281,10 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
</template>
</select>
<button @click="finishers.splice(index, 1)" type="button" class="btn btn-ghost btn-sm btn-circle text-error" title="Remove" :aria-label="'Remove action ' + (index + 1)">
<i class="ph-duotone ph-trash"></i>
<i class="ph-duotone ph-trash" aria-hidden="true"></i>
</button>
</div>
<div x-show="getFinisherSettings(finisher.type).length > 0" class="space-y-3 pl-8">
<div x-show="getFinisherSettings(finisher.type).length > 0" class="space-y-4 border-t border-base-300 pt-4 sm:pl-9">
<template x-for="setting in getFinisherSettings(finisher.type)" :key="setting.name">
<div class="form-control">
<label class="label" :for="'finisher-' + index + '-' + setting.name"><span class="label-text" x-text="setting.label"></span></label>
@@ -296,27 +312,27 @@ $isEditing = isset($form['id']) && $form['id'] > 0;
<span x-show="setting.help" class="label-text-alt text-base-content/60 mt-1" x-text="setting.help"></span>
</div>
</template>
<span x-show="getFinisherSettings(finisher.type).some(setting => setting.type === 'emailField') && fields.filter(field => field.type === 'email').length === 0" class="label-text-alt text-warning">Add an email field to the form before using this action.</span>
<span x-show="getFinisherSettings(finisher.type).some(setting => setting.type === 'emailField') && fields.filter(field => field.type === 'email').length === 0" class="alert alert-warning alert-soft text-sm" role="status">Add an email field to the form before using this action.</span>
</div>
</div>
</template>
</div>
<div class="mt-4">
<div class="border-t border-base-300 pt-4">
<button type="button" @click="addFinisher()" class="btn btn-outline btn-sm btn-primary">
<i class="ph-duotone ph-plus"></i>
<i class="ph-duotone ph-plus" aria-hidden="true"></i>
Add action
</button>
</div>
</div>
</div>
</section>
<div class="flex flex-col-reverse gap-2 sm:flex-row sm:justify-end">
<div class="flex flex-col-reverse gap-2 border-t border-base-300 pt-5 sm:flex-row sm:justify-end">
<a href="?tab=ext--form" class="btn btn-ghost btn-sm sm:min-w-28">
Cancel
</a>
<button type="submit" class="btn btn-primary btn-sm sm:min-w-28">
<i class="ph-duotone ph-floppy-disk"></i>
<i class="ph-duotone ph-floppy-disk" aria-hidden="true"></i>
Save
</button>
</div>