Loheide-eu-mitarbeiterplatt.../public/build/assets/Index-S_a7EjEo.js
Friederich Loheide 97879ce243
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m34s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 3m39s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m55s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 3m36s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 4m28s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 4m19s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 3m34s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 3m29s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m7s
Neue Plugins: Speiseplan und „Gemeinsam feiern, erinnern und willkommen heißen“
- Gemeinsam: Personalnachrichten je Monat in sechs Tabellen; Geburtstage
  aus dem Geburtstags-Plugin (neue Abfrage BirthdayList::inMonth)
- Speiseplan: Wochenbilder im Voraus, PDF → Bild im Browser,
  aktuelle und nächste Woche, Allergie-PDF, randloser A4-Druck,
  Löschen nach zwei Wochen
- Beide optional (zunächst abgeschaltet), eigene Pflegerechte

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-26 16:42:52 +00:00

1 line
No EOL
16 KiB
JavaScript
Raw 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{D as e,E as t,Ht as n,On as r,Zn as i,_ as a,b as o,bt as s,g as c,mt as l,o as u,qt as d,tr as f,v as p,vn as m,wt as h,y as g}from"./runtime-core.esm-bundler-B8D2lM98.js";import{w as _}from"./runtime-dom.esm-bundler-BEWGoe8n.js";import{a as v,i as y,n as b,r as x}from"./app-DNFabNcC.js";import{A as S,j as C}from"./dist-CleIz2GP.js";import{R as w,b as T,d as E,h as D,m as O,ot as k,p as A}from"./AppIcon-DoyAJznh.js";import{t as j}from"./AppLayout-DhUQAEuS.js";import{_ as M,o as N,t as P}from"./http-9R3L4KBg.js";import{t as F}from"./chevron-left-CfNljcKt.js";import{t as I}from"./chevron-right-DR4LjgDm.js";import{t as ee}from"./ellipsis-vertical-DGYrWQ83.js";import{t as L}from"./pencil-line-Cp-EHBoW.js";import{t as R}from"./plus-cKZvz4wH.js";import{t as te}from"./trash-3XeUxfQJ.js";import{t as z}from"./FormField-BcJMyuzX.js";import{t as B}from"./EmptyState-Ceq4v8mE.js";import{t as V}from"./PageHeader-B0pvFNSF.js";import{t as H}from"./button-SRYY3-ko.js";import{t as U}from"./Input-CgjHXzkf.js";import{t as W}from"./Textarea-DWpyL-nk.js";import{i as G,n as K,r as q,t as J}from"./dialog-DU4svatX.js";import{t as Y}from"./DialogHeader-YbgEMzbh.js";var X=C({name:`arrow-right-left`,size:24,node:[[`path`,{d:`m16 3 4 4-4 4`,key:`1x1c3m`}],[`path`,{d:`M20 7H4`,key:`zbl0bi`}],[`path`,{d:`m8 21-4-4 4-4`,key:`h9nckh`}],[`path`,{d:`M4 17h16`,key:`g4d7ey`}]]}),Z=C({name:`award`,size:24,node:[[`path`,{d:`m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526`,key:`1yiouv`}],[`circle`,{cx:`12`,cy:`8`,r:`6`,key:`1vp47v`}]]}),Q=C({name:`flower-2`,size:24,node:[[`path`,{d:`M12 5a3 3 0 1 1 3 3m-3-3a3 3 0 1 0-3 3m3-3v1M9 8a3 3 0 1 0 3 3M9 8h1m5 0a3 3 0 1 1-3 3m3-3h-1m-2 3v-1`,key:`3pnvol`}],[`circle`,{cx:`12`,cy:`8`,r:`2`,key:`1822b1`}],[`path`,{d:`M12 10v12`,key:`6ubwww`}],[`path`,{d:`M12 22c4.2 0 7-1.667 7-5-4.2 0-7 1.667-7 5Z`,key:`9hd38g`}],[`path`,{d:`M12 22c-4.2 0-7-1.667-7-5 4.2 0 7 1.667 7 5Z`,key:`ufn41s`}]]}),ne=C({name:`hand`,size:24,node:[[`path`,{d:`M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2`,key:`1fvzgz`}],[`path`,{d:`M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2`,key:`1kc0my`}],[`path`,{d:`M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8`,key:`10h0bg`}],[`path`,{d:`M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15`,key:`1s1gnw`}]]}),re={key:0},ie={key:0,class:`flex items-center gap-2 rounded-md border px-2 py-1.5`},ae={class:`min-w-0 flex-1 truncate text-sm`},oe={key:1,class:`relative`},se={key:0,class:`absolute inset-x-0 top-full z-30 mt-1 max-h-60 overflow-y-auto rounded-md border bg-popover p-1 shadow-md`},ce=[`onClick`],le={class:`truncate`},ue={class:`grid gap-4 sm:grid-cols-2`},de={key:0,class:`-mt-2 text-xs text-muted-foreground`},fe={__name:`EntryDialog`,props:{open:{type:Boolean,default:!1},section:{type:Object,default:null},entry:{type:Object,default:null},month:{type:String,required:!0}},emits:[`update:open`],setup(i,{emit:h}){let v=i,y=h,b={welcome:{date:`Eintritt am`,fields:[`department`,`location`,`text`]},transfer:{date:`Wechsel ab`,fields:[`from`,`to`,`text`]},jubilee:{date:`Jubiläum am`,fields:[`label`,`department`,`text`],label:`Jubiläum`,labelPlaceholder:`z. B. 25 Jahre`},farewell:{date:`Letzter Arbeitstag`,fields:[`department`,`label`,`text`],label:`Anlass (optional)`,labelPlaceholder:`z. B. Ruhestand`},memoriam:{date:`Verstorben am`,fields:[`born_on`,`department`,`text`]}},C=c(()=>b[v.section?.key]??b.welcome),w=e=>C.value.fields.includes(e),E=x({section:``,user_id:null,name:``,date:``,born_on:``,department:``,location:``,from:``,to:``,label:``,text:``}),D=m(null),O=m(!1),k=m(``),A=m([]);n(()=>v.open,e=>{if(!e)return;let t=v.entry;E.clearErrors(),E.defaults({section:v.section.key,user_id:t?.user_id??null,name:t?.free_name??``,date:t?.date??`${v.month}-01`,born_on:t?.born_on??``,department:t?.raw?.department??``,location:t?.raw?.location??``,from:t?.from??``,to:t?.to??``,label:t?.label??``,text:t?.text??``}),E.reset(),D.value=t?.person??null,O.value=!!t&&!t.user_id,k.value=``,A.value=[]});let j;n(k,e=>{if(clearTimeout(j),e.trim().length<2)return A.value=[];j=setTimeout(async()=>A.value=(await P.get(`/personen/suche?q=${encodeURIComponent(e.trim())}`)).people,250)});function N(e){D.value=e,E.user_id=e.id,k.value=``,A.value=[]}function F(){D.value=null,E.user_id=null}function I(){O.value&&(E.user_id=null);let e={preserveScroll:!0,onSuccess:()=>y(`update:open`,!1)};v.entry?E.put(`/gemeinsam/eintraege/${v.entry.id}`,e):E.post(`/gemeinsam/eintraege`,e)}return(n,c)=>(l(),p(r(G),{open:i.open,"onUpdate:open":c[12]||=e=>y(`update:open`,e)},{default:d(()=>[e(r(q),{class:`sm:max-w-lg`},{default:d(()=>[e(r(Y),null,{default:d(()=>[e(r(J),null,{default:d(()=>[t(f(i.section?.title),1)]),_:1})]),_:1}),a(`form`,{class:`grid gap-4`,onSubmit:_(I,[`prevent`])},[e(z,{id:`g-person`,label:`Person`,error:r(E).errors.name||r(E).errors.user_id},{default:d(()=>[O.value?(l(),p(r(U),{key:1,id:`g-person`,modelValue:r(E).name,"onUpdate:modelValue":c[1]||=e=>r(E).name=e,maxlength:`150`,placeholder:`Vor- und Nachname`},null,8,[`modelValue`])):(l(),o(`div`,re,[D.value?(l(),o(`div`,ie,[e(T,{person:D.value,class:`size-7 text-[10px]`},null,8,[`person`]),a(`span`,ae,f(D.value.name),1),a(`button`,{type:`button`,class:`grid size-6 place-items-center rounded hover:bg-accent`,"aria-label":`Auswahl entfernen`,onClick:F},[e(r(M),{class:`size-3.5`})])])):(l(),o(`div`,oe,[e(r(U),{id:`g-person`,modelValue:k.value,"onUpdate:modelValue":c[0]||=e=>k.value=e,placeholder:`Name im Portal suchen …`,autocomplete:`off`},null,8,[`modelValue`]),A.value.length?(l(),o(`ul`,se,[(l(!0),o(u,null,s(A.value,n=>(l(),o(`li`,{key:n.id},[a(`button`,{type:`button`,class:`flex w-full items-center gap-2 rounded px-2 py-1.5 text-left text-sm hover:bg-accent`,onClick:e=>N(n)},[e(T,{person:n,class:`size-7 text-[10px]`},null,8,[`person`]),c[13]||=t(),a(`span`,le,f(n.name),1)],8,ce)]))),128))])):g(``,!0)]))])),a(`button`,{type:`button`,class:`mt-1 justify-self-start text-xs text-brand-text hover:underline`,onClick:c[2]||=e=>O.value=!O.value},f(O.value?`Stattdessen Person aus dem Portal wählen`:`Nicht im Portal? Namen frei eintragen`),1)]),_:1},8,[`error`]),a(`div`,ue,[e(z,{id:`g-date`,label:C.value.date,error:r(E).errors.date},{default:d(()=>[e(r(U),{id:`g-date`,modelValue:r(E).date,"onUpdate:modelValue":c[3]||=e=>r(E).date=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`label`,`error`]),w(`born_on`)?(l(),p(z,{key:0,id:`g-born`,label:`Geboren am (optional)`,error:r(E).errors.born_on},{default:d(()=>[e(r(U),{id:`g-born`,modelValue:r(E).born_on,"onUpdate:modelValue":c[4]||=e=>r(E).born_on=e,type:`date`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`label`)?(l(),p(z,{key:1,id:`g-label`,label:C.value.label,error:r(E).errors.label},{default:d(()=>[e(r(U),{id:`g-label`,modelValue:r(E).label,"onUpdate:modelValue":c[5]||=e=>r(E).label=e,maxlength:`150`,placeholder:C.value.labelPlaceholder},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`label`,`error`])):g(``,!0),w(`from`)?(l(),p(z,{key:2,id:`g-from`,label:`Bisher`,error:r(E).errors.from},{default:d(()=>[e(r(U),{id:`g-from`,modelValue:r(E).from,"onUpdate:modelValue":c[6]||=e=>r(E).from=e,maxlength:`150`,placeholder:`z. B. Werkstatt Nord`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`to`)?(l(),p(z,{key:3,id:`g-to`,label:`Künftig`,error:r(E).errors.to},{default:d(()=>[e(r(U),{id:`g-to`,modelValue:r(E).to,"onUpdate:modelValue":c[7]||=e=>r(E).to=e,maxlength:`150`,placeholder:`z. B. Verwaltung`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),w(`department`)?(l(),p(z,{key:4,id:`g-dep`,label:`Bereich`,error:r(E).errors.department},{default:d(()=>[e(r(U),{id:`g-dep`,modelValue:r(E).department,"onUpdate:modelValue":c[8]||=e=>r(E).department=e,maxlength:`150`,placeholder:D.value?.department||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`error`])):g(``,!0),w(`location`)?(l(),p(z,{key:5,id:`g-loc`,label:`Standort`,error:r(E).errors.location},{default:d(()=>[e(r(U),{id:`g-loc`,modelValue:r(E).location,"onUpdate:modelValue":c[9]||=e=>r(E).location=e,maxlength:`150`,placeholder:D.value?.location||``},null,8,[`modelValue`,`placeholder`])]),_:1},8,[`error`])):g(``,!0)]),D.value&&(w(`department`)||w(`location`))?(l(),o(`p`,de,`Leer gelassen, gilt die Angabe aus dem Profil.`)):g(``,!0),w(`text`)?(l(),p(z,{key:1,id:`g-text`,label:`Text (optional)`,error:r(E).errors.text},{default:d(()=>[e(r(W),{id:`g-text`,modelValue:r(E).text,"onUpdate:modelValue":c[10]||=e=>r(E).text=e,rows:`2`,maxlength:`1000`},null,8,[`modelValue`])]),_:1},8,[`error`])):g(``,!0),e(r(K),null,{default:d(()=>[e(r(H),{type:`button`,variant:`outline`,onClick:c[11]||=e=>y(`update:open`,!1)},{default:d(()=>[...c[14]||=[t(`Abbrechen`,-1)]]),_:1}),e(r(H),{type:`submit`,disabled:r(E).processing},{default:d(()=>[r(E).processing?(l(),p(r(S),{key:0,class:`animate-spin`})):g(``,!0),c[15]||=t(` Speichern`,-1)]),_:1},8,[`disabled`])]),_:1})],32)]),_:1})]),_:1},8,[`open`]))}},pe={class:`flex min-w-0 items-center gap-3`},me={class:`min-w-0`},he={key:1,class:`block truncate text-sm font-medium`},ge={key:2,class:`block truncate text-xs text-muted-foreground`},_e={__name:`PersonCell`,props:{entry:{type:Object,required:!0},muted:{type:Boolean,default:!1}},setup(n){let s=e=>e.split(/\s+/).filter(Boolean).slice(0,2).map(e=>e[0]).join(``).toUpperCase();return(c,u)=>(l(),o(`div`,pe,[e(T,{person:n.entry.person??{id:n.entry.name,name:n.entry.name,initials:s(n.entry.name)},class:i([`size-9 shrink-0`,{grayscale:n.muted}])},null,8,[`person`,`class`]),a(`div`,me,[n.entry.person?.url?(l(),p(r(b),{key:0,href:n.entry.person.url,class:`block truncate text-sm font-medium hover:underline`},{default:d(()=>[t(f(n.entry.name),1)]),_:1},8,[`href`])):(l(),o(`span`,he,f(n.entry.name),1)),n.entry.person?.job_title?(l(),o(`span`,ge,f(n.entry.person.job_title),1)):g(``,!0)])]))}},ve={class:`flex items-center gap-1 rounded-md border bg-card p-0.5`},ye={class:`min-w-32 text-center text-sm font-medium`},be={key:0,class:`grid gap-6`},xe={class:`flex items-center justify-between gap-3 border-b px-5 py-3`},Se={key:1,class:`text-xs text-muted-foreground`},Ce={key:0,class:`overflow-x-auto`},we={class:`w-full text-sm`},Te={class:`bg-muted/40 text-left text-xs text-muted-foreground`},Ee={key:0,class:`w-12`},De={class:`divide-y`},Oe={class:`px-5 py-2.5`},ke={key:0,class:`pr-3 text-right`},$={key:0},Ae=[`colspan`],je={key:1,class:`px-5 py-4 text-[13px] text-muted-foreground`},Me={key:1,class:`rounded-lg border bg-card`},Ne={__name:`Index`,props:{month:{type:String,required:!0},monthLabel:{type:String,required:!0},previous:{type:String,required:!0},next:{type:String,required:!0},isCurrent:{type:Boolean,default:!0},sections:{type:Array,required:!0},canManage:{type:Boolean,default:!1}},setup(_){let x=_,S=y();n(()=>S.props.flash.status,e=>e&&N.success(e),{immediate:!0});let C={welcome:w,transfer:X,birthdays:k,jubilee:Z,farewell:ne,memoriam:Q},T={welcome:[[`department`,`Bereich`],[`location`,`Standort`],[`date`,`Eintritt`]],transfer:[[`from`,`Bisher`],[`to`,`Künftig`],[`date`,`Ab`]],birthdays:[[`department`,`Bereich`],[`location`,`Standort`],[`date`,`Geburtstag`]],jubilee:[[`label`,`Jubiläum`],[`department`,`Bereich`],[`date`,`Datum`]],farewell:[[`department`,`Bereich`],[`label`,`Anlass`],[`date`,`Letzter Arbeitstag`]],memoriam:[[`lifespan`,`Lebensdaten`],[`department`,`Bereich`]]},M=new Intl.DateTimeFormat(`de-DE`,{day:`2-digit`,month:`2-digit`,year:`numeric`}),P=new Intl.DateTimeFormat(`de-DE`,{day:`numeric`,month:`long`}),z=(e,t)=>e?(t===`birthdays`?P:M).format(new Date(`${e}T12:00:00`)):`–`;function U(e,t,n){return t===`date`?z(e.date,n):t===`lifespan`?[e.born_on&&`* ${z(e.born_on)}`,`† ${z(e.date)}`].filter(Boolean).join(` `):e[t]||`–`}let W=c(()=>x.sections.filter(e=>e.entries.length||x.canManage&&!e.automatic)),G=c(()=>x.sections.every(e=>!e.entries.length)),K=m({open:!1,section:null,entry:null}),q=e=>K.value={open:!0,section:e,entry:null},J=(e,t)=>K.value={open:!0,section:e,entry:t};function Y(e){window.confirm(`Eintrag „${e.name}“ entfernen?`)&&v.delete(`/gemeinsam/eintraege/${e.id}`,{preserveScroll:!0})}return(n,c)=>(l(),p(j,{title:`Gemeinsam feiern, erinnern und willkommen heißen`},{default:d(()=>[e(V,{title:`Gemeinsam feiern, erinnern und willkommen heißen`,description:_.monthLabel},{actions:d(()=>[a(`div`,ve,[e(r(H),{variant:`ghost`,size:`icon`,class:`size-8`,"as-child":``},{default:d(()=>[e(r(b),{href:`/gemeinsam?monat=${_.previous}`,"aria-label":`Vorheriger Monat`,"preserve-scroll":``},{default:d(()=>[e(r(F))]),_:1},8,[`href`])]),_:1}),a(`span`,ye,f(_.monthLabel),1),e(r(H),{variant:`ghost`,size:`icon`,class:`size-8`,"as-child":``},{default:d(()=>[e(r(b),{href:`/gemeinsam?monat=${_.next}`,"aria-label":`Nächster Monat`,"preserve-scroll":``},{default:d(()=>[e(r(I))]),_:1},8,[`href`])]),_:1})]),_.isCurrent?g(``,!0):(l(),p(r(H),{key:0,variant:`outline`,"as-child":``},{default:d(()=>[e(r(b),{href:`/gemeinsam`},{default:d(()=>[...c[1]||=[t(`Aktueller Monat`,-1)]]),_:1})]),_:1}))]),_:1},8,[`description`]),W.value.length&&(!G.value||_.canManage)?(l(),o(`div`,be,[(l(!0),o(u,null,s(W.value,n=>(l(),o(`section`,{key:n.key,class:i([`overflow-hidden rounded-lg border bg-card`,n.key===`memoriam`?`border-t-4 border-t-foreground/70`:`border-t-4 border-t-brand`])},[a(`header`,xe,[a(`h2`,{class:i([`flex items-center gap-2.5 text-base font-semibold`,{"text-foreground/85":n.key===`memoriam`}])},[(l(),p(h(C[n.key]),{class:i([`size-5`,n.key===`memoriam`?`text-muted-foreground`:`text-brand-text`])},null,8,[`class`])),t(` `+f(n.title),1)],2),_.canManage&&!n.automatic?(l(),p(r(H),{key:0,size:`sm`,variant:`outline`,onClick:e=>q(n)},{default:d(()=>[e(r(R)),c[2]||=t(` Hinzufügen`,-1)]),_:1},8,[`onClick`])):n.automatic&&_.canManage?(l(),o(`span`,Se,`aus dem Geburtstagskalender`)):g(``,!0)]),n.entries.length?(l(),o(`div`,Ce,[a(`table`,we,[a(`thead`,Te,[a(`tr`,null,[c[4]||=a(`th`,{class:`px-5 py-2 font-medium`},`Name`,-1),(l(!0),o(u,null,s(T[n.key],([e,t])=>(l(),o(`th`,{key:e,class:`px-3 py-2 font-medium whitespace-nowrap`},f(t),1))),128)),_.canManage&&!n.automatic?(l(),o(`th`,Ee,[...c[3]||=[a(`span`,{class:`sr-only`},`Aktionen`,-1)]])):g(``,!0)])]),a(`tbody`,De,[(l(!0),o(u,null,s(n.entries,p=>(l(),o(u,{key:p.id},[a(`tr`,null,[a(`td`,Oe,[e(_e,{entry:p,muted:n.key===`memoriam`},null,8,[`entry`,`muted`])]),(l(!0),o(u,null,s(T[n.key],([e])=>(l(),o(`td`,{key:e,class:i([`px-3 py-2.5 whitespace-nowrap`,{"tabular-nums":e===`date`||e===`lifespan`}])},f(U(p,e,n.key)),3))),128)),_.canManage&&!n.automatic?(l(),o(`td`,ke,[e(r(D),null,{default:d(()=>[e(r(E),{"as-child":``},{default:d(()=>[e(r(H),{variant:`ghost`,size:`icon`,class:`size-8 text-muted-foreground`,"aria-label":`Aktionen für ${p.name}`},{default:d(()=>[e(r(ee))]),_:1},8,[`aria-label`])]),_:2},1024),e(r(O),{align:`end`},{default:d(()=>[e(r(A),{onSelect:e=>J(n,p)},{default:d(()=>[e(r(L)),c[5]||=t(` Bearbeiten`,-1)]),_:1},8,[`onSelect`]),e(r(A),{class:`text-destructive`,onSelect:e=>Y(p)},{default:d(()=>[e(r(te)),c[6]||=t(` Entfernen`,-1)]),_:1},8,[`onSelect`])]),_:2},1024)]),_:2},1024)])):g(``,!0)]),p.text?(l(),o(`tr`,$,[a(`td`,{colspan:T[n.key].length+2,class:i([`-mt-1 px-5 pb-3 text-[13px] text-muted-foreground`,{italic:n.key===`memoriam`}])},f(p.text),11,Ae)])):g(``,!0)],64))),128))])])])):(l(),o(`p`,je,`Noch keine Einträge in diesem Monat.`))],2))),128))])):(l(),o(`div`,Me,[e(B,{icon:r(w),title:`Keine Einträge in diesem Monat`,text:`Hier stehen neue Kolleginnen und Kollegen, Wechsel, Geburtstage, Jubiläen, Verabschiedungen und Gedenken.`},null,8,[`icon`])])),_.canManage?(l(),p(fe,{key:2,open:K.value.open,"onUpdate:open":c[0]||=e=>K.value.open=e,section:K.value.section,entry:K.value.entry,month:_.month},null,8,[`open`,`section`,`entry`,`month`])):g(``,!0)]),_:1}))}};export{Ne as default};