feat: adopt E&P corporate design in admin
This commit is contained in:
1 parent
55378b2bbc
commit
c660bd68de
36 files changed
+840
-518
No files matched your search
@@ -0,0 +1,35 @@
|
|||||||
|
import { Controller } from '@hotwired/stimulus'
|
||||||
|
|
||||||
|
/*
|
||||||
|
* The sidebar as a drawer on small screens: a modal <dialog> (target "dialog"), so focus stays inside
|
||||||
|
* and Escape closes it. A click on the dimmed page beside it closes it too, and so does widening the
|
||||||
|
* window until the sidebar shows (lg).
|
||||||
|
*/
|
||||||
|
export default class extends Controller {
|
||||||
|
static targets = ['dialog']
|
||||||
|
|
||||||
|
connect () {
|
||||||
|
this.wide = window.matchMedia('(min-width: 64rem)')
|
||||||
|
this.onWide = (event) => event.matches && this.close()
|
||||||
|
this.wide.addEventListener('change', this.onWide)
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnect () {
|
||||||
|
this.wide.removeEventListener('change', this.onWide)
|
||||||
|
}
|
||||||
|
|
||||||
|
open () {
|
||||||
|
this.dialogTarget.showModal()
|
||||||
|
}
|
||||||
|
|
||||||
|
close () {
|
||||||
|
this.dialogTarget.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
// a click on the dialog element itself, not on its content, is a click on the backdrop
|
||||||
|
closeOnBackdrop (event) {
|
||||||
|
if (event.target === this.dialogTarget) {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,89 @@
|
|||||||
|
import { Controller } from '@hotwired/stimulus'
|
||||||
|
|
||||||
|
/*
|
||||||
|
* A small menu behind a "⋯" button: the button (menu#toggle) opens the panel (target "panel") below
|
||||||
|
* itself. The panel is positioned fixed, so a scrolling container can't cut it off. Escape, a click
|
||||||
|
* outside or a click on one of its items closes it; arrow keys move between the items. Scrolling or
|
||||||
|
* resizing closes it too: a fixed panel would stay put while its row moves away (a table swiped
|
||||||
|
* sideways on a phone).
|
||||||
|
*/
|
||||||
|
export default class extends Controller {
|
||||||
|
static targets = ['button', 'panel']
|
||||||
|
|
||||||
|
connect () {
|
||||||
|
this.onOutside = (event) => {
|
||||||
|
if (!this.element.contains(event.target)) {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.onKey = (event) => this.key(event)
|
||||||
|
this.onScroll = (event) => {
|
||||||
|
if (!this.panelTarget.contains(event.target)) {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.onResize = () => this.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
disconnect () {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
toggle (event) {
|
||||||
|
event.stopPropagation()
|
||||||
|
this.panelTarget.hidden ? this.open() : this.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
open () {
|
||||||
|
const box = this.buttonTarget.getBoundingClientRect()
|
||||||
|
const panel = this.panelTarget
|
||||||
|
panel.hidden = false
|
||||||
|
// below the button, aligned to its right edge, and inside the window
|
||||||
|
const left = Math.max(8, Math.min(box.right - panel.offsetWidth, window.innerWidth - panel.offsetWidth - 8))
|
||||||
|
const below = box.bottom + 4 + panel.offsetHeight <= window.innerHeight
|
||||||
|
panel.style.left = `${left}px`
|
||||||
|
panel.style.top = `${below ? box.bottom + 4 : box.top - panel.offsetHeight - 4}px`
|
||||||
|
this.buttonTarget.setAttribute('aria-expanded', 'true')
|
||||||
|
document.addEventListener('click', this.onOutside, true)
|
||||||
|
document.addEventListener('keydown', this.onKey)
|
||||||
|
// capture: scroll events don't bubble, and the scrolling box may be any ancestor
|
||||||
|
document.addEventListener('scroll', this.onScroll, true)
|
||||||
|
window.addEventListener('resize', this.onResize)
|
||||||
|
this.items()[0]?.focus({ preventScroll: true })
|
||||||
|
}
|
||||||
|
|
||||||
|
close () {
|
||||||
|
if (this.panelTarget.hidden) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
this.panelTarget.hidden = true
|
||||||
|
this.buttonTarget.setAttribute('aria-expanded', 'false')
|
||||||
|
document.removeEventListener('click', this.onOutside, true)
|
||||||
|
document.removeEventListener('keydown', this.onKey)
|
||||||
|
document.removeEventListener('scroll', this.onScroll, true)
|
||||||
|
window.removeEventListener('resize', this.onResize)
|
||||||
|
}
|
||||||
|
|
||||||
|
// an item was chosen: it does its own work (htmx, link), the menu only closes
|
||||||
|
choose () {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
key (event) {
|
||||||
|
const items = this.items()
|
||||||
|
const index = items.indexOf(document.activeElement)
|
||||||
|
if (event.key === 'Escape') {
|
||||||
|
event.stopPropagation()
|
||||||
|
this.close()
|
||||||
|
this.buttonTarget.focus()
|
||||||
|
} else if (event.key === 'ArrowDown' || event.key === 'ArrowUp') {
|
||||||
|
event.preventDefault()
|
||||||
|
const next = (index + (event.key === 'ArrowDown' ? 1 : -1) + items.length) % items.length
|
||||||
|
items[next]?.focus()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
items () {
|
||||||
|
return [...this.panelTarget.querySelectorAll('a, button:not([disabled])')]
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { Controller } from '@hotwired/stimulus'
|
|
||||||
|
|
||||||
export default class extends Controller {
|
|
||||||
static outlets = [ 'mobilenav' ]
|
|
||||||
static classes = [ 'closed' ]
|
|
||||||
|
|
||||||
trigger({ params: { mode } }) {
|
|
||||||
this.mobilenavOutlet.toggle(mode)
|
|
||||||
}
|
|
||||||
|
|
||||||
toggle(mode) {
|
|
||||||
// Add animation classes only now to avoid fouc
|
|
||||||
this.element.classList.add('transition-transform', 'duration-300')
|
|
||||||
this.element.classList.toggle(this.closedClass, 'close' === mode)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
import { Controller } from '@hotwired/stimulus'
|
|
||||||
|
|
||||||
export default class extends Controller {
|
|
||||||
|
|
||||||
static classes = ['closed', 'iconClosed', 'iconExpanded']
|
|
||||||
static targets = ['submenu', 'button', 'icon']
|
|
||||||
static values = { expanded: Boolean }
|
|
||||||
|
|
||||||
toggleSubmenu() {
|
|
||||||
this.expandedValue = !this.expandedValue
|
|
||||||
}
|
|
||||||
|
|
||||||
expandedValueChanged(expanded) {
|
|
||||||
this.submenuTarget.classList.toggle(this.closedClass, false === expanded)
|
|
||||||
if (false === this.hasButtonTarget) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.buttonTarget.setAttribute('aria-expanded', expanded)
|
|
||||||
if (false === this.hasIconTarget) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
if (true === expanded) {
|
|
||||||
this.iconTarget.classList.add(...this.iconExpandedClasses)
|
|
||||||
this.iconTarget.classList.remove(...this.iconClosedClasses)
|
|
||||||
} else {
|
|
||||||
this.iconTarget.classList.add(...this.iconClosedClasses)
|
|
||||||
this.iconTarget.classList.remove(...this.iconExpandedClasses)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1 @@
|
|||||||
|
<svg clip-rule="evenodd" fill-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2" viewBox="0 0 500 153" xmlns="http://www.w3.org/2000/svg"><g fill="#0084d4"><path d="m332.922 85.597c4.527 0 7.819 3.292 7.819 7.819 0 4.115-2.675 6.79-5.762 7.613l6.791 11.934h-3.704l-6.379-11.523h-7.613v11.523h-3.292v-27.366zm-8.642 12.963h8.642c2.469 0 4.527-2.058 4.527-5.144 0-3.293-2.264-5.144-5.35-5.144h-7.819z" fill-rule="nonzero"/><path d="m374.28 85.597v2.88h-15.432v9.877h13.374v2.881h-13.374v9.053h15.843v2.675h-19.135v-27.366z" fill-rule="nonzero"/><path d="m389.095 85.597h3.292v27.366h-3.292z"/><path d="m406.79 111.317.823-2.675c1.029.411 4.733 1.852 8.436 1.852 4.527 0 6.791-1.852 6.791-4.527 0-3.498-3.498-4.321-6.996-5.35-4.321-1.234-8.848-2.675-8.848-8.024 0-4.939 3.704-7.408 9.259-7.408 3.292 0 6.79 1.029 8.642 1.852l-.823 2.675s-4.115-1.646-7.613-1.646c-3.704 0-6.173 1.852-6.173 4.527 0 3.292 3.704 4.321 6.996 5.349 4.321 1.235 8.848 2.675 8.848 8.025 0 5.144-4.116 7.407-9.671 7.407-4.321 0-8.025-1.234-9.671-2.057z" fill-rule="nonzero"/><path d="m458.848 85.597v2.88h-15.432v9.877h13.374v2.881h-13.374v9.053h15.843v2.675h-19.136v-27.366z" fill-rule="nonzero"/><path d="m476.955 85.597 8.642 12.963 5.967 9.259-.206-9.259v-12.963h3.292v27.366h-3.498l-8.642-13.375-5.761-9.053.206 9.259v13.169h-3.292v-27.366z" fill-rule="nonzero"/><path d="m339.712 123.663v2.88h-15.432v9.877h13.374v2.88h-13.374v9.054h15.843v2.881h-19.135v-27.572z" fill-rule="nonzero"/><path d="m352.263 123.663 8.231 23.251 8.23-23.251h3.498l-9.876 27.366h-3.704l-9.877-27.366z" fill-rule="nonzero"/><path d="m401.44 123.663v2.88h-15.432v9.877h13.375v2.88h-13.375v9.054h15.844v2.881h-19.136v-27.572z" fill-rule="nonzero"/><path d="m416.872 123.663 8.642 12.963 5.967 9.259-.205-9.259v-12.963h3.292v27.366h-3.498l-8.642-13.375-5.761-9.053.205 9.259v13.169h-3.292v-27.366z" fill-rule="nonzero"/><path d="m466.872 123.457v3.086h-9.259v24.486h-3.292v-24.692h-9.259v-2.88z" fill-rule="nonzero"/><path d="m475.309 149.177.823-2.675c1.028.412 4.732 1.852 8.436 1.852 4.527 0 6.79-1.852 6.79-4.527 0-3.498-3.498-4.321-6.996-5.35-4.321-1.234-8.848-2.675-8.848-8.024 0-4.939 3.704-7.408 9.26-7.408 3.292 0 6.79 1.029 8.642 1.852l-.823 2.675s-4.116-1.646-7.614-1.646c-3.703 0-6.172 1.852-6.172 4.527 0 3.292 3.703 4.321 6.995 5.349 4.321 1.235 8.848 2.675 8.848 8.025 0 5.144-4.115 7.408-9.671 7.408-4.115 0-8.024-1.235-9.67-2.058z" fill-rule="nonzero"/><path d="m367.695 1.852v10.905h-33.333v17.078h28.395v11.112h-28.395v15.637h33.951v10.906h-47.12v-65.638z" fill-rule="nonzero"/><path d="m418.93 16.255c0 5.556-3.292 11.729-10.7 16.255l11.317 13.169s2.264-4.115 2.264-9.465h9.876c-.206 10.082-4.938 17.901-4.938 17.901l12.14 13.992h-14.609l-4.938-5.761c-4.527 3.909-10.494 6.173-17.284 6.173-12.346 0-23.457-7.202-23.457-20.782 0-8.848 5.761-14.404 11.728-18.519-3.292-4.321-5.761-7.202-5.761-12.963 0-11.317 9.465-15.638 16.872-15.638 7.408 0 17.49 4.321 17.49 15.638zm-28.189 31.276c0 6.173 4.526 10.082 11.728 10.082 3.704 0 6.996-1.029 9.671-3.292l-14.403-16.667c-4.116 2.264-6.996 5.35-6.996 9.877zm5.967-30.659c0 3.293 2.057 5.144 4.321 7.614 3.704-1.646 6.378-4.527 6.378-7.819 0-3.91-2.674-5.35-5.349-5.35-3.498 0-5.35 2.263-5.35 5.555z" fill-rule="nonzero"/><path d="m479.424 1.852c11.111 0 20.164 9.259 20.164 20.988 0 12.551-9.053 21.399-19.958 21.399h-15.844v23.456h-13.169v-65.843zm-15.638 31.276h13.169c6.173 0 9.671-4.527 9.671-10.288 0-7.202-5.556-9.877-10.7-9.877h-12.14z" fill-rule="nonzero"/><path d="m220.165.617c-74.898 11.317-167.902 39.301-167.902 78.601 0 36.42 86.009 27.161 86.009 27.161s-137.86 45.884-137.86-14.404c0-68.312 173.868-91.358 219.753-91.358z" fill-rule="nonzero"/></g><path d="m34.979 151.235c74.898-11.112 167.902-39.301 167.902-78.601 0-36.42-86.009-27.161-86.009-27.161s137.861-45.885 137.861 14.404c0 68.518-173.869 91.358-219.754 91.358z" fill="#f8c62f" fill-rule="nonzero"/><path d="m124.897 70.576-26.337 8.231 25.103 1.646-.823-4.939z" fill="#0084d4" fill-rule="nonzero"/><path d="m156.173 72.428-18.93 5.967-7.202 19.959-3.498-23.251 8.231-22.017 3.498 16.256z" fill="#f8c62f" fill-rule="nonzero"/></svg>
|
||||||
|
After Width: | Height: | Size: 4.0 KiB |
@@ -0,0 +1,64 @@
|
|||||||
|
/* Admin-only additions to ep-design.css, built on its tokens */
|
||||||
|
@layer base {
|
||||||
|
.htmx-indicator {
|
||||||
|
@apply invisible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.htmx-request .htmx-indicator,
|
||||||
|
.htmx-request.htmx-indicator {
|
||||||
|
@apply visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* checked boxes and radios in the brand colour (@tailwindcss/forms fills them with currentColor) */
|
||||||
|
[type="checkbox"],
|
||||||
|
[type="radio"] {
|
||||||
|
@apply text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* thin scrollbars without a track for inner scrolling areas, as in app.css */
|
||||||
|
body * {
|
||||||
|
scrollbar-width: thin;
|
||||||
|
scrollbar-color: var(--color-line) transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@layer components {
|
||||||
|
.badge {
|
||||||
|
@apply inline-flex items-center px-1.5 py-0.5 text-xs font-bold whitespace-nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tippy-box {
|
||||||
|
@apply bg-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tippy-box[data-placement^='top'] > .tippy-arrow::before {
|
||||||
|
border-top-color: var(--color-brand);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tippy-box[data-placement^='bottom'] > .tippy-arrow::before {
|
||||||
|
border-bottom-color: var(--color-brand);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tippy-box[data-placement^='left'] > .tippy-arrow::before {
|
||||||
|
border-left-color: var(--color-brand);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tippy-box[data-placement^='right'] > .tippy-arrow::before {
|
||||||
|
border-right-color: var(--color-brand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* a list in a card, scrolling sideways when it is wider than the content column */
|
||||||
|
@layer components {
|
||||||
|
.data-table-wrapper {
|
||||||
|
@apply mb-8 overflow-x-auto border border-line bg-white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table-wrapper__inner {
|
||||||
|
@apply min-w-full align-middle;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table tbody tr {
|
||||||
|
@apply hover:bg-brand-light/50;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
@import "./components/autocomplete.css";
|
|
||||||
@import "./components/badge.css";
|
|
||||||
@import "./components/button.css";
|
|
||||||
@import "./components/datatable.css";
|
|
||||||
@import "./components/datepicker.css";
|
|
||||||
@import "./components/forms.css";
|
|
||||||
@import "./components/pagination.css";
|
|
||||||
@import "./components/toast.css";
|
|
||||||
@import "./components/tooltip.css";
|
|
||||||
@import "./components/typography.css";
|
|
||||||
+11
-3
@@ -1,4 +1,12 @@
|
|||||||
|
/* The admin in the E&P corporate design; shares nothing with app.css, so the frontend stays as it is */
|
||||||
@import "tailwindcss" source(none);
|
@import "tailwindcss" source(none);
|
||||||
@import "./_theme.css";
|
@import "toastify-js/src/toastify.css";
|
||||||
@import "./_base.css" layer(base);
|
@import "tippy.js/dist/tippy.css";
|
||||||
@import "./_components_admin.css" layer(components);
|
@import "./ep-design.css";
|
||||||
|
@import "./_admin.css";
|
||||||
|
|
||||||
|
@source "../../templates";
|
||||||
|
@source "../../src";
|
||||||
|
@source "../../assets";
|
||||||
|
|
||||||
|
@plugin "@tailwindcss/forms";
|
||||||
@@ -0,0 +1,316 @@
|
|||||||
|
/*
|
||||||
|
* E&P corporate design for the internal Symfony tools, taken from the E&P apps template (Gitea EP/apps,
|
||||||
|
* frontend/app/globals.css, frontend/components/): Lato, deep blue as the brand colour, magenta only
|
||||||
|
* for the one main action of a page, square shapes, light blue page.
|
||||||
|
* Status colours (green, red, amber) always come with text, never alone.
|
||||||
|
*
|
||||||
|
* Import after Tailwind: @import "tailwindcss"; @import "./ep-design.css"; @plugin "@tailwindcss/forms";
|
||||||
|
* The toast styles expect toastify-js (@import "toastify-js/src/toastify.css" before this file).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Lato (OFL) ships with the app, so browsers load nothing from Google: 400 (and italic), 700, 900. No 600:
|
||||||
|
* font-semibold renders as 700, like font-bold; font-black is 900. The weights are not remapped.
|
||||||
|
*/
|
||||||
|
@font-face {
|
||||||
|
font-family: "Lato";
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url("../fonts/lato-400.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Lato";
|
||||||
|
font-style: italic;
|
||||||
|
font-weight: 400;
|
||||||
|
font-display: swap;
|
||||||
|
src: url("../fonts/lato-400-italic.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Lato";
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 700;
|
||||||
|
font-display: swap;
|
||||||
|
src: url("../fonts/lato-700.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
@font-face {
|
||||||
|
font-family: "Lato";
|
||||||
|
font-style: normal;
|
||||||
|
font-weight: 900;
|
||||||
|
font-display: swap;
|
||||||
|
src: url("../fonts/lato-900.woff2") format("woff2");
|
||||||
|
}
|
||||||
|
|
||||||
|
@theme {
|
||||||
|
--font-sans: "Lato", ui-sans-serif, system-ui, sans-serif;
|
||||||
|
|
||||||
|
/* square everywhere; rounded-full stays round. Plain `rounded` reads --radius. */
|
||||||
|
--radius: 0px;
|
||||||
|
--radius-xs: 0px;
|
||||||
|
--radius-sm: 0px;
|
||||||
|
--radius-md: 0px;
|
||||||
|
--radius-lg: 0px;
|
||||||
|
--radius-xl: 0px;
|
||||||
|
--radius-2xl: 0px;
|
||||||
|
--radius-3xl: 0px;
|
||||||
|
--radius-4xl: 0px;
|
||||||
|
|
||||||
|
--color-brand: #18527b; /* E&P deep blue, 8.5:1 on white */
|
||||||
|
--color-brand-dark: #103c5b;
|
||||||
|
--color-brand-mid: #165883;
|
||||||
|
--color-brand-bright: #009fff; /* underlines and focus, never text */
|
||||||
|
--color-brand-light: #e3eef8;
|
||||||
|
|
||||||
|
--color-page: #ebf3fa; /* page background */
|
||||||
|
--color-line: #d8e3ed; /* borders */
|
||||||
|
--color-ink: #27272a; /* text */
|
||||||
|
--color-muted: #52525b; /* secondary text, 7.7:1 on white */
|
||||||
|
|
||||||
|
--color-accent: #c4097c; /* magenta of the main action */
|
||||||
|
--color-accent-from: #960167;
|
||||||
|
--color-accent-to: #fa1a8c;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Tailwind 3 defaults that Tailwind 4 changed: borders were a light gray instead of currentColor,
|
||||||
|
* and buttons had a pointer cursor.
|
||||||
|
*/
|
||||||
|
@layer base {
|
||||||
|
*,
|
||||||
|
::after,
|
||||||
|
::before,
|
||||||
|
::backdrop,
|
||||||
|
::file-selector-button {
|
||||||
|
border-color: var(--color-line, currentcolor);
|
||||||
|
}
|
||||||
|
|
||||||
|
button:not(:disabled),
|
||||||
|
[role="button"]:not(:disabled) {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* modals: centred (Preflight resets the browser's margin: auto), the page behind dimmed and blurred */
|
||||||
|
dialog:modal {
|
||||||
|
margin: auto;
|
||||||
|
max-height: 85vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
dialog::backdrop {
|
||||||
|
background: rgb(39 39 42 / 0.35);
|
||||||
|
backdrop-filter: blur(3px);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* visible keyboard focus everywhere (WCAG 2.4.7) */
|
||||||
|
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
|
||||||
|
outline: 3px solid var(--color-brand-bright);
|
||||||
|
outline-offset: 2px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Components as in the apps template (frontend/components/ui.ts, Field.tsx, Alert.tsx). Magenta
|
||||||
|
* only for the one main action of a page.
|
||||||
|
*/
|
||||||
|
@layer components {
|
||||||
|
.btn,
|
||||||
|
.btn-primary,
|
||||||
|
.btn-secondary {
|
||||||
|
@apply inline-flex items-center justify-center gap-2 px-4 py-2.5 text-xs font-bold uppercase tracking-wide no-underline transition-colors disabled:cursor-not-allowed;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary {
|
||||||
|
@apply text-white;
|
||||||
|
background-image: linear-gradient(120deg, var(--color-accent-from), #9e036a 40%, var(--color-accent-to));
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:hover {
|
||||||
|
background-image: linear-gradient(120deg, #7d0156, #8a035d 40%, #e3107c);
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-primary:disabled {
|
||||||
|
background-image: none;
|
||||||
|
background-color: #64748b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.btn-secondary {
|
||||||
|
@apply border border-brand bg-white text-brand hover:bg-brand hover:text-white;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* small actions in toolbars and on cards, next to the one main action */
|
||||||
|
.btn-tool {
|
||||||
|
@apply inline-flex items-center gap-1 rounded border border-line bg-white px-2 py-1 text-sm text-ink hover:border-brand hover:text-brand disabled:cursor-default disabled:border-line disabled:text-gray-400;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the "⋯" behind which the actions of a card or row wait (menu_controller.js); finger-sized on touch screens */
|
||||||
|
.btn-more {
|
||||||
|
@apply inline-flex h-6 w-6 pointer-coarse:h-10 pointer-coarse:w-10 shrink-0 items-center justify-center rounded text-muted hover:bg-page hover:text-brand aria-expanded:bg-page aria-expanded:text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-panel {
|
||||||
|
@apply fixed z-40 min-w-48 border border-line bg-white py-1 text-sm shadow-lg;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item {
|
||||||
|
@apply block w-full px-3 py-1.5 pointer-coarse:py-3 text-left text-ink no-underline hover:bg-page hover:text-brand focus:bg-page;
|
||||||
|
}
|
||||||
|
|
||||||
|
.menu-item-danger {
|
||||||
|
@apply block w-full px-3 py-1.5 pointer-coarse:py-3 text-left text-red-800 hover:bg-page hover:text-red-900 focus:bg-page;
|
||||||
|
}
|
||||||
|
|
||||||
|
.input {
|
||||||
|
@apply block w-full border border-slate-500 bg-white px-3 py-2 text-sm text-slate-900 placeholder:text-slate-500 focus:border-brand-bright aria-[invalid=true]:border-red-700 aria-[invalid=true]:ring-1 aria-[invalid=true]:ring-red-700 disabled:bg-slate-100 disabled:text-slate-600;
|
||||||
|
}
|
||||||
|
|
||||||
|
.field-label {
|
||||||
|
@apply block text-xs font-bold uppercase tracking-wide text-slate-700;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* white box on the light blue page */
|
||||||
|
.card {
|
||||||
|
@apply border border-line bg-white;
|
||||||
|
}
|
||||||
|
|
||||||
|
.section-title {
|
||||||
|
@apply text-base font-bold uppercase tracking-wide text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* a row of tabs; the base line is an inset shadow, so a row that scrolls sideways doesn't scroll vertically too */
|
||||||
|
.tabs {
|
||||||
|
@apply flex overflow-x-auto shadow-[inset_0_-1px_0_var(--color-line)];
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab {
|
||||||
|
@apply shrink-0 whitespace-nowrap border-b-4 border-transparent px-3 py-2 text-sm text-ink no-underline hover:text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.tab[aria-current],
|
||||||
|
.tab[aria-selected="true"] {
|
||||||
|
@apply border-brand-bright font-bold text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the main views as tabs in the header (_partials/_header.html.twig), for apps with few views */
|
||||||
|
.header-tab {
|
||||||
|
@apply flex items-center whitespace-nowrap border-b-4 border-transparent px-3 text-ink no-underline hover:text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.header-tab[aria-current] {
|
||||||
|
@apply border-brand-bright font-bold text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Sidebar navigation for apps with many views (_partials/_sidebar_menu.html.twig): on the light
|
||||||
|
* blue page, the current item is a white box.
|
||||||
|
*/
|
||||||
|
.sidebar-heading {
|
||||||
|
@apply px-2 pt-5 pb-1 text-[11px] font-bold uppercase tracking-wide text-muted;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-link {
|
||||||
|
@apply flex w-full items-center gap-x-3 p-2 text-left text-sm leading-6 font-bold text-ink no-underline hover:bg-white/60 hover:text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-sublink {
|
||||||
|
@apply block py-2 pr-2 pl-10 text-sm leading-6 text-ink no-underline hover:bg-white/60 hover:text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
:is(.sidebar-link, .sidebar-sublink)[aria-current],
|
||||||
|
.sidebar-link--ancestor {
|
||||||
|
@apply bg-white text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-group > summary {
|
||||||
|
@apply list-none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-group > summary::-webkit-details-marker {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* chevron of a group that opens in place */
|
||||||
|
.sidebar-group > summary::after {
|
||||||
|
@apply ml-auto size-2 shrink-0 rotate-45 border-r-2 border-b-2 border-current opacity-60 transition-transform content-[''];
|
||||||
|
}
|
||||||
|
|
||||||
|
.sidebar-group[open] > summary::after {
|
||||||
|
@apply -rotate-135;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the sidebar as a drawer from the left on small screens (drawer_controller.js) */
|
||||||
|
dialog.drawer {
|
||||||
|
@apply m-0 h-dvh max-h-none w-80 max-w-[calc(100vw-4rem)] bg-page p-0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* lists in a card: the outer cells line up with the card's padding */
|
||||||
|
.data-table {
|
||||||
|
@apply w-full;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table thead tr {
|
||||||
|
@apply border-b-2 border-brand text-left text-[11px] font-bold uppercase tracking-wide text-brand;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table th {
|
||||||
|
@apply px-2 py-2;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table td {
|
||||||
|
@apply px-2 py-1.5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table :is(th, td):first-child {
|
||||||
|
@apply pl-5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table :is(th, td):last-child {
|
||||||
|
@apply pr-5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.data-table tbody tr {
|
||||||
|
@apply border-b last:border-b-0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* notices (_partials/_alert.html.twig): light, with a coloured bar on the left */
|
||||||
|
.notice {
|
||||||
|
@apply border-l-4 px-4 py-2;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* toasts (toast_controller.js) in the colours of the notices */
|
||||||
|
.toastify {
|
||||||
|
@apply max-w-sm rounded-none border-l-4 bg-none px-4 py-3 text-sm shadow-lg;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toastify--success {
|
||||||
|
@apply border-emerald-700 bg-emerald-50 text-emerald-950;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toastify--error {
|
||||||
|
@apply border-red-700 bg-red-50 text-red-950;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toastify--warning {
|
||||||
|
@apply border-amber-600 bg-amber-50 text-amber-950;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toastify--info {
|
||||||
|
@apply border-brand bg-brand-light text-ink;
|
||||||
|
}
|
||||||
|
|
||||||
|
.toastify .toast-close {
|
||||||
|
@apply ml-3 text-current opacity-60 hover:opacity-100;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
*,
|
||||||
|
*::before,
|
||||||
|
*::after {
|
||||||
|
animation-duration: 0.01ms !important;
|
||||||
|
animation-iteration-count: 1 !important;
|
||||||
|
transition-duration: 0.01ms !important;
|
||||||
|
scroll-behavior: auto !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,3 +1,3 @@
|
|||||||
knp_menu:
|
knp_menu:
|
||||||
twig:
|
twig:
|
||||||
template: _partials/_menu.html.twig
|
template: admin/_partials/_sidebar_menu.html.twig
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{% if app.session.flashBag.peek('error')|length > 0 %}
|
{% if app.session.flashBag.peek('error')|length > 0 %}
|
||||||
{% include '_partials/_toast.html.twig' with { level: 'warning', messages: app.flashes('error') } %}
|
{% include '_partials/_toast.html.twig' with { level: 'error', messages: app.flashes('error') } %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if app.session.flashBag.peek('success')|length > 0 %}
|
{% if app.session.flashBag.peek('success')|length > 0 %}
|
||||||
{% include '_partials/_toast.html.twig' with { level: 'success', messages: app.flashes('success') } %}
|
{% include '_partials/_toast.html.twig' with { level: 'success', messages: app.flashes('success') } %}
|
||||||
|
|||||||
@@ -28,9 +28,10 @@
|
|||||||
name="q"
|
name="q"
|
||||||
value="{{ filter.q }}"
|
value="{{ filter.q }}"
|
||||||
placeholder="{{ form.q.vars.attr.placeholder|default('Suchen…') }}"
|
placeholder="{{ form.q.vars.attr.placeholder|default('Suchen…') }}"
|
||||||
class="block w-64 rounded-md border-0 py-1.5 pl-9 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-primary text-sm">
|
aria-label="Suchen"
|
||||||
|
class="input w-64 pl-9">
|
||||||
<div class="absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none">
|
<div class="absolute inset-y-0 left-0 flex items-center pl-2.5 pointer-events-none">
|
||||||
{{ icon('search', 'w-4 h-4 text-gray-500') }}
|
{{ icon('search', 'w-4 h-4 text-muted') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -39,13 +40,13 @@
|
|||||||
hx-get="{{ path(modal_route, app.request.query.all) }}"
|
hx-get="{{ path(modal_route, app.request.query.all) }}"
|
||||||
hx-target="body"
|
hx-target="body"
|
||||||
hx-swap="beforeend"
|
hx-swap="beforeend"
|
||||||
class="button button--secondary button--small inline-flex items-center gap-1.5">
|
class="btn-tool">
|
||||||
{{ icon('filter', 'w-4 h-4') }}
|
{{ icon('filter', 'w-4 h-4') }}
|
||||||
Filter{% if filter.activeCount > 0 %} ({{ filter.activeCount }}){% endif %}
|
Filter{% if filter.activeCount > 0 %} ({{ filter.activeCount }}){% endif %}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
{% if filter.isActive %}
|
{% if filter.isActive %}
|
||||||
<a href="{{ path(route) }}" class="text-sm text-gray-600 underline hover:text-gray-900">
|
<a href="{{ path(route) }}" class="text-sm text-brand underline hover:text-brand-dark">
|
||||||
zurücksetzen
|
zurücksetzen
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
@@ -54,11 +55,11 @@
|
|||||||
{% if chips|length > 0 %}
|
{% if chips|length > 0 %}
|
||||||
<div class="flex flex-wrap items-center gap-2 pt-3">
|
<div class="flex flex-wrap items-center gap-2 pt-3">
|
||||||
{% for chip in chips %}
|
{% for chip in chips %}
|
||||||
<span class="inline-flex items-center gap-1.5 rounded-full bg-gray-100 border border-gray-300 pl-3 {{ chip.isRemovable ? 'pr-1' : 'pr-3' }} py-1 text-xs text-gray-700">
|
<span class="inline-flex items-center gap-1.5 rounded-full bg-brand-light border border-line pl-3 {{ chip.isRemovable ? 'pr-1' : 'pr-3' }} py-1 text-xs text-ink">
|
||||||
<span><span class="font-bold">{{ chip.label }}:</span> {{ chip.value }}</span>
|
<span><span class="font-bold">{{ chip.label }}:</span> {{ chip.value }}</span>
|
||||||
{% if chip.isRemovable %}
|
{% if chip.isRemovable %}
|
||||||
<a href="{{ path(route, filter_query_without(chip.removeKeys)) }}"
|
<a href="{{ path(route, filter_query_without(chip.removeKeys)) }}"
|
||||||
class="inline-flex items-center justify-center w-4 h-4 rounded-full hover:bg-gray-300"
|
class="inline-flex items-center justify-center w-4 h-4 rounded-full hover:bg-white"
|
||||||
aria-label="Filter „{{ chip.label }}“ entfernen">
|
aria-label="Filter „{{ chip.label }}“ entfernen">
|
||||||
{{ icon('close', 'w-3 h-3') }}
|
{{ icon('close', 'w-3 h-3') }}
|
||||||
</a>
|
</a>
|
||||||
|
|||||||
@@ -1,83 +0,0 @@
|
|||||||
{% extends 'knp_menu.html.twig' %}
|
|
||||||
|
|
||||||
{% block list %}
|
|
||||||
{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
|
|
||||||
{% if item.level == 0 %}
|
|
||||||
<div class="min-h-full flex grow flex-col gap-y-5 lg:border-r border-gray-200 bg-white md:pr-6">
|
|
||||||
<nav class="flex flex-1 flex-col">
|
|
||||||
<ul role="list" class="space-y-1">
|
|
||||||
{{ block('children') }}
|
|
||||||
</ul>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
<ul class="{{ html_classes('mt-1 px-2', { 'hidden': not matcher.isCurrent(item) }) }}" {{ stimulus_target('sidebar-menu', 'submenu') }}>
|
|
||||||
{{ block('children') }}
|
|
||||||
</ul>
|
|
||||||
{% endif %}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block item %}
|
|
||||||
{% if item.displayed %}
|
|
||||||
<li>
|
|
||||||
{%- if item.hasChildren and item.displayChildren %}
|
|
||||||
<div {{ stimulus_controller('sidebar-menu', {'expanded': matcher.isAncestor(item)}, {'closed': 'hidden', 'iconClosed': 'text-gray-400', 'iconExpanded': 'text-gray-500'}) }}>
|
|
||||||
{%- endif %}
|
|
||||||
{%- if item.uri is not empty %}
|
|
||||||
{{ block('linkElement') }}
|
|
||||||
{%- else %}
|
|
||||||
{{ block('spanElement') }}
|
|
||||||
{%- endif %}
|
|
||||||
{{ block('list') }}
|
|
||||||
{%- if item.hasChildren and item.displayChildren %}
|
|
||||||
</div>
|
|
||||||
{%- endif %}
|
|
||||||
</li>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block linkElement %}
|
|
||||||
{% import _self as knp_menu %}
|
|
||||||
<a href="{{ item.uri }}"
|
|
||||||
class="{{ html_classes('', {
|
|
||||||
'group flex gap-x-3 rounded-md p-2 text-sm leading-6 font-semibold': item.level == 1,
|
|
||||||
'block rounded-md py-2 pr-2 pl-9 text-sm leading-6': item.level > 1,
|
|
||||||
'text-gray-700 hover:bg-gray-50': not (matcher.isCurrent(item) or matcher.isAncestor(item)),
|
|
||||||
'bg-gray-100 text-gray-900': matcher.isCurrent(item) or matcher.isAncestor(item),
|
|
||||||
}) }}"
|
|
||||||
{{ knp_menu.attributes(item.linkAttributes) }}>
|
|
||||||
{{ block('label') }}
|
|
||||||
</a>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block spanElement %}
|
|
||||||
{% import _self as knp_menu %}
|
|
||||||
{% if item.hasChildren %}
|
|
||||||
<button type="button"
|
|
||||||
{{ stimulus_action('sidebar-menu', 'toggleSubmenu') }}
|
|
||||||
{{ stimulus_target('sidebar-menu', 'button') }}
|
|
||||||
{{ knp_menu.attributes(item.linkAttributes) }}
|
|
||||||
class="{{ html_classes('hover:bg-gray-50 flex items-center w-full text-left rounded-md p-2 gap-x-3 text-sm leading-6 font-semibold text-gray-700', { 'bg-gray-50': matcher.isAncestor(item) }) }}"
|
|
||||||
aria-expanded="false">
|
|
||||||
{{ block('label') }}
|
|
||||||
</button>
|
|
||||||
{% elseif item.extras.divider is defined %}
|
|
||||||
<hr class="my-4 h-px bg-gray-200">
|
|
||||||
{% else %}
|
|
||||||
<div class="hover:bg-gray-50 group flex gap-x-3 rounded-md p-2 text-sm leading-5 font-semibold text-gray-700"
|
|
||||||
role="button">
|
|
||||||
{{ block('label') }}
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
{% block label %}
|
|
||||||
{% if item.extras.icon is defined %}
|
|
||||||
{{ icon(item.extras.icon, 'h-5 w-5 shrink-0 ' ~ ((matcher.isCurrent(item) or matcher.isAncestor(item)) ? 'text-gray-600' : 'text-gray-400')) }}
|
|
||||||
<span class="flex-1">{{ item.label|raw }}</span>
|
|
||||||
{% else %}
|
|
||||||
{{ item.label|raw }}
|
|
||||||
{% endif %}
|
|
||||||
{% endblock %}
|
|
||||||
|
|
||||||
@@ -1,12 +1,13 @@
|
|||||||
{% if pageCount > 0 %}
|
{% if pageCount > 0 %}
|
||||||
<div class="bg-gray-100 border border-gray-300 border-t-0 px-4 py-3 flex items-center justify-between sm:px-4">
|
<div class="border-t border-line px-5 py-3 flex items-center justify-between">
|
||||||
<div class="flex-1 flex items-center justify-between">
|
<div class="flex-1 flex items-center justify-between">
|
||||||
<div class="flex items-center space-x-4">
|
<div class="flex items-center space-x-4">
|
||||||
<div class="text-sm leading-5 text-gray-700">
|
<div class="text-sm leading-5 text-muted">
|
||||||
{{ 'paginator.info'|trans({ '{from}': firstItemNumber, '{to}': lastItemNumber, '{total}': totalCount })|raw }}
|
{{ 'paginator.info'|trans({ '{from}': firstItemNumber, '{to}': lastItemNumber, '{total}': totalCount })|raw }}
|
||||||
</div>
|
</div>
|
||||||
<select name="limit"
|
<select name="limit"
|
||||||
class="text-sm py-1 border-gray-300"
|
aria-label="Einträge pro Seite"
|
||||||
|
class="input w-auto py-1"
|
||||||
hx-get="{{ path(route, query|merge({(pageParameterName): 1})) }}"
|
hx-get="{{ path(route, query|merge({(pageParameterName): 1})) }}"
|
||||||
hx-replace-url="{{ path(route, query|merge({(pageParameterName): 1})) }}"
|
hx-replace-url="{{ path(route, query|merge({(pageParameterName): 1})) }}"
|
||||||
hx-target="body">
|
hx-target="body">
|
||||||
@@ -19,43 +20,43 @@
|
|||||||
<nav class="relative z-0 inline-flex">
|
<nav class="relative z-0 inline-flex">
|
||||||
{% if pageCount > 1 %}
|
{% if pageCount > 1 %}
|
||||||
{% if first is defined and current != first %}
|
{% if first is defined and current != first %}
|
||||||
<a href="{{ path(route, query|merge({(pageParameterName): first})) }}" class="relative inline-flex items-center px-2 py-2 border border-gray-300 bg-white text-sm leading-5 font-medium hover:bg-secondary hover:text-white">
|
<a href="{{ path(route, query|merge({(pageParameterName): first})) }}" class="relative inline-flex items-center px-2 py-2 border border-line bg-white text-sm leading-5 text-brand hover:bg-brand hover:text-white">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="m18.75 4.5-7.5 7.5 7.5 7.5m-6-15L5.25 12l7.5 7.5" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if previous is defined %}
|
{% if previous is defined %}
|
||||||
<a href="{{ path(route, query|merge({(pageParameterName): previous})) }}" class="-ml-px relative inline-flex items-center px-2 py-2 border border-gray-300 bg-white text-sm leading-5 font-medium hover:bg-secondary hover:text-white" aria-label="Previous">
|
<a href="{{ path(route, query|merge({(pageParameterName): previous})) }}" class="-ml-px relative inline-flex items-center px-2 py-2 border border-line bg-white text-sm leading-5 text-brand hover:bg-brand hover:text-white" aria-label="Vorherige Seite">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="M15.75 19.5 8.25 12l7.5-7.5" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if current > 3 %}
|
{% if current > 3 %}
|
||||||
<span class="-ml-px relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm leading-5 font-medium text-gray-700">
|
<span class="-ml-px relative inline-flex items-center px-4 py-2 border border-line bg-white text-sm leading-5 text-muted">
|
||||||
...
|
...
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% for page in pagesInRange %}
|
{% for page in pagesInRange %}
|
||||||
<a href="{{ path(route, query|merge({(pageParameterName): page})) }}" class="-ml-px relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm leading-5 font-medium focus:z-10 hover:bg-secondary {% if page == current %}bg-primary text-white hover:text-white{% else %}bg-white text-gray-700 hover:text-white{% endif %}">
|
<a href="{{ path(route, query|merge({(pageParameterName): page})) }}" class="-ml-px relative inline-flex items-center px-4 py-2 border text-sm leading-5 focus:z-10 {% if page == current %}border-brand bg-brand font-bold text-white{% else %}border-line bg-white text-brand hover:bg-brand hover:text-white{% endif %}"{% if page == current %} aria-current="page"{% endif %}>
|
||||||
{{ page }}
|
{{ page }}
|
||||||
</a>
|
</a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% if current < pageCount - 3 %}
|
{% if current < pageCount - 3 %}
|
||||||
<span class="-ml-px relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm leading-5 font-medium text-gray-700">
|
<span class="-ml-px relative inline-flex items-center px-4 py-2 border border-line bg-white text-sm leading-5 text-muted">
|
||||||
...
|
...
|
||||||
</span>
|
</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if next is defined %}
|
{% if next is defined %}
|
||||||
<a href="{{ path(route, query|merge({(pageParameterName): next})) }}" class="-ml-px relative inline-flex items-center px-2 py-2 border border-gray-300 bg-white text-sm leading-5 font-medium hover:bg-secondary hover:text-white" aria-label="Next">
|
<a href="{{ path(route, query|merge({(pageParameterName): next})) }}" class="-ml-px relative inline-flex items-center px-2 py-2 border border-line bg-white text-sm leading-5 text-brand hover:bg-brand hover:text-white" aria-label="Nächste Seite">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="m8.25 4.5 7.5 7.5-7.5 7.5" />
|
||||||
</svg>
|
</svg>
|
||||||
</a>
|
</a>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% if last is defined and current != last %}
|
{% if last is defined and current != last %}
|
||||||
<a href="{{ path(route, query|merge({(pageParameterName): last})) }}" class="-ml-px relative inline-flex items-center px-2 py-2 border border-gray-300 bg-white text-sm leading-5 font-medium hover:bg-secondary hover:text-white">
|
<a href="{{ path(route, query|merge({(pageParameterName): last})) }}" class="-ml-px relative inline-flex items-center px-2 py-2 border border-line bg-white text-sm leading-5 text-brand hover:bg-brand hover:text-white">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-5 h-5">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" d="m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5" />
|
<path stroke-linecap="round" stroke-linejoin="round" d="m5.25 4.5 7.5 7.5-7.5 7.5m6-15 7.5 7.5-7.5 7.5" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@@ -34,10 +34,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex justify-between items-center pt-8">
|
<div class="flex justify-between items-center pt-8">
|
||||||
<a href="{{ path(route) }}" class="text-sm text-gray-600 underline hover:text-gray-900">
|
<a href="{{ path(route) }}" class="text-sm text-brand underline hover:text-brand-dark">
|
||||||
auf Standard zurücksetzen
|
auf Standard zurücksetzen
|
||||||
</a>
|
</a>
|
||||||
<button type="submit" class="button button--primary button--small">
|
<button type="submit" class="btn-primary">
|
||||||
anwenden
|
anwenden
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{#
|
||||||
|
A notice in the style of the apps template's Alert.tsx: `type` is success, error, warning or
|
||||||
|
info, `message` the text. Errors are announced at once (role="alert"), the others politely.
|
||||||
|
#}
|
||||||
|
{% set styles = {
|
||||||
|
success: ['border-emerald-700 bg-emerald-50 text-emerald-950', 'Erledigt'],
|
||||||
|
error: ['border-red-700 bg-red-50 text-red-950', 'Fehler'],
|
||||||
|
warning: ['border-amber-600 bg-amber-50 text-amber-950', 'Achtung'],
|
||||||
|
info: ['border-brand bg-brand-light text-ink', 'Hinweis'],
|
||||||
|
} %}
|
||||||
|
{% set style = styles[type ?? 'info'] %}
|
||||||
|
<div role="{{ type == 'error' ? 'alert' : 'status' }}" class="notice {{ style[0] }}"><span class="sr-only">{{ style[1] }}: </span>{{ message }}</div>
|
||||||
@@ -0,0 +1,23 @@
|
|||||||
|
{#
|
||||||
|
E&P header as in the apps template: logo, app name behind a thin line, a deep blue bar below.
|
||||||
|
Embed it and fill its blocks:
|
||||||
|
- `header_nav`: the main views as `.header-tab` links, for apps with few views (layout_tabs)
|
||||||
|
- `header_end`: season, user menu, help link and, in the sidebar layout, the menu button
|
||||||
|
`app_name` and `home_path` come from the embedding template; `header_width` lines the header up with
|
||||||
|
a centred content column (layout_sidebar), without it the header runs full width (layout_tabs).
|
||||||
|
#}
|
||||||
|
<header class="shrink-0 print:hidden">
|
||||||
|
<div class="border-b border-line bg-white">
|
||||||
|
<div class="flex items-stretch gap-x-6 text-sm {{ header_width ?? 'px-4' }}">
|
||||||
|
<a href="{{ home_path }}" class="flex shrink-0 items-center gap-3 py-2">
|
||||||
|
<img src="{{ asset('build/images/ep-logo.svg') }}" alt="E&P Reisen & Events" width="157" height="48" class="h-9 w-auto">
|
||||||
|
<span class="pl-3 border-l border-line font-black uppercase tracking-wide text-brand">{{ app_name }}</span>
|
||||||
|
</a>
|
||||||
|
{% block header_nav %}{% endblock %}
|
||||||
|
<div class="ml-auto flex items-stretch gap-x-4">
|
||||||
|
{% block header_end %}{% endblock %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="h-2 bg-brand" aria-hidden="true"></div>
|
||||||
|
</header>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
{#
|
||||||
|
KnpMenu template for the admin sidebar (layout_admin.html.twig). Items of the first level:
|
||||||
|
- a link (`.sidebar-link`); with children, they show below it while it or a child is current
|
||||||
|
- without a URI but with children: a group that opens in place (<details>), open while a child is current
|
||||||
|
- extras `heading` (a group heading) or `divider` (a line)
|
||||||
|
- extras `icon`: rendered with _partials/_icon.html.twig (`icon`, `class`), as myep's icon() does
|
||||||
|
#}
|
||||||
|
{% extends 'knp_menu.html.twig' %}
|
||||||
|
|
||||||
|
{% block list %}
|
||||||
|
{% if item.hasChildren and options.depth is not same as(0) and item.displayChildren %}
|
||||||
|
{% if item.level == 0 %}
|
||||||
|
<ul class="space-y-1">
|
||||||
|
{{ block('children') }}
|
||||||
|
</ul>
|
||||||
|
{% elseif item.uri is empty or matcher.isCurrent(item) or matcher.isAncestor(item) %}
|
||||||
|
<ul class="mt-1 space-y-1">
|
||||||
|
{{ block('children') }}
|
||||||
|
</ul>
|
||||||
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block item %}
|
||||||
|
{% if item.displayed and item.extras.heading is defined %}
|
||||||
|
<li class="sidebar-heading">{{ item.label }}</li>
|
||||||
|
{% elseif item.displayed and item.extras.divider is defined %}
|
||||||
|
<li><hr class="my-4 border-line"></li>
|
||||||
|
{% elseif item.displayed %}
|
||||||
|
<li>
|
||||||
|
{% if item.uri is empty and item.hasChildren and item.displayChildren %}
|
||||||
|
<details class="sidebar-group" {{ matcher.isAncestor(item) ? 'open' }}>
|
||||||
|
<summary class="sidebar-link {{ matcher.isAncestor(item) ? 'text-brand' }}">{{ block('label') }}</summary>
|
||||||
|
{{ block('list') }}
|
||||||
|
</details>
|
||||||
|
{% else %}
|
||||||
|
{{ block('linkElement') }}
|
||||||
|
{{ block('list') }}
|
||||||
|
{% endif %}
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block linkElement %}
|
||||||
|
{% import _self as knp_menu %}
|
||||||
|
{% set is_current = matcher.isCurrent(item) %}
|
||||||
|
<a href="{{ item.uri }}"
|
||||||
|
class="{{ item.level == 1 ? 'sidebar-link' : 'sidebar-sublink' }} {{ not is_current and item.level == 1 and matcher.isAncestor(item) ? 'sidebar-link--ancestor' }}"
|
||||||
|
{% if is_current %}aria-current="page"{% endif %}
|
||||||
|
{{ knp_menu.attributes(item.linkAttributes) }}>{{ block('label') }}</a>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block label -%}
|
||||||
|
{% if item.extras.icon is defined -%}
|
||||||
|
{{ include('_partials/_icon.html.twig', {
|
||||||
|
icon: item.extras.icon,
|
||||||
|
class: 'size-5 shrink-0 ' ~ (matcher.isCurrent(item) or matcher.isAncestor(item) ? 'text-brand' : 'text-muted'),
|
||||||
|
}) }}
|
||||||
|
<span class="flex-1">{{ item.label }}</span>
|
||||||
|
{%- else -%}
|
||||||
|
{{ item.label }}
|
||||||
|
{%- endif %}
|
||||||
|
{%- endblock %}
|
||||||
@@ -4,7 +4,8 @@
|
|||||||
<meta charset="UTF-8">
|
<meta charset="UTF-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta name="robots" content="noindex,nofollow">
|
<meta name="robots" content="noindex,nofollow">
|
||||||
<title>{% block title %}MyE&P{% endblock %}</title>
|
<meta name="color-scheme" content="light">
|
||||||
|
<title>{% block title %}MyE&P Admin{% endblock %}</title>
|
||||||
<link rel="icon" href="{{ asset('build/favicon/favicon.ico') }}" sizes="32x32">
|
<link rel="icon" href="{{ asset('build/favicon/favicon.ico') }}" sizes="32x32">
|
||||||
<link rel="icon" href="{{ asset('build/favicon/icon.svg') }}" type="image/svg+xml">
|
<link rel="icon" href="{{ asset('build/favicon/icon.svg') }}" type="image/svg+xml">
|
||||||
<link rel="apple-touch-icon" href="{{ asset('build/favicon/apple-touch-icon.png') }}">
|
<link rel="apple-touch-icon" href="{{ asset('build/favicon/apple-touch-icon.png') }}">
|
||||||
@@ -15,8 +16,12 @@
|
|||||||
{{ encore_entry_script_tags('admin') }}
|
{{ encore_entry_script_tags('admin') }}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-white text-gray-700 font-sans antialiased {{ booking_theme() }}">
|
<body class="bg-page text-ink font-sans antialiased">
|
||||||
|
<a href="#content"
|
||||||
|
class="sr-only focus:not-sr-only focus:absolute focus:left-2 focus:top-2 focus:z-50 focus:bg-white focus:px-3 focus:py-2 focus:font-bold focus:text-brand focus:shadow">Zum Inhalt springen</a>
|
||||||
{% block body %}{% endblock %}
|
{% block body %}{% endblock %}
|
||||||
{% block data_layer %}{% endblock %}
|
{# shows the toasts of htmx responses (HX-Trigger: showNotifications) #}
|
||||||
|
<div {{ stimulus_controller('toast') }}></div>
|
||||||
|
{% include '_partials/_flashes_admin.html.twig' %}
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
{% set variant = variant ?? 'primary' %}
|
{% set variant = variant ?? 'primary' %}
|
||||||
{% set cva = html_cva('badge', {
|
{% set cva = html_cva('badge', {
|
||||||
variant: {
|
variant: {
|
||||||
primary: 'bg-primary text-white',
|
primary: 'bg-brand-light text-brand',
|
||||||
success: 'bg-green-500 text-white',
|
success: 'bg-emerald-50 text-emerald-950',
|
||||||
warning: 'bg-red-500 text-white',
|
warning: 'bg-amber-100 text-amber-950',
|
||||||
}
|
}
|
||||||
}, [], { variant: 'primary' }) %}
|
}, [], { variant: 'primary' }) %}
|
||||||
<span {{ attributes.defaults({class: cva.apply({variant: variant})}).without('variant') }}>
|
<span {{ attributes.defaults({class: cva.apply({variant: variant})}).without('variant') }}>
|
||||||
|
|||||||
@@ -1,9 +1,15 @@
|
|||||||
{% set weekdays = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'] %}
|
{% set weekdays = ['Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa', 'So'] %}
|
||||||
<div class="space-y-4 mb-4">
|
{% set rows = [
|
||||||
|
{label: 'Preis', key: 'hasPrice', color: 'bg-brand-mid', legend: 'Preiskonfigurationen'},
|
||||||
|
{label: 'Verpfl.', key: 'hasBoard', color: 'bg-emerald-600', legend: 'Verpflegungsleistungen'},
|
||||||
|
{label: 'Zusatzl.', key: 'hasAdditional', color: 'bg-amber-500', legend: 'optionale Zusatzleistungen'},
|
||||||
|
{label: 'n. v.', key: 'isBlocked', color: 'bg-red-700', legend: 'nicht verfügbar'},
|
||||||
|
] %}
|
||||||
|
<div class="divide-y divide-line">
|
||||||
{% for month in months %}
|
{% for month in months %}
|
||||||
{% set totalCols = month.firstDow + (month.days | length) %}
|
{% set totalCols = month.firstDow + (month.days | length) %}
|
||||||
<div>
|
<div class="px-5 py-4">
|
||||||
<div class="text-sm font-semibold mb-1">{{ month.label }}</div>
|
<h3 class="mb-2 text-xs font-bold uppercase tracking-wide text-brand">{{ month.label }}</h3>
|
||||||
<div class="overflow-x-auto">
|
<div class="overflow-x-auto">
|
||||||
<div class="w-max">
|
<div class="w-max">
|
||||||
<div class="flex">
|
<div class="flex">
|
||||||
@@ -11,11 +17,11 @@
|
|||||||
{% for col in 0..(totalCols - 1) %}
|
{% for col in 0..(totalCols - 1) %}
|
||||||
{% set dow = col % 7 %}
|
{% set dow = col % 7 %}
|
||||||
<div class="w-6 text-center">
|
<div class="w-6 text-center">
|
||||||
<span class="block text-xs leading-none {{ dow >= 5 ? 'text-red-400' : 'text-gray-300' }}">{{ weekdays[dow] }}</span>
|
<span class="block text-[10px] leading-4 {{ dow >= 5 ? 'font-bold text-red-700' : 'text-muted' }}">{{ weekdays[dow] }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex mb-0.5">
|
<div class="mb-1 flex">
|
||||||
<div class="w-20 shrink-0"></div>
|
<div class="w-20 shrink-0"></div>
|
||||||
{% if month.firstDow > 0 %}
|
{% if month.firstDow > 0 %}
|
||||||
{% for i in 1..month.firstDow %}
|
{% for i in 1..month.firstDow %}
|
||||||
@@ -24,20 +30,16 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% for dayNum, day in month.days %}
|
{% for dayNum, day in month.days %}
|
||||||
<div class="w-6 text-center">
|
<div class="w-6 text-center">
|
||||||
<span class="{{ html_classes('block text-xs leading-none cursor-default', {'font-bold text-secondary': day.isToday, 'text-gray-500': not day.isToday}) }}"
|
<span class="{{ html_classes('mx-auto block w-5 cursor-default text-xs leading-5', {'bg-brand font-bold text-white': day.isToday, 'text-ink': not day.isToday}) }}"
|
||||||
|
{% if day.isToday %}title="heute"{% endif %}
|
||||||
{% if day.tooltip %}{{ stimulus_controller('tooltip', {'content': day.tooltip}) }}{% endif %}
|
{% if day.tooltip %}{{ stimulus_controller('tooltip', {'content': day.tooltip}) }}{% endif %}
|
||||||
>{{ dayNum }}</span>
|
>{{ dayNum }}</span>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
{% for row in [
|
{% for row in rows %}
|
||||||
{label: 'Preis', key: 'hasPrice', color: 'bg-blue-500'},
|
<div class="mt-0.5 flex items-center">
|
||||||
{label: 'Verpfl.', key: 'hasBoard', color: 'bg-green-500'},
|
<div class="w-20 shrink-0 text-xs text-muted">{{ row.label }}</div>
|
||||||
{label: 'Zusatzl.', key: 'hasAdditional', color: 'bg-amber-500'},
|
|
||||||
{label: 'n. v.', key: 'isBlocked', color: 'bg-red-500'},
|
|
||||||
] %}
|
|
||||||
<div class="flex items-center mt-0.5">
|
|
||||||
<div class="w-20 shrink-0 text-xs text-gray-500">{{ row.label }}</div>
|
|
||||||
{% if month.firstDow > 0 %}
|
{% if month.firstDow > 0 %}
|
||||||
{% for i in 1..month.firstDow %}
|
{% for i in 1..month.firstDow %}
|
||||||
<div class="w-6 px-px"><div class="h-3"></div></div>
|
<div class="w-6 px-px"><div class="h-3"></div></div>
|
||||||
@@ -45,7 +47,7 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
{% for dayNum, day in month.days %}
|
{% for dayNum, day in month.days %}
|
||||||
<div class="w-6 px-px">
|
<div class="w-6 px-px">
|
||||||
<div class="h-3 {{ attribute(day, row.key) ? row.color : 'bg-gray-100' }}"></div>
|
<div class="h-3 {{ attribute(day, row.key) ? row.color : 'bg-page' }}"></div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -55,17 +57,10 @@
|
|||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex flex-wrap gap-x-6 gap-y-2 mb-4 text-sm text-gray-600">
|
<div class="flex flex-wrap gap-x-6 gap-y-2 border-t border-line px-5 py-3 text-xs text-muted">
|
||||||
|
{% for row in rows %}
|
||||||
<div class="flex items-center gap-1.5">
|
<div class="flex items-center gap-1.5">
|
||||||
<span class="inline-block w-4 h-3 bg-blue-500"></span> Preiskonfigurationen
|
<span class="inline-block h-3 w-4 {{ row.color }}" aria-hidden="true"></span> {{ row.legend }}
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-1.5">
|
|
||||||
<span class="inline-block w-4 h-3 bg-green-500"></span> Verpflegungsleistungen
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-1.5">
|
|
||||||
<span class="inline-block w-4 h-3 bg-amber-500"></span> optionale Zusatzleistungen
|
|
||||||
</div>
|
|
||||||
<div class="flex items-center gap-1.5">
|
|
||||||
<span class="inline-block w-4 h-3 bg-red-500"></span> nicht verfügbar
|
|
||||||
</div>
|
</div>
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
@@ -1,13 +1,17 @@
|
|||||||
<div id="calendar-wrapper">
|
{#- The card is the swap target, so the month navigation replaces the whole calendar -#}
|
||||||
<twig:calendar:grid :months="months"/>
|
<section id="calendar-wrapper" class="card" aria-labelledby="calendar-title">
|
||||||
<div class="flex items-center justify-between mt-4">
|
<div class="flex flex-wrap items-center justify-between gap-4 border-b border-line px-5 py-3">
|
||||||
<button class="button button--secondary button--small"
|
<h2 id="calendar-title" class="section-title">Kalender</h2>
|
||||||
|
<div class="flex gap-2">
|
||||||
|
<button type="button"
|
||||||
|
class="btn-tool"
|
||||||
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: prevMonth}) }}"
|
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: prevMonth}) }}"
|
||||||
hx-target="#calendar-wrapper"
|
hx-target="#calendar-wrapper"
|
||||||
hx-swap="outerHTML">
|
hx-swap="outerHTML">
|
||||||
← {{ prevLabel }}
|
← {{ prevLabel }}
|
||||||
</button>
|
</button>
|
||||||
<button class="button button--secondary button--small"
|
<button type="button"
|
||||||
|
class="btn-tool"
|
||||||
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: nextMonth}) }}"
|
hx-get="{{ path('app_admin_accommodation_calendar', {id: accommodation.id, month: nextMonth}) }}"
|
||||||
hx-target="#calendar-wrapper"
|
hx-target="#calendar-wrapper"
|
||||||
hx-swap="outerHTML">
|
hx-swap="outerHTML">
|
||||||
@@ -15,3 +19,5 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<twig:calendar:grid :months="months"/>
|
||||||
|
</section>
|
||||||
@@ -1,15 +1,15 @@
|
|||||||
{% set emptyText = emptyText ?? 'Keine Einträge vorhanden.' %}
|
{% set emptyText = emptyText ?? 'Keine Einträge vorhanden.' %}
|
||||||
{% set entries %}{% block content %}{% endblock %}{% endset %}
|
{% set entries %}{% block content %}{% endblock %}{% endset %}
|
||||||
<div {{ attributes.defaults({class: 'bg-gray-100 border border-gray-200 rounded-md px-4 py-2'}).without('title', 'emptyText') }}>
|
<div {{ attributes.defaults({class: 'card px-5 py-4'}).without('title', 'emptyText') }}>
|
||||||
<h2 class="flex justify-between pb-2">
|
<div class="flex justify-between pb-3">
|
||||||
<span class="font-bold text-lg">{{ title }}</span>
|
<h2 class="section-title">{{ title }}</h2>
|
||||||
{% block actions %}{% endblock %}
|
{% block actions %}{% endblock %}
|
||||||
</h2>
|
</div>
|
||||||
{% if entries|trim is empty %}
|
{% if entries|trim is empty %}
|
||||||
{% block empty %}
|
{% block empty %}
|
||||||
<p class="py-2 text-sm text-gray-500">{{ emptyText }}</p>
|
<p class="py-2 text-sm text-muted">{{ emptyText }}</p>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% else %}
|
{% else %}
|
||||||
<ul class="divide-y divide-gray-200">{{ entries }}</ul>
|
<ul class="divide-y divide-line">{{ entries }}</ul>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
@@ -1,12 +1,9 @@
|
|||||||
{% set warning = warning ?? false %}
|
{% set warning = warning ?? false %}
|
||||||
{% set method = method ?? 'get' %}
|
{% set method = method ?? 'get' %}
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="{{ html_classes('block px-4 py-2 text-sm w-full text-left', {
|
class="{{ warning ? 'menu-item-danger' : 'menu-item' }}"
|
||||||
'text-red-500 hover:text-primary': warning,
|
|
||||||
'text-gray-700 hover:text-primary': not warning
|
|
||||||
}) }}"
|
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
tabindex="-1"
|
{{ stimulus_action('menu', 'choose') }}
|
||||||
{{ attributes
|
{{ attributes
|
||||||
.defaults({
|
.defaults({
|
||||||
'hx-target': 'body',
|
'hx-target': 'body',
|
||||||
|
|||||||
@@ -1,20 +1,15 @@
|
|||||||
<div class="relative inline-block text-left group cursor-pointer">
|
{#- The "⋯" menu of a row or card (menu_controller.js); fill it with dropdown:link and dropdown:hxbutton -#}
|
||||||
|
<div class="relative inline-block text-left" {{ stimulus_controller('menu') }}>
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="flex items-center text-gray-400 hover:text-gray-600 focus:outline-hidden focus:ring-0"
|
class="btn-more"
|
||||||
aria-expanded="true"
|
aria-haspopup="menu"
|
||||||
aria-haspopup="true">
|
aria-expanded="false"
|
||||||
<span class="sr-only">Funktionen</span>
|
aria-label="Funktionen"
|
||||||
{{ icon('dots', 'w-6 h-6') }}
|
{{ stimulus_target('menu', 'button') }}
|
||||||
|
{{ stimulus_action('menu', 'toggle') }}>
|
||||||
|
{{ icon('dots', 'size-5') }}
|
||||||
</button>
|
</button>
|
||||||
<div class="hidden group-hover:block absolute right-0 top-0 z-10 w-56 origin-top-right pt-4"
|
<div class="menu-panel" role="menu" hidden {{ stimulus_target('menu', 'panel') }}>
|
||||||
role="menu"
|
|
||||||
aria-orientation="vertical"
|
|
||||||
aria-labelledby="menu-button"
|
|
||||||
tabindex="-1">
|
|
||||||
<div class="rounded-md bg-white shadow-lg ring-1 ring-black/5 focus:outline-hidden">
|
|
||||||
<div class="py-1 menu menu--pulldown" role="none">
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,10 +1,7 @@
|
|||||||
{% set warning = warning ?? false %}
|
{% set warning = warning ?? false %}
|
||||||
<a href="{{ url }}"
|
<a href="{{ url }}"
|
||||||
class="{{ html_classes('block px-4 py-2 text-sm w-full', {
|
class="{{ warning ? 'menu-item-danger' : 'menu-item' }}"
|
||||||
'text-red-500 hover:text-primary': warning,
|
|
||||||
'text-gray-700 hover:text-primary': not warning
|
|
||||||
}) }}"
|
|
||||||
role="menuitem"
|
role="menuitem"
|
||||||
tabindex="-1">
|
{{ stimulus_action('menu', 'choose') }}>
|
||||||
{{ block('content') }}
|
{{ block('content') }}
|
||||||
</a>
|
</a>
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
{#- A titled panel grouping the fields of a long admin form. No overflow-hidden: the dots
|
{#- A titled card grouping the fields of a long admin form. No overflow-hidden: the "⋯" menus
|
||||||
dropdowns inside must be able to open past its edge. -#}
|
inside must be able to open past its edge. -#}
|
||||||
<div {{ attributes.defaults({class: 'bg-white border border-gray-200 rounded-md'}).without('title') }}>
|
<div {{ attributes.defaults({class: 'card'}).without('title') }}>
|
||||||
<div class="flex items-center justify-between gap-4 px-4 py-2 bg-gray-100 border-b border-gray-200 rounded-t-md font-bold">
|
<div class="flex items-center justify-between gap-4 border-b border-line px-5 py-3">
|
||||||
{{ title }}
|
<h2 class="section-title">{{ title }}</h2>
|
||||||
{% block actions %}{% endblock %}
|
{% block actions %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
<div class="p-4">
|
<div class="p-5">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -1 +1 @@
|
|||||||
<h1 class="text-2xl font-bold pb-8">{{ block('content') }}</h1>
|
<h1 class="pb-6 text-2xl font-bold text-brand">{{ block('content') }}</h1>
|
||||||
+75
-218
@@ -1,236 +1,93 @@
|
|||||||
{% use 'form_div_layout.html.twig' %}
|
{#
|
||||||
|
Form theme in the look of the apps template's Field.tsx: a real label, the hint and the error
|
||||||
|
below the input, which gets aria-invalid and aria-describedby.
|
||||||
|
#}
|
||||||
|
{% extends 'form_div_layout.html.twig' %}
|
||||||
|
|
||||||
{%- block form_row -%}
|
{% block form_row %}
|
||||||
{%- set widget_attr = {} -%}
|
{% set describedBy = [help ? id ~ '_help', errors|length ? id ~ '_errors']|filter(v => v) %}
|
||||||
{%- if help is not empty -%}
|
{% set widget_attr = {attr: {'aria-describedby': describedBy ? describedBy|join(' ')}|filter(v => v)
|
||||||
{%- set widget_attr = {attr: {'aria-describedby': id ~"_help"}} -%}
|
|merge(errors|length ? {'aria-invalid': 'true'} : {})} %}
|
||||||
{%- endif -%}
|
<div class="{{ row_attr.class ?? '' }}">
|
||||||
<div{% with {attr: row_attr} %}{{ block('attributes') }}{% endwith %}>
|
{{ form_label(form) }}
|
||||||
{{- form_label(form) -}}
|
{{ form_widget(form, widget_attr) }}
|
||||||
{{- form_widget(form, widget_attr) -}}
|
{{ form_help(form) }}
|
||||||
{{- form_errors(form) -}}
|
{{ form_errors(form) }}
|
||||||
{{- form_help(form) -}}
|
|
||||||
</div>
|
</div>
|
||||||
{%- endblock form_row -%}
|
{% endblock %}
|
||||||
|
|
||||||
{%- block form_label -%}
|
|
||||||
{% set class = 'block font-bold pb-2' %}
|
|
||||||
{% if errors|length %}
|
|
||||||
{% set class = class ~ ' text-red-500' %}
|
|
||||||
{% endif %}
|
|
||||||
{% set label_attr = label_attr|merge({'class': (label_attr.class|default('') ~ class)|trim}) %}
|
|
||||||
{{ parent() }}
|
|
||||||
{%- endblock form_label -%}
|
|
||||||
|
|
||||||
{%- block form_errors -%}
|
|
||||||
{%- if errors|length > 0 -%}
|
|
||||||
<ul class="pb-2">
|
|
||||||
{%- for error in errors -%}
|
|
||||||
<li class="text-red-500">{{ error.message }}</li>
|
|
||||||
{%- endfor -%}
|
|
||||||
</ul>
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endblock form_errors -%}
|
|
||||||
|
|
||||||
{%- block form_widget_simple -%}
|
|
||||||
{%- set type = type|default('text') -%}
|
|
||||||
{%- if type != 'hidden' -%}
|
|
||||||
{%- set attr = attr|merge({'class': (attr.class|default('') ~ ' block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset text-sm')|trim }) -%}
|
|
||||||
{%- if errors|length -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' ring-red-500 placeholder-red-500 focus:ring-red-500' }) -%}
|
|
||||||
{% else %}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' placeholder:text-gray-400 focus:ring-primary' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- if disabled is defined and disabled == true -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' cursor-not-allowed' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{{ parent() }}
|
|
||||||
{%- endblock form_widget_simple -%}
|
|
||||||
|
|
||||||
{%- block textarea_widget -%}
|
|
||||||
{%- set attr = attr|merge({'class': (attr.class|default('') ~ ' block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset text-sm')|trim }) -%}
|
|
||||||
{%- if errors|length -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' ring-red-500 placeholder-red-500 focus:ring-red-500' }) -%}
|
|
||||||
{% else %}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' placeholder:text-gray-400 focus:ring-primary' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- if disabled is defined and disabled == true -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' cursor-not-allowed' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{{ parent() }}
|
|
||||||
{%- endblock textarea_widget -%}
|
|
||||||
|
|
||||||
{%- block checkbox_widget -%}
|
|
||||||
{%- set attr = attr|merge({'class': (attr.class|default('') ~ ' h-4 w-4 rounded-sm text-primary')|trim }) -%}
|
|
||||||
{%- if errors|length -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' border-red-500 text-red-500 ring-red-500 focus:ring-red-500' }) -%}
|
|
||||||
{% else %}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' border-gray-300 focus:ring-primary' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- if attr.disabled is defined and attr.disabled == true -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' cursor-not-allowed' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
<input type="checkbox" {{ block('widget_attributes') }}{% if value is defined %} value="{{ value }}"{% endif %}{% if checked %} checked="checked"{% endif %} />
|
|
||||||
{%- endblock checkbox_widget -%}
|
|
||||||
|
|
||||||
|
{# the box in front of its label, the hint below #}
|
||||||
{% block checkbox_row %}
|
{% block checkbox_row %}
|
||||||
<div class="relative flex items-start">
|
{% set describedBy = [help ? id ~ '_help', errors|length ? id ~ '_errors']|filter(v => v) %}
|
||||||
<div class="flex h-6 items-center">
|
<div class="{{ row_attr.class ?? '' }}">
|
||||||
{{ form_widget(form) }}
|
<label class="flex items-center gap-2 pt-6" for="{{ id }}">
|
||||||
</div>
|
{{ form_widget(form, {attr: {class: 'rounded'}|merge(describedBy ? {'aria-describedby': describedBy|join(' ')} : {})}) }}
|
||||||
<div class="{{ html_classes('ml-3 leading-6', { 'text-red-500': errors|length }) }}">
|
{{ label }}
|
||||||
<label for="{{ form.vars.id }}">
|
|
||||||
{{ form.vars.label }}
|
|
||||||
</label>
|
</label>
|
||||||
{{- form_errors(form) -}}
|
{{ form_help(form) }}
|
||||||
</div>
|
{{ form_errors(form) }}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{%- block choice_widget_collapsed -%}
|
{% block form_label %}
|
||||||
{%- set attr = attr|merge({'class': (attr.class|default('') ~ ' block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset text-sm')|trim }) -%}
|
{% if label is not same as(false) %}
|
||||||
{%- if errors|length -%}
|
{% set label_attr = label_attr|merge({class: 'field-label mb-1 ' ~ (label_attr.class ?? '')}) %}
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' ring-red-500 placeholder-red-500 focus:ring-red-500' }) -%}
|
|
||||||
{% else %}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' placeholder:text-gray-400 focus:ring-primary' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- if disabled is defined and disabled == true -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' cursor-not-allowed' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{{ parent() }}
|
{{ parent() }}
|
||||||
{%- endblock choice_widget_collapsed -%}
|
{% endif %}
|
||||||
|
|
||||||
{%- block choice_widget_expanded -%}
|
|
||||||
{%- for child in form %}
|
|
||||||
<div class="relative flex items-start py-2 first:pt-0">
|
|
||||||
<div class="min-w-0 flex-1 text-sm leading-4">
|
|
||||||
<label for="{{ child.vars.id }}" class="select-none font-medium text-gray-900">
|
|
||||||
{{ child.vars.label }}
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
<div class="ml-3 flex h-4 items-center">
|
|
||||||
{{- form_widget(child) -}}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor -%}
|
|
||||||
{%- endblock choice_widget_expanded -%}
|
|
||||||
|
|
||||||
{%- block birthday_widget -%}
|
|
||||||
<div class="grid grid-cols-3 gap-x-1">
|
|
||||||
{{ form_widget(form.children['day']) }}
|
|
||||||
{{ form_widget(form.children['month']) }}
|
|
||||||
{{ form_widget(form.children['year']) }}
|
|
||||||
</div>
|
|
||||||
{%- endblock -%}
|
|
||||||
|
|
||||||
{% block abbreviated_date_widget %}
|
|
||||||
{%- set class = 'flex items-center space-x-1 ' ~ attr.class|default('') -%}
|
|
||||||
{%- do form.setRendered -%}
|
|
||||||
{%- if errors|length -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' ring-red-500 placeholder-red-500 focus:ring-red-500' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
<div class="{{ class }}">
|
|
||||||
{{ form_widget(form.month, { 'attr': attr })}}
|
|
||||||
<span>/</span>
|
|
||||||
{{ form_widget(form.year, { 'attr': attr })}}
|
|
||||||
</div>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{%- block money_widget -%}
|
{% block form_label_content %}
|
||||||
{% set currency_class = 'absolute top-1/2 transform -translate-y-1/2 right-0 mr-2' %}
|
{{- parent() -}}
|
||||||
{% if errors|length %}
|
{%- if required %}<span aria-hidden="true" class="text-red-800"> *</span><span class="sr-only"> (Pflichtfeld)</span>{% endif -%}
|
||||||
{% set currency_class = currency_class ~ ' text-red-500' %}
|
{% endblock %}
|
||||||
{% else %}
|
|
||||||
{% set currency_class = currency_class ~ ' text-gray-600' %}
|
{% block form_widget_simple %}
|
||||||
|
{% set attr = attr|merge({class: 'input ' ~ (attr.class ?? '')}) %}
|
||||||
|
{{ parent() }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block choice_widget_collapsed %}
|
||||||
|
{% set attr = attr|merge({class: 'input ' ~ (attr.class ?? '')}) %}
|
||||||
|
{{ parent() }}
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block form_help %}
|
||||||
|
{% if help %}
|
||||||
|
<p id="{{ id }}_help" class="mt-1 text-xs text-slate-600">{{ help }}</p>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="relative">
|
{% endblock %}
|
||||||
{{ block('form_widget_simple') }}
|
|
||||||
<span class="{{ currency_class }}">{{ money_pattern|replace({'{{ widget }}': ''})|trim }}</span>
|
|
||||||
</div>
|
|
||||||
{%- endblock money_widget -%}
|
|
||||||
|
|
||||||
{%- block datepicker_widget -%}
|
{% block form_errors %}
|
||||||
{%- set minDate = form.vars.min_date ? form.vars.min_date | date('Y-m-d') : null -%}
|
{% if errors|length %}
|
||||||
{%- set maxDate = form.vars.max_date ? form.vars.max_date | date('Y-m-d') : null -%}
|
<p id="{{ id }}_errors" class="mt-1 text-xs font-bold text-red-800">
|
||||||
{%- set displayValue = value ? value|date('d.m.Y') : '' -%}
|
{%- for error in errors %}{{ error.message }}{% if not loop.last %} {% endif %}{% endfor -%}
|
||||||
{%- set inputClass = 'block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset text-sm' -%}
|
</p>
|
||||||
{%- if errors|length -%}
|
{% endif %}
|
||||||
{%- set inputClass = inputClass ~ ' ring-red-500 placeholder:red-500 focus:ring-red-500' -%}
|
{% endblock %}
|
||||||
{%- else -%}
|
|
||||||
{%- set inputClass = inputClass ~ ' placeholder:text-gray-900 focus:ring-primary' -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- if disabled is defined and disabled == true -%}
|
|
||||||
{%- set inputClass = inputClass ~ ' cursor-not-allowed' -%}
|
|
||||||
{%- endif -%}
|
|
||||||
<div {{ stimulus_controller('datepicker', { 'minDate': minDate, 'maxDate': maxDate, 'disableWeekends': form.vars.disable_weekends }) }}>
|
|
||||||
<input type="text"
|
|
||||||
id="{{ id }}"
|
|
||||||
class="{{ inputClass }}"
|
|
||||||
value="{{ displayValue }}"
|
|
||||||
{% if attr.placeholder is defined %}placeholder="{{ attr.placeholder }}"{% endif %}
|
|
||||||
{% if attr['aria-describedby'] is defined %}aria-describedby="{{ attr['aria-describedby'] }}"{% endif %}
|
|
||||||
{% if required %}required{% endif %}
|
|
||||||
{% if disabled is defined and disabled %}disabled{% endif %}
|
|
||||||
{{ stimulus_target('datepicker', 'field') }} />
|
|
||||||
<input type="hidden"
|
|
||||||
name="{{ form.vars.full_name }}"
|
|
||||||
value="{{ value }}"
|
|
||||||
{{ stimulus_target('datepicker', 'hiddenField') }} />
|
|
||||||
</div>
|
|
||||||
{%- endblock datepicker_widget %}
|
|
||||||
|
|
||||||
{%- block autocomplete_widget -%}
|
{# myep additions for the admin forms #}
|
||||||
{%- set attr = attr|merge({'class': (attr.class|default('') ~ ' autocomplete-input block w-full rounded-md border-0 py-1.5 text-gray-900 shadow-xs ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset text-sm')|trim }) -%}
|
|
||||||
{%- if errors|length -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' ring-red-500 placeholder-red-500 focus:ring-red-500' }) -%}
|
|
||||||
{% else %}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' placeholder:text-gray-400 focus:ring-primary' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
{%- if disabled is defined and disabled == true -%}
|
|
||||||
{%- set attr = attr|merge({'class': attr.class|default('') ~ ' cursor-not-allowed' }) -%}
|
|
||||||
{%- endif -%}
|
|
||||||
<div class="autocomplete"
|
|
||||||
{{ stimulus_controller('autocomplete', {
|
|
||||||
'action': form.vars.action ?? null,
|
|
||||||
'endpointUrl': form.vars.endpoint_url ?? null,
|
|
||||||
'choices': form.vars.choices ?? null
|
|
||||||
}) }}
|
|
||||||
>
|
|
||||||
<input type="text"
|
|
||||||
class="{{ attr.class }}"
|
|
||||||
value="{{ form.vars.initial_label }}"
|
|
||||||
{{ stimulus_target('autocomplete', 'input') }}>
|
|
||||||
<ul class="autocomplete-result-list"></ul>
|
|
||||||
<input type="hidden"
|
|
||||||
name="{{ form.vars.full_name }}"
|
|
||||||
{{ stimulus_target('autocomplete', 'field') }}
|
|
||||||
value="{{ form.vars.value }}">
|
|
||||||
<button type="button"
|
|
||||||
class="autocomplete-icon hidden"
|
|
||||||
{{ stimulus_action('autocomplete', 'reset') }}
|
|
||||||
{{ stimulus_target('autocomplete', 'resetButton') }}>
|
|
||||||
{{ icon('close', 'w-4 h-4 text-gray-700') }}
|
|
||||||
</button>
|
|
||||||
<div class="autocomplete-icon"
|
|
||||||
{{ stimulus_target('autocomplete', 'searchIcon') }}>
|
|
||||||
{{ icon('search', 'w-4 h-4 text-gray-700') }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{%- endblock autocomplete_widget -%}
|
|
||||||
|
|
||||||
{%- block multiselect_widget -%}
|
{% block textarea_widget %}
|
||||||
<div class="relative" {{ stimulus_controller('multiselect', { 'placeholder': form.vars.empty_label }) }}>
|
{% set attr = attr|merge({class: 'input ' ~ (attr.class ?? '')}) %}
|
||||||
<div {{ stimulus_action('multiselect', 'toggle', 'click')}}
|
{{ parent() }}
|
||||||
role="button"
|
{% endblock %}
|
||||||
class="relative rounded-md border border-gray-300 flex items-start space-x-2 px-3">
|
|
||||||
<div {{ stimulus_target('multiselect', 'label') }} class="flex-1 min-h-8 py-1.5 text-gray-900 text-sm"></div>
|
{# a list of boxes or radios, each in front of its label #}
|
||||||
{{ icon('dots', 'w-4 h-4 mt-2') }}
|
{% block choice_widget_expanded %}
|
||||||
</div>
|
<div {{ block('widget_container_attributes') }}>
|
||||||
<div {{ stimulus_target('multiselect', 'dropdown')}} class="absolute z-10 top-full -mt-1.5 left-0 inset-x-0 max-h-48 overflow-y-auto px-3 py-2 bg-white shadow-lg rounded-md rounded-t-none border border-gray-300 border-t-0 hidden">
|
{% for child in form %}
|
||||||
{% for item in form.children %}
|
<label class="flex items-center gap-2 py-1 text-sm" for="{{ child.vars.id }}">
|
||||||
{{ form_row(item, { 'attr': { 'data-action': 'multiselect#update', 'data-multiselect-target': 'choice', 'data-label': item.vars.label } }) }}
|
{{ form_widget(child) }}
|
||||||
|
{{ child.vars.label|trans(child.vars.label_translation_parameters, child.vars.translation_domain) }}
|
||||||
|
</label>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{# the currency inside the field, on the right #}
|
||||||
|
{% block money_widget %}
|
||||||
|
<div class="relative">
|
||||||
|
{{ block('form_widget_simple') }}
|
||||||
|
<span class="pointer-events-none absolute top-1/2 right-0 mr-3 -translate-y-1/2 text-sm text-muted">{{ money_pattern|replace({'{{ widget }}': ''})|trim }}</span>
|
||||||
</div>
|
</div>
|
||||||
{%- endblock multiselect_widget -%}
|
{% endblock %}
|
||||||
@@ -1,28 +1,27 @@
|
|||||||
<div id="htmx-confirmation-modal" class="fixed top-0 left-0 z-50 inset-0" {{ stimulus_controller('modal') }}>
|
<div id="htmx-confirmation-modal" class="fixed inset-0 z-50" {{ stimulus_controller('modal') }}>
|
||||||
<div class="absolute top-0 left-0 inset-0 bg-black/80" {{ stimulus_action('modal', 'close', 'click') }}></div>
|
<div class="absolute inset-0 bg-ink/35 backdrop-blur-[3px]" {{ stimulus_action('modal', 'close', 'click') }}></div>
|
||||||
<div class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white p-8 w-full max-w-3xl rounded-md">
|
<div class="card absolute top-1/2 left-1/2 w-full max-w-3xl -translate-x-1/2 -translate-y-1/2 p-6"
|
||||||
<div class="flex justify-between border-b border-gray-200 pb-2 mb-4">
|
role="alertdialog" aria-modal="true" aria-labelledby="htmx-confirmation-modal-title">
|
||||||
<div class="flex items-center space-x-2">
|
<div class="mb-4 flex items-center justify-between gap-4 border-b border-line pb-3">
|
||||||
{{ icon('alert', 'w-8 h-8') }}
|
<div class="flex items-center gap-2 text-brand">
|
||||||
<div class="text-xl font-bold">
|
{{ icon('alert', 'size-7 shrink-0') }}
|
||||||
|
<h2 id="htmx-confirmation-modal-title" class="text-xl font-bold">
|
||||||
{% block title %}Bist du sicher?{% endblock %}
|
{% block title %}Bist du sicher?{% endblock %}
|
||||||
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<button type="button" class="btn-tool" {{ stimulus_action('modal', 'close') }}>Schließen</button>
|
||||||
<button type="button" class="inline-block" {{ stimulus_action('modal', 'close') }}>
|
|
||||||
{{ icon('close', 'w-8 h-8') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
</div>
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
<div class="mt-6 flex items-center justify-between">
|
<div class="mt-6 flex items-center justify-between">
|
||||||
<button type="button"
|
<button type="button"
|
||||||
class="button button--warning"
|
class="btn-primary"
|
||||||
{% block button_attribute %}
|
{% block button_attribute %}
|
||||||
hx-post="{{ app.request.uri }}"
|
hx-post="{{ app.request.uri }}"
|
||||||
hx-vals="{{ { _token: csrf_token(csrf_token_id) }|json_encode|e('html_attr') }}"
|
hx-vals="{{ { _token: csrf_token(csrf_token_id) }|json_encode|e('html_attr') }}"
|
||||||
{% endblock %}>
|
{% endblock %}>
|
||||||
{% block button_confirm %}Ja{% endblock %}
|
{% block button_confirm %}Ja{% endblock %}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="button button--neutral" {{ stimulus_action('modal', 'close') }}>
|
<button type="button" class="btn-secondary" {{ stimulus_action('modal', 'close') }}>
|
||||||
{% block button_cancel %}Abbrechen{% endblock %}
|
{% block button_cancel %}Abbrechen{% endblock %}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,20 +1,16 @@
|
|||||||
<div id="htmx-modal"
|
<div id="htmx-modal"
|
||||||
class="fixed inset-0 w-full h-full z-50" {{ stimulus_controller('modal') }} {{ stimulus_action('modal', 'close', 'modal-close@window') }}>
|
class="fixed inset-0 z-50 h-full w-full" {{ stimulus_controller('modal') }} {{ stimulus_action('modal', 'close', 'modal-close@window') }}>
|
||||||
<div class="absolute inset-0 w-full h-full bg-black/70" {{ stimulus_action('modal', 'close', 'click') }}></div>
|
<div class="absolute inset-0 h-full w-full bg-ink/35 backdrop-blur-[3px]" {{ stimulus_action('modal', 'close', 'click') }}></div>
|
||||||
<div class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 px-4 w-full max-w-3xl">
|
<div class="absolute top-1/2 left-1/2 w-full max-w-3xl -translate-x-1/2 -translate-y-1/2 px-4">
|
||||||
<div class="relative bg-white py-8 rounded-md">
|
<div class="card relative py-6" role="dialog" aria-modal="true" aria-labelledby="htmx-modal-title">
|
||||||
<div class="flex justify-between pb-4 px-8">
|
<div class="flex items-center justify-between gap-4 px-6 pb-4">
|
||||||
<div class="text-2xl font-bold">
|
<h2 id="htmx-modal-title" class="text-xl font-bold text-brand">
|
||||||
{% block title %}{% endblock %}
|
{% block title %}{% endblock %}
|
||||||
|
</h2>
|
||||||
|
<button type="button" class="btn-tool" {{ stimulus_action('modal', 'close') }}>Schließen</button>
|
||||||
</div>
|
</div>
|
||||||
<button type="button"
|
<div class="max-h-[75svh] overflow-y-auto">
|
||||||
class="inline-flex items-center justify-center bg-gray-200 rounded-md w-10 h-10"
|
<div class="px-6">
|
||||||
{{ stimulus_action('modal', 'close') }}>
|
|
||||||
<svg class="w-8 h-8" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256"><rect width="256" height="256" fill="none"/><line x1="200" y1="56" x2="56" y2="200" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/><line x1="200" y1="200" x2="56" y2="56" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="16"/></svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="max-h-svh overflow-y-auto">
|
|
||||||
<div class="px-8">
|
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,49 +1,50 @@
|
|||||||
|
{#
|
||||||
|
The admin in the sidebar layout of the E&P corporate design: the KnpMenu menu `admin_main` in a
|
||||||
|
left sidebar from lg up, below that in a drawer behind the menu button.
|
||||||
|
#}
|
||||||
{% extends 'base_admin.html.twig' %}
|
{% extends 'base_admin.html.twig' %}
|
||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
<div class="max-w-screen-2xl mx-auto px-4 lg:px-8 lg:grid lg:grid-cols-4 gap-8 py-8">
|
<div {{ stimulus_controller('drawer') }}>
|
||||||
<div class="lg:col-span-4 flex items-center justify-between pb-4 lg:pb-0">
|
{% embed 'admin/_partials/_header.html.twig' with {
|
||||||
<a href="{{ path(app.user ? 'app_admin_dashboard' : 'app_login') }}">
|
app_name: 'MyE&P Admin',
|
||||||
<img class="h-8 w-auto" src="{{ asset('build/images/logo_ep.svg') }}" alt="My E&P Admin">
|
home_path: path(app.user ? 'app_admin_dashboard' : 'app_login'),
|
||||||
</a>
|
header_width: 'mx-auto max-w-screen-2xl px-4 lg:px-8',
|
||||||
|
} %}
|
||||||
|
{% block header_end %}
|
||||||
{% if app.user %}
|
{% if app.user %}
|
||||||
<div class="flex items-center space-x-4">
|
<span class="hidden self-center text-muted sm:inline">{{ app.user.userIdentifier }}</span>
|
||||||
<button type="button"
|
<button type="button" class="btn-tool self-center lg:hidden" aria-haspopup="dialog"
|
||||||
class="lg:hidden"
|
{{ stimulus_action('drawer', 'open') }}>Menü</button>
|
||||||
{{ stimulus_controller('mobilenav', [], [], { 'mobilenav': '#mobilenav' }) }}
|
|
||||||
{{ stimulus_action('mobilenav', 'trigger', null, { 'mode': 'open' }) }}>
|
|
||||||
{{ icon('menu', 'w-8 h-8 text-gray-700') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
{% endblock %}
|
||||||
<div class="hidden lg:block sticky top-0 h-screen">
|
{% endembed %}
|
||||||
|
|
||||||
|
<div class="mx-auto max-w-screen-2xl gap-8 px-4 py-8 lg:grid lg:grid-cols-[14.5rem_minmax(0,1fr)] lg:px-8">
|
||||||
|
<nav aria-label="Hauptmenü" class="hidden lg:block">
|
||||||
{% if app.user %}
|
{% if app.user %}
|
||||||
{{ knp_menu_render(knp_menu_get('admin_main')) }}
|
{{ knp_menu_render('admin_main') }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</nav>
|
||||||
<div class="lg:col-span-3">
|
<main id="content" tabindex="-1" class="min-w-0 outline-none">
|
||||||
{% block content %}{% endblock %}
|
{% block content %}{% endblock %}
|
||||||
</div>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<div id="mobilenav"
|
|
||||||
class="fixed z-50 top-0 left-0 inset-0 pr-16 bg-black/70 -translate-x-full"
|
|
||||||
{{ stimulus_controller('mobilenav', [], { 'closed': '-translate-x-full' }, { 'mobilenav': '#mobilenav' }) }}
|
|
||||||
>
|
|
||||||
<div class="h-screen w-full bg-white">
|
|
||||||
<div class="flex justify-between p-8">
|
|
||||||
<img src="{{ asset('build/images/logo_ep.svg') }}" alt="" class="block w-auto h-8">
|
|
||||||
<button type="button"
|
|
||||||
{{ stimulus_action('mobilenav', 'trigger', null, { 'mode': 'close' }) }}>
|
|
||||||
{{ icon('close', 'w-8 h-8') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
<div class="w-full h-full p-8 pt-0 overflow-y-auto">
|
|
||||||
{% if app.user %}
|
{% if app.user %}
|
||||||
{{ knp_menu_render(knp_menu_get('admin_main')) }}
|
<dialog class="drawer" aria-label="Hauptmenü" {{ stimulus_target('drawer', 'dialog') }}
|
||||||
|
{{ stimulus_action('drawer', 'closeOnBackdrop', 'click') }}>
|
||||||
|
{# fills the dialog, so only clicks beside the drawer reach the dialog element itself #}
|
||||||
|
<div class="flex h-full flex-col">
|
||||||
|
<div class="flex items-center justify-between p-4">
|
||||||
|
<img src="{{ asset('build/images/ep-logo.svg') }}" alt="" class="h-9 w-auto">
|
||||||
|
<button type="button" class="btn-tool" {{ stimulus_action('drawer', 'close') }}>Schließen</button>
|
||||||
|
</div>
|
||||||
|
<nav class="flex-1 overflow-y-auto px-4 pb-8">
|
||||||
|
{{ knp_menu_render('admin_main') }}
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</dialog>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
{% include '_partials/_flashes_admin.html.twig' %}
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in new issue
Block a user