Files
miriamgemeinde/public/js/3459.360d8c09.js
2024-06-24 19:42:30 +00:00

2 lines
6.3 KiB
JavaScript

"use strict";(self["webpackChunkmiriamgemeinde"]=self["webpackChunkmiriamgemeinde"]||[]).push([[3459],{8899:function(e,t,i){function a(e){const[t,i]=e.split(":");return`${t}:${i}`}function n(e){const t={year:"numeric",month:"2-digit",day:"2-digit"};return new Date(e).toLocaleDateString("de-DE",t)}function o(e){const t=new Date(e),i=String(t.getHours()).padStart(2,"0"),a=String(t.getMinutes()).padStart(2,"0");return`${i}:${a}`}i.d(t,{Yq:function(){return n},fU:function(){return a},ry:function(){return o}})},3459:function(e,t,i){i.r(t),i.d(t,{default:function(){return C}});var a=i(6768),n=i(5688),o=i(5187);const l=e=>((0,a.Qi)("data-v-701c5bc9"),e=e(),(0,a.jt)(),e),r={class:"worship-management"},s=l((()=>(0,a.Lk)("h2",null,"Gottesdienst Verwaltung",-1))),d=l((()=>(0,a.Lk)("label",{for:"eventPlaceId"},"Veranstaltungsort:",-1))),h=l((()=>(0,a.Lk)("label",{for:"date"},"Datum:",-1))),c=l((()=>(0,a.Lk)("label",{for:"dayName"},"Name des Tags:",-1))),u=l((()=>(0,a.Lk)("label",{for:"time"},"Uhrzeit:",-1))),p=l((()=>(0,a.Lk)("label",{for:"title"},"Titel:",-1))),m=l((()=>(0,a.Lk)("label",{for:"organizer"},"Gestalter:",-1))),b=l((()=>(0,a.Lk)("label",{for:"collection"},"Kollekte:",-1))),f=l((()=>(0,a.Lk)("label",{for:"address"},"Adresse:",-1))),w=l((()=>(0,a.Lk)("label",{for:"selfInformation"},"Selbstinformation:",-1))),k=l((()=>(0,a.Lk)("label",{for:"highlightTime"},"Uhrzeit hervorheben:",-1))),g=l((()=>(0,a.Lk)("label",{for:"neighborInvitation"},"Einladung zum Nachbarschaftsraum:",-1))),v=l((()=>(0,a.Lk)("label",{for:"introLine"},"Einleitungszeile:",-1))),L=l((()=>(0,a.Lk)("button",{type:"submit"},"Speichern",-1))),D=["onClick"],y=["onClick"],I={class:"tooltip"};function P(e,t,i,l,P,V){const E=(0,a.g2)("multiselect");return(0,a.uX)(),(0,a.CE)("div",r,[s,(0,a.Lk)("form",{onSubmit:t[13]||(t[13]=(0,n.D$)(((...e)=>V.saveWorship&&V.saveWorship(...e)),["prevent"]))},[d,(0,a.bF)(E,{modelValue:P.selectedEventPlace,"onUpdate:modelValue":t[0]||(t[0]=e=>P.selectedEventPlace=e),options:P.eventPlaces,label:"name","track-by":"id",placeholder:"Veranstaltungsort wählen"},null,8,["modelValue","options"]),h,(0,a.bo)((0,a.Lk)("input",{type:"date",id:"date","onUpdate:modelValue":t[1]||(t[1]=e=>P.worshipData.date=e),required:""},null,512),[[n.Jo,P.worshipData.date]]),c,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"dayName","onUpdate:modelValue":t[2]||(t[2]=e=>P.worshipData.dayName=e),required:""},null,512),[[n.Jo,P.worshipData.dayName]]),u,(0,a.bo)((0,a.Lk)("input",{type:"time",id:"time","onUpdate:modelValue":t[3]||(t[3]=e=>P.worshipData.time=e),required:""},null,512),[[n.Jo,P.worshipData.time]]),p,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"title","onUpdate:modelValue":t[4]||(t[4]=e=>P.worshipData.title=e),required:""},null,512),[[n.Jo,P.worshipData.title]]),m,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"organizer","onUpdate:modelValue":t[5]||(t[5]=e=>P.worshipData.organizer=e)},null,512),[[n.Jo,P.worshipData.organizer]]),b,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"collection","onUpdate:modelValue":t[6]||(t[6]=e=>P.worshipData.collection=e)},null,512),[[n.Jo,P.worshipData.collection]]),f,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"address","onUpdate:modelValue":t[7]||(t[7]=e=>P.worshipData.address=e)},null,512),[[n.Jo,P.worshipData.address]]),w,(0,a.bo)((0,a.Lk)("input",{type:"checkbox",id:"selfInformation","onUpdate:modelValue":t[8]||(t[8]=e=>P.worshipData.selfInformation=e)},null,512),[[n.lH,P.worshipData.selfInformation]]),k,(0,a.bo)((0,a.Lk)("input",{type:"checkbox",id:"highlightTime","onUpdate:modelValue":t[9]||(t[9]=e=>P.worshipData.highlightTime=e)},null,512),[[n.lH,P.worshipData.highlightTime]]),g,(0,a.bo)((0,a.Lk)("input",{type:"checkbox",id:"neighborInvitation","onUpdate:modelValue":t[10]||(t[10]=e=>P.worshipData.neighborInvitation=e)},null,512),[[n.lH,P.worshipData.neighborInvitation]]),v,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"introLine","onUpdate:modelValue":t[11]||(t[11]=e=>P.worshipData.introLine=e)},null,512),[[n.Jo,P.worshipData.introLine]]),L,(0,a.Lk)("button",{type:"button",onClick:t[12]||(t[12]=(...e)=>V.resetForm&&V.resetForm(...e))},"Neuer Gottesdienst")],32),(0,a.Lk)("ul",null,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(P.worships,(e=>((0,a.uX)(),(0,a.CE)("li",{key:e.id},[(0,a.Lk)("span",null,(0,o.v_)(e.title)+" - "+(0,o.v_)(V.formatDate(e.date))+", "+(0,o.v_)(V.formatTime(e.time)),1),(0,a.Lk)("button",{onClick:t=>V.editWorship(e)},"Bearbeiten",8,D),(0,a.Lk)("button",{onClick:t=>V.deleteWorship(e.id)},"Löschen",8,y),(0,a.Lk)("div",I,(0,o.v_)(V.getEventPlaceName(e.eventPlaceId)),1)])))),128))])])}var V=i(4373),E=i(8074),U=i(8899),W={name:"WorshipManagement",components:{Multiselect:E.Ay},data(){return{worships:[],eventPlaces:[],worshipData:{eventPlaceId:null,date:"",time:"",title:"",organizer:"",collection:"",address:"",selfInformation:!1,highlightTime:!1,neighborInvitation:!1,introLine:""},selectedEventPlace:null,editMode:!1,editId:null}},async created(){await this.fetchEventPlaces(),await this.fetchWorships()},methods:{formatTime:U.fU,formatDate:U.Yq,async fetchWorships(){try{const e=await V.A.get("/worships");this.worships=e.data}catch(e){console.error("Fehler beim Abrufen der Gottesdienste:",e)}},async fetchEventPlaces(){try{const e=await V.A.get("/event-places");this.eventPlaces=e.data}catch(e){console.error("Fehler beim Abrufen der Veranstaltungsorte:",e)}},async saveWorship(){try{const e={...this.worshipData,eventPlaceId:this.selectedEventPlace?this.selectedEventPlace.id:null};this.editMode?await V.A.put(`/worships/${this.editId}`,e):await V.A.post("/worships",e),this.resetForm(),await this.fetchWorships()}catch(e){console.error("Fehler beim Speichern des Gottesdienstes:",e)}},editWorship(e){this.worshipData={...e},this.selectedEventPlace=this.eventPlaces.find((t=>t.id===e.eventPlaceId)),this.editMode=!0,this.editId=e.id},async deleteWorship(e){try{await V.A.delete(`/worships/${e}`),await this.fetchWorships()}catch(t){console.error("Fehler beim Löschen des Gottesdienstes:",t)}},resetForm(){this.worshipData={eventPlaceId:null,date:"",time:"",title:"",organizer:"",collection:"",address:"",selfInformation:!1,highlightTime:!1,neighborInvitation:!1,introLine:""},this.selectedEventPlace=null,this.editMode=!1,this.editId=null},getEventPlaceName(e){const t=this.eventPlaces.find((t=>t.id===e));return t?t.name:"Unbekannter Ort"}}},z=i(1241);const A=(0,z.A)(W,[["render",P],["__scopeId","data-v-701c5bc9"]]);var C=A}}]);
//# sourceMappingURL=3459.360d8c09.js.map