Loheide-eu-mitarbeiterplatt.../public/build/assets/Editor-DVU9VKeo.js
Friederich Loheide 38f47f98e2
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 14m38s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 14m13s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 11m56s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 11m44s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 56m9s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 1h2m6s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 10m30s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 47s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m13s
Oberfläche Mitarbeiter-App umschaltbar (0.52.0)
Einstellung interface (classic|app) im Erscheinungsbild; data-ui am Wurzelelement,
warme Tokens, Karten mit Schatten, Menüpunkte als Pillen; Startseite dreispaltig.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 19:17:23 +00:00

1 line
No EOL
9.2 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{Et as e,H as t,M as n,Ot as ee,P as r}from"./ui-DY0WbyhT.js";import{At as i,C as a,Dt as o,O as s,S as c,T as l,Tt as u,_t as d,a as f,g as te,i as p,k as m,ot as h,q as g,rt as _,s as ne,w as v,x as y}from"./framework-Cy4cevSy.js";import{t as b}from"./arrow-left-DyeChuYs.js";import{n as re}from"./RichTextEditor-kYK269Cm.js";import{d as ie}from"./useMediaList-Cl_ptIvV.js";import{t as ae}from"./image-plus-DLFtfLtd.js";import{t as oe}from"./save-puTfr0Iw.js";import{t as x}from"./trash-5Sd5z4th.js";import{F as S,d as C,l as w,s as T,t as E,u as D}from"./app-C8emkL0O.js";import{n as O,t as k}from"./useMediaPicker-DmC4H5bZ.js";var A={class:`grid min-w-0 gap-6`},j={class:`grid gap-5`},M={class:`flex items-center gap-3 text-sm font-medium`},N={class:`grid gap-4 sm:grid-cols-2`},P={class:`grid gap-4 sm:grid-cols-2`},F={class:`grid gap-6`},se={class:`flex items-center justify-between gap-3 text-sm`},I={class:`flex items-center justify-between gap-3 text-sm`},L={key:0,class:`mt-4 grid gap-4 border-t pt-4`},R={key:0,class:`flex items-center justify-between gap-3 text-sm`},z={class:`flex items-center justify-between gap-3 text-sm`},B={key:1,class:`text-[13px] text-muted-foreground`},V={key:0,class:`relative overflow-hidden rounded-md border`},H=[`src`],U={key:1,class:`mt-2 text-[13px] text-destructive`},W={class:`-mt-1 mb-3 flex items-start gap-2 text-[13px] text-muted-foreground`},G={__name:`Editor`,props:{event:{type:Object,default:null},audienceOptions:{type:Object,required:!0}},setup(G){let K=G,ce=()=>{let e=new Date;return e.setHours(e.getHours()+1,0,0,0),new Date(e.getTime()-e.getTimezoneOffset()*6e4).toISOString().slice(0,16)},q=K.event,J=f({title:q?.title??``,all_day:q?.all_day??!1,starts_at:q?.starts_at??ce(),ends_at:q?.ends_at??``,location:q?.location??``,online_url:q?.online_url??``,description:q?.description??``,image_path:q?.image_path??null,is_published:q?.is_published??!0,registration_enabled:q?.registration_enabled??!1,capacity:q?.capacity??``,waitlist:q?.waitlist??!0,registration_deadline:q?.registration_deadline??``,participants_public:q?.participants_public??!1,audience:q?.audience??{}}),Y=d(q?.image_url??null),X=y(()=>J.all_day?`date`:`datetime-local`);_(()=>J.all_day,e=>{J.starts_at=e?J.starts_at.slice(0,10):`${J.starts_at.slice(0,10)}T09:00`,J.ends_at=J.ends_at?e?J.ends_at.slice(0,10):`${J.ends_at.slice(0,10)}T17:00`:``});let Z=(e,t)=>ie(`/redaktion/termine/bilder`,e,{onProgress:t}),Q=k({upload:Z,contextLabel:`Bei diesem Termin`,contextPaths:()=>[J.image_path].filter(Boolean)});async function le(){let e=await Q.pick({title:`Titelbild wählen`});e?.[0]&&(J.image_path=e[0].path,Y.value=e[0].url)}let ue=y(()=>Object.values(J.audience??{}).some(e=>e?.length));function $(){let e={preserveScroll:!0};q?J.put(`/redaktion/termine/${q.id}`,e):J.post(`/redaktion/termine`,e)}function de(){window.confirm(`Termin „${q.title}“ löschen?`)&&ne.delete(`/redaktion/termine/${q.id}`)}return(d,f)=>(g(),a(D,{title:u(q)?`Bearbeiten: ${u(q).title}`:`Neuer Termin`},{default:h(()=>[m(C,{title:u(q)?`Termin bearbeiten`:`Neuer Termin`,breadcrumbs:[{label:`Termine`,href:`/termine`}]},{actions:h(()=>[u(q)?(g(),a(u(r),{key:0,variant:`ghost`,class:`text-destructive hover:text-destructive`,onClick:de},{default:h(()=>[m(u(x)),f[15]||=s(` Löschen`,-1)]),_:1})):v(``,!0),m(u(r),{disabled:u(J).processing,onClick:$},{default:h(()=>[u(J).processing?(g(),a(u(ee),{key:0,class:`animate-spin`})):(g(),a(u(oe),{key:1})),f[16]||=s(` Speichern`,-1)]),_:1},8,[`disabled`])]),_:1},8,[`title`]),c(`form`,{class:`grid grid-cols-1 items-start gap-6 lg:grid-cols-[minmax(0,1fr)_20rem]`,onSubmit:te($,[`prevent`])},[c(`div`,A,[m(w,null,{default:h(()=>[c(`div`,j,[m(T,{id:`ev-title`,label:`Titel`,error:u(J).errors.title},{default:h(()=>[m(u(n),{id:`ev-title`,modelValue:u(J).title,"onUpdate:modelValue":f[0]||=e=>u(J).title=e,maxlength:`160`,placeholder:`z. B. Sommerfest 2026`,class:`text-base`},null,8,[`modelValue`])]),_:1},8,[`error`]),c(`label`,M,[m(u(t),{modelValue:u(J).all_day,"onUpdate:modelValue":f[1]||=e=>u(J).all_day=e},null,8,[`modelValue`]),f[17]||=s(` Ganztägig `,-1)]),c(`div`,N,[m(T,{id:`ev-start`,label:`Beginn`,error:u(J).errors.starts_at},{default:h(()=>[m(u(n),{id:`ev-start`,modelValue:u(J).starts_at,"onUpdate:modelValue":f[2]||=e=>u(J).starts_at=e,type:X.value},null,8,[`modelValue`,`type`])]),_:1},8,[`error`]),m(T,{id:`ev-end`,label:`Ende (optional)`,error:u(J).errors.ends_at},{default:h(()=>[m(u(n),{id:`ev-end`,modelValue:u(J).ends_at,"onUpdate:modelValue":f[3]||=e=>u(J).ends_at=e,type:X.value,min:u(J).starts_at},null,8,[`modelValue`,`type`,`min`])]),_:1},8,[`error`])]),c(`div`,P,[m(T,{id:`ev-location`,label:`Ort`,error:u(J).errors.location},{default:h(()=>[m(u(n),{id:`ev-location`,modelValue:u(J).location,"onUpdate:modelValue":f[4]||=e=>u(J).location=e,maxlength:`255`,placeholder:`z. B. Kantine, Haus A`},null,8,[`modelValue`])]),_:1},8,[`error`]),m(T,{id:`ev-online`,label:`Online-Link`,error:u(J).errors.online_url},{default:h(()=>[m(u(n),{id:`ev-online`,modelValue:u(J).online_url,"onUpdate:modelValue":f[5]||=e=>u(J).online_url=e,type:`url`,maxlength:`500`,placeholder:`https://…`},null,8,[`modelValue`])]),_:1},8,[`error`])]),m(T,{id:`ev-description`,label:`Beschreibung`,error:u(J).errors.description},{default:h(()=>[m(re,{modelValue:u(J).description,"onUpdate:modelValue":f[6]||=e=>u(J).description=e,bordered:``,"min-height":`12rem`,placeholder:`Worum geht es? Programm, Anmeldung, Mitbringen …`,"upload-image":async e=>(await Z(e)).url,"pick-image":e=>u(Q).pick(e)},null,8,[`modelValue`,`upload-image`,`pick-image`])]),_:1},8,[`error`])])]),_:1})]),c(`div`,F,[m(w,{title:`Veröffentlichung`},{default:h(()=>[c(`label`,se,[f[18]||=c(`span`,null,[c(`span`,{class:`font-medium`},`Veröffentlicht`),c(`span`,{class:`block text-xs text-muted-foreground`},`Sonst nur für die Redaktion sichtbar.`)],-1),m(u(t),{modelValue:u(J).is_published,"onUpdate:modelValue":f[7]||=e=>u(J).is_published=e},null,8,[`modelValue`])]),u(q)?.url&&u(q).is_published?(g(),a(u(p),{key:0,href:u(q).url,class:`mt-3 inline-flex items-center gap-1 text-[13px] text-brand-text hover:underline`},{default:h(()=>[m(u(b),{class:`size-3.5`}),f[19]||=s(` Zum Termin`,-1)]),_:1},8,[`href`])):v(``,!0)]),_:1}),m(w,{title:`Anmeldung`},{default:h(()=>[c(`label`,I,[f[20]||=c(`span`,null,[c(`span`,{class:`font-medium`},`Anmeldung erforderlich`),c(`span`,{class:`block text-xs text-muted-foreground`},`Mitarbeitende melden sich im Portal oder in der App an.`)],-1),m(u(t),{modelValue:u(J).registration_enabled,"onUpdate:modelValue":f[8]||=e=>u(J).registration_enabled=e},null,8,[`modelValue`])]),u(J).registration_enabled?(g(),l(`div`,L,[m(T,{id:`ev-capacity`,label:`Plätze`,error:u(J).errors.capacity,hint:`Leer lassen für unbegrenzt.`},{default:h(()=>[m(u(n),{id:`ev-capacity`,modelValue:u(J).capacity,"onUpdate:modelValue":f[9]||=e=>u(J).capacity=e,type:`number`,min:`1`,inputmode:`numeric`},null,8,[`modelValue`])]),_:1},8,[`error`]),u(J).capacity?(g(),l(`label`,R,[f[21]||=c(`span`,null,[c(`span`,{class:`font-medium`},`Warteliste`),c(`span`,{class:`block text-xs text-muted-foreground`},`Wird ein Platz frei, rückt die nächste Person automatisch nach.`)],-1),m(u(t),{modelValue:u(J).waitlist,"onUpdate:modelValue":f[10]||=e=>u(J).waitlist=e},null,8,[`modelValue`])])):v(``,!0),m(T,{id:`ev-deadline`,label:`Anmeldeschluss (optional)`,error:u(J).errors.registration_deadline,hint:`Ohne Angabe bis zum Beginn.`},{default:h(()=>[m(u(n),{id:`ev-deadline`,modelValue:u(J).registration_deadline,"onUpdate:modelValue":f[11]||=e=>u(J).registration_deadline=e,type:`datetime-local`},null,8,[`modelValue`])]),_:1},8,[`error`]),c(`label`,z,[f[22]||=c(`span`,null,[c(`span`,{class:`font-medium`},`Teilnehmende zeigen`),c(`span`,{class:`block text-xs text-muted-foreground`},`Angemeldete sehen, wer noch kommt.`)],-1),m(u(t),{modelValue:u(J).participants_public,"onUpdate:modelValue":f[12]||=e=>u(J).participants_public=e},null,8,[`modelValue`])]),u(q)?.registrations?(g(),l(`p`,B,`Bisher `+i(u(q).registrations)+` `+i(u(q).registrations===1?`Anmeldung`:`Anmeldungen`)+` – die Liste steht beim Termin.`,1)):v(``,!0)])):v(``,!0)]),_:1}),m(w,{title:`Titelbild`},{default:h(()=>[u(J).image_path?(g(),l(`div`,V,[c(`img`,{src:Y.value,alt:``,class:`aspect-video w-full object-cover`},null,8,H),c(`button`,{type:`button`,class:`absolute top-2 right-2 grid size-7 place-items-center rounded-full bg-black/60 text-white hover:bg-black/80`,"aria-label":`Bild entfernen`,onClick:f[13]||=e=>u(J).image_path=null},[m(u(e),{class:`size-4`})])])):v(``,!0),m(u(r),{type:`button`,variant:`outline`,class:o([`w-full`,{"mt-3":u(J).image_path}]),onClick:le},{default:h(()=>[m(u(ae)),s(` `+i(u(J).image_path?`Anderes Bild`:`Bild wählen oder hochladen`),1)]),_:1},8,[`class`]),u(J).errors.image_path?(g(),l(`p`,U,i(u(J).errors.image_path),1)):v(``,!0)]),_:1}),m(w,{title:`Wer sieht den Termin?`},{default:h(()=>[c(`p`,W,[m(u(S),{class:`mt-0.5 size-4 shrink-0`}),s(` `+i(ue.value?`Nur Personen, die mindestens eine Angabe erfüllen.`:`Alle – oder unten eingrenzen.`),1)]),m(E,{modelValue:u(J).audience,"onUpdate:modelValue":f[14]||=e=>u(J).audience=e,options:G.audienceOptions,"exclude-hint":`Sehen den Termin nie – auch wenn oben etwas passt.`},null,8,[`modelValue`,`options`])]),_:1})])],32),m(O,{picker:u(Q)},null,8,[`picker`])]),_:1},8,[`title`]))}};export{G as default};