2 lines
7.1 KiB
JavaScript
2 lines
7.1 KiB
JavaScript
"use strict";(self["webpackChunkmiriamgemeinde"]=self["webpackChunkmiriamgemeinde"]||[]).push([[79],{2577:function(e,t,i){var a=i(6518),n=i(2652),o=i(9306),r=i(8551),s=i(1767);a({target:"Iterator",proto:!0,real:!0},{find:function(e){r(this),o(e);var t=s(this),i=0;return n(t,(function(t,a){if(e(t,i++))return a(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},4079:function(e,t,i){i.r(t),i.d(t,{default:function(){return x}});var a=i(641),n=i(3751),o=i(33);const r=e=>((0,a.Qi)("data-v-2ed82a8f"),e=e(),(0,a.jt)(),e),s={class:"worship-management"},l=r((()=>(0,a.Lk)("h2",null,"Gottesdienst Verwaltung",-1))),d=r((()=>(0,a.Lk)("label",{for:"eventPlaceId"},"Veranstaltungsort:",-1))),h=r((()=>(0,a.Lk)("label",{for:"date"},"Datum:",-1))),c=r((()=>(0,a.Lk)("label",{for:"dayName"},"Name des Tags:",-1))),u=r((()=>(0,a.Lk)("label",{for:"time"},"Uhrzeit:",-1))),p=r((()=>(0,a.Lk)("label",{for:"title"},"Titel:",-1))),m=r((()=>(0,a.Lk)("label",{for:"organizer"},"Gestalter:",-1))),f=r((()=>(0,a.Lk)("label",{for:"sacristanService"},"Küsterdienst:",-1))),w=r((()=>(0,a.Lk)("label",{for:"collection"},"Kollekte:",-1))),b=r((()=>(0,a.Lk)("label",{for:"address"},"Adresse:",-1))),v=r((()=>(0,a.Lk)("label",{for:"selfInformation"},"Selbstinformation:",-1))),k=r((()=>(0,a.Lk)("label",{for:"highlightTime"},"Uhrzeit hervorheben:",-1))),g=r((()=>(0,a.Lk)("label",{for:"neighborInvitation"},"Einladung zum Nachbarschaftsraum:",-1))),D=r((()=>(0,a.Lk)("label",{for:"introLine"},"Einleitungszeile:",-1))),L=r((()=>(0,a.Lk)("button",{type:"submit"},"Speichern",-1))),y=["onClick"],I=["onClick"],P={class:"tooltip"};function E(e,t,i,r,E,U){const V=(0,a.g2)("multiselect");return(0,a.uX)(),(0,a.CE)("div",s,[l,(0,a.Lk)("form",{onSubmit:t[14]||(t[14]=(0,n.D$)(((...e)=>U.saveWorship&&U.saveWorship(...e)),["prevent"]))},[d,(0,a.bF)(V,{modelValue:E.selectedEventPlace,"onUpdate:modelValue":t[0]||(t[0]=e=>E.selectedEventPlace=e),options:E.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=>E.worshipData.date=e),required:""},null,512),[[n.Jo,E.worshipData.date]]),c,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"dayName","onUpdate:modelValue":t[2]||(t[2]=e=>E.worshipData.dayName=e),required:""},null,512),[[n.Jo,E.worshipData.dayName]]),u,(0,a.bo)((0,a.Lk)("input",{type:"time",id:"time","onUpdate:modelValue":t[3]||(t[3]=e=>E.worshipData.time=e),required:""},null,512),[[n.Jo,E.worshipData.time]]),p,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"title","onUpdate:modelValue":t[4]||(t[4]=e=>E.worshipData.title=e),required:""},null,512),[[n.Jo,E.worshipData.title]]),m,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"organizer","onUpdate:modelValue":t[5]||(t[5]=e=>E.worshipData.organizer=e)},null,512),[[n.Jo,E.worshipData.organizer]]),f,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"sacristanService","onUpdate:modelValue":t[6]||(t[6]=e=>E.worshipData.sacristanService=e)},null,512),[[n.Jo,E.worshipData.sacristanService]]),w,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"collection","onUpdate:modelValue":t[7]||(t[7]=e=>E.worshipData.collection=e)},null,512),[[n.Jo,E.worshipData.collection]]),b,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"address","onUpdate:modelValue":t[8]||(t[8]=e=>E.worshipData.address=e)},null,512),[[n.Jo,E.worshipData.address]]),v,(0,a.bo)((0,a.Lk)("input",{type:"checkbox",id:"selfInformation","onUpdate:modelValue":t[9]||(t[9]=e=>E.worshipData.selfInformation=e)},null,512),[[n.lH,E.worshipData.selfInformation]]),k,(0,a.bo)((0,a.Lk)("input",{type:"checkbox",id:"highlightTime","onUpdate:modelValue":t[10]||(t[10]=e=>E.worshipData.highlightTime=e)},null,512),[[n.lH,E.worshipData.highlightTime]]),g,(0,a.bo)((0,a.Lk)("input",{type:"checkbox",id:"neighborInvitation","onUpdate:modelValue":t[11]||(t[11]=e=>E.worshipData.neighborInvitation=e)},null,512),[[n.lH,E.worshipData.neighborInvitation]]),D,(0,a.bo)((0,a.Lk)("input",{type:"text",id:"introLine","onUpdate:modelValue":t[12]||(t[12]=e=>E.worshipData.introLine=e)},null,512),[[n.Jo,E.worshipData.introLine]]),L,(0,a.Lk)("button",{type:"button",onClick:t[13]||(t[13]=(...e)=>U.resetForm&&U.resetForm(...e))},"Neuer Gottesdienst")],32),(0,a.Lk)("ul",null,[((0,a.uX)(!0),(0,a.CE)(a.FK,null,(0,a.pI)(E.worships,(e=>((0,a.uX)(),(0,a.CE)("li",{key:e.id,class:(0,o.C4)(U.dateIsLowerCurrentDate(e.date)?"old-items":"")},[(0,a.Lk)("span",null,(0,o.v_)(e.title)+" - "+(0,o.v_)(U.formatDate(e.date))+", "+(0,o.v_)(U.formatTime(e.time)),1),(0,a.Lk)("button",{onClick:t=>U.editWorship(e)},"Bearbeiten",8,y),(0,a.Lk)("button",{onClick:t=>U.deleteWorship(e.id)},"Löschen",8,I),(0,a.Lk)("div",P,(0,o.v_)(U.getEventPlaceName(e.eventPlaceId)),1)],2)))),128))])])}i(8992),i(2577);var U=i(4335),V=i(5877),S=i(9654),C={name:"WorshipManagement",components:{Multiselect:V.Ay},data(){return{worships:[],eventPlaces:[],worshipData:{eventPlaceId:null,date:"",time:"",title:"",organizer:"",collection:"",address:"",selfInformation:!1,highlightTime:!1,neighborInvitation:!1,introLine:"",sacristanService:"",website:""},selectedEventPlace:null,editMode:!1,editId:null}},async created(){await this.fetchEventPlaces(),await this.fetchWorships()},methods:{formatTime:S.fU,formatDate:S.Yq,async fetchWorships(){try{const e=await U.A.get("/worships");this.worships=e.data}catch(e){console.error("Fehler beim Abrufen der Gottesdienste:",e)}},async fetchEventPlaces(){try{const e=await U.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 U.A.put(`/worships/${this.editId}`,e):await U.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.worshipData.date=(0,S.Yq)(e.date).split(".").reverse().join("-"),this.worshipData.time=(0,S.fU)(e.time),console.log(this.worshipData),this.selectedEventPlace=this.eventPlaces.find((t=>t.id===e.eventPlaceId)),this.editMode=!0,this.editId=e.id},async deleteWorship(e){try{await U.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"},dateIsLowerCurrentDate(e){const t=new Date,i=new Date(e);return i<t}}},T=i(6262);const W=(0,T.A)(C,[["render",E],["__scopeId","data-v-2ed82a8f"]]);var x=W},9654: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}})}}]);
|
|
//# sourceMappingURL=79.442cb82b.js.map
|