Files
miriamgemeinde/public/assets/WorshipLeaderAdministration-CNLQ0jVC.js
Torsten Schulz (local) 7156cc141a
All checks were successful
Deploy miriamgemeinde / deploy (push) Successful in 7s
Update asset references in index.html: Change script and stylesheet links to new hashed filenames for improved caching and performance.
2026-04-29 18:32:22 +02:00

2 lines
3.5 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{E as e,M as t,c as n,ct as r,d as i,i as a,m as o,t as s,u as c,w as l}from"./_plugin-vue_export-helper-Conii5fq.js";import{a as u,c as d,r as f}from"./runtime-dom.esm-bundler-CI28bPhn.js";import{r as p}from"./router-CLi6dkmN.js";var m={name:`WorshipLeaderAdministration`,data(){return{leaders:[],includeInactive:!1,currentLeader:{code:``,name:``,aliases:``,active:!0},isCreating:!0}},computed:{formTitle(){return this.isCreating?`Kürzel anlegen`:`Kürzel bearbeiten`}},methods:{async fetchLeaders(){try{this.leaders=(await p.get(`/worship-leaders`,{params:{includeInactive:+!!this.includeInactive}})).data||[]}catch(e){console.error(`Fehler beim Abrufen der Kürzel:`,e)}},async saveLeader(){try{this.isCreating?await p.post(`/worship-leaders`,this.currentLeader):await p.put(`/worship-leaders/${this.currentLeader.id}`,this.currentLeader),this.resetForm(),await this.fetchLeaders()}catch(e){let t=e.response?.data?.message||e.message;alert(`Fehler: ${t}`)}},editLeader(e){this.currentLeader={...e},this.isCreating=!1},async deleteLeader(e){if(confirm(`Kürzel "${e.code}" wirklich löschen?`))try{await p.delete(`/worship-leaders/${e.id}`),await this.fetchLeaders()}catch(e){console.error(`Fehler beim Löschen:`,e)}},resetForm(){this.currentLeader={code:``,name:``,aliases:``,active:!0},this.isCreating=!0}},mounted(){this.fetchLeaders()}},h={class:`worship-leader-admin`},g={class:`row`},_={type:`submit`},v={class:`list`},y={class:`tools`},b={key:0},x=[`onClick`],S={key:0},C={key:1},w=[`onClick`],T={key:1};function E(s,p,m,E,D,O){return l(),i(`div`,h,[p[14]||=n(`h1`,null,`Gestalter (Kürzel)`,-1),n(`h2`,null,r(O.formTitle),1),n(`form`,{onSubmit:p[5]||=d((...e)=>O.saveLeader&&O.saveLeader(...e),[`prevent`])},[p[9]||=n(`label`,{for:`code`},`Kürzel (z.B. "Eif"):`,-1),t(n(`input`,{id:`code`,"onUpdate:modelValue":p[0]||=e=>D.currentLeader.code=e,required:``},null,512),[[u,D.currentLeader.code]]),p[10]||=n(`label`,{for:`name`},`Name (wird als Gestalter gespeichert):`,-1),t(n(`input`,{id:`name`,"onUpdate:modelValue":p[1]||=e=>D.currentLeader.name=e,required:``},null,512),[[u,D.currentLeader.name]]),p[11]||=n(`label`,{for:`aliases`},`Aliase (kommagetrennt):`,-1),t(n(`input`,{id:`aliases`,"onUpdate:modelValue":p[2]||=e=>D.currentLeader.aliases=e},null,512),[[u,D.currentLeader.aliases]]),n(`div`,g,[p[8]||=n(`label`,{for:`active`},`Aktiv:`,-1),t(n(`input`,{id:`active`,"onUpdate:modelValue":p[3]||=e=>D.currentLeader.active=e,type:`checkbox`},null,512),[[f,D.currentLeader.active]])]),n(`button`,_,r(D.isCreating?`Erstellen`:`Aktualisieren`),1),D.isCreating?c(``,!0):(l(),i(`button`,{key:0,type:`button`,onClick:p[4]||=(...e)=>O.resetForm&&O.resetForm(...e)},`Abbrechen`))],32),n(`div`,v,[p[13]||=n(`h2`,null,`Vorhandene Kürzel`,-1),n(`div`,y,[n(`label`,null,[t(n(`input`,{type:`checkbox`,"onUpdate:modelValue":p[6]||=e=>D.includeInactive=e,onChange:p[7]||=(...e)=>O.fetchLeaders&&O.fetchLeaders(...e)},null,544),[[f,D.includeInactive]]),p[12]||=o(` Inaktive anzeigen`,-1)])]),D.leaders.length?(l(),i(`ul`,b,[(l(!0),i(a,null,e(D.leaders,e=>(l(),i(`li`,{key:e.id,class:`item`},[n(`button`,{type:`button`,class:`link`,onClick:t=>O.editLeader(e)},[n(`strong`,null,r(e.code),1),o(` `+r(e.name)+` `,1),e.aliases?(l(),i(`span`,S,` (`+r(e.aliases)+`)`,1)):c(``,!0),e.active?c(``,!0):(l(),i(`span`,C,` [inaktiv]`))],8,x),n(`button`,{type:`button`,class:`danger`,onClick:t=>O.deleteLeader(e)},`Löschen`,8,w)]))),128))])):(l(),i(`p`,T,`Keine Einträge.`))])])}var D=s(m,[[`render`,E],[`__scopeId`,`data-v-46ecca06`]]);export{D as default};
//# sourceMappingURL=WorshipLeaderAdministration-CNLQ0jVC.js.map