Files
miriamgemeinde/public/js/187.83b148e8.js

2 lines
3.8 KiB
JavaScript

"use strict";(self["webpackChunkmiriamgemeinde"]=self["webpackChunkmiriamgemeinde"]||[]).push([[187],{8187:function(e,t,n){n.r(t),n.d(t,{default:function(){return C}});var l=n(641),a=n(3751),i=n(33);const d=e=>((0,l.Qi)("data-v-4e6631f7"),e=e(),(0,l.jt)(),e),c={class:"event-places-management"},o=d((()=>(0,l.Lk)("h2",null,"Veranstaltungsorte verwalten",-1))),r=d((()=>(0,l.Lk)("label",{for:"name"},"Name:",-1))),s=d((()=>(0,l.Lk)("label",{for:"street"},"Straße:",-1))),u=d((()=>(0,l.Lk)("label",{for:"zipcode"},"PLZ:",-1))),p=d((()=>(0,l.Lk)("label",{for:"city"},"Stadt:",-1))),v=d((()=>(0,l.Lk)("label",{for:"city"},"Webseite:",-1))),k=d((()=>(0,l.Lk)("label",{for:"backgroundColor"},"Hintergrundfarbe:",-1))),h=d((()=>(0,l.Lk)("button",{type:"submit"},"Speichern",-1))),b=d((()=>(0,l.Lk)("thead",null,[(0,l.Lk)("tr",null,[(0,l.Lk)("th",null,"Name"),(0,l.Lk)("th",null,"Bearbeiten"),(0,l.Lk)("th",null,"Löschen")])],-1))),P=["onClick"],f=["onClick"];function E(e,t,n,d,E,m){return(0,l.uX)(),(0,l.CE)("div",c,[o,(0,l.Lk)("form",{onSubmit:t[7]||(t[7]=(0,a.D$)(((...e)=>m.addEventPlace&&m.addEventPlace(...e)),["prevent"]))},[r,(0,l.bo)((0,l.Lk)("input",{type:"text",id:"name","onUpdate:modelValue":t[0]||(t[0]=e=>E.newEventPlace.name=e),placeholder:"Name",required:""},null,512),[[a.Jo,E.newEventPlace.name]]),s,(0,l.bo)((0,l.Lk)("input",{type:"text",id:"street","onUpdate:modelValue":t[1]||(t[1]=e=>E.newEventPlace.street=e),placeholder:"Straße",required:""},null,512),[[a.Jo,E.newEventPlace.street]]),u,(0,l.bo)((0,l.Lk)("input",{type:"text",id:"zipcode","onUpdate:modelValue":t[2]||(t[2]=e=>E.newEventPlace.zipcode=e),placeholder:"PLZ",required:""},null,512),[[a.Jo,E.newEventPlace.zipcode]]),p,(0,l.bo)((0,l.Lk)("input",{type:"text",id:"city","onUpdate:modelValue":t[3]||(t[3]=e=>E.newEventPlace.city=e),placeholder:"Stadt",required:""},null,512),[[a.Jo,E.newEventPlace.city]]),v,(0,l.bo)((0,l.Lk)("input",{type:"text",id:"website","onUpdate:modelValue":t[4]||(t[4]=e=>E.newEventPlace.website=e),placeholder:"Webseite",required:""},null,512),[[a.Jo,E.newEventPlace.website]]),k,(0,l.bo)((0,l.Lk)("input",{type:"color",id:"backgroundColor","onUpdate:modelValue":t[5]||(t[5]=e=>E.newEventPlace.backgroundColor=e)},null,512),[[a.Jo,E.newEventPlace.backgroundColor]]),h,E.editMode?((0,l.uX)(),(0,l.CE)("button",{key:0,type:"button",onClick:t[6]||(t[6]=(...e)=>m.resetForm&&m.resetForm(...e))},"Neuen Veranstaltungsort erstellen")):(0,l.Q3)("",!0)],32),(0,l.Lk)("table",null,[b,(0,l.Lk)("tbody",null,[((0,l.uX)(!0),(0,l.CE)(l.FK,null,(0,l.pI)(E.eventPlaces,(e=>((0,l.uX)(),(0,l.CE)("tr",{key:e.id},[(0,l.Lk)("td",null,(0,i.v_)(e.name),1),(0,l.Lk)("td",null,[(0,l.Lk)("button",{onClick:t=>m.editEventPlace(e)},"Bearbeiten",8,P)]),(0,l.Lk)("td",null,[(0,l.Lk)("button",{onClick:t=>m.deleteEventPlace(e.id)},"Löschen",8,f)])])))),128))])])])}n(4114);var m=n(4335),w={data(){return{eventPlaces:[],newEventPlace:{name:"",street:"",zipcode:"",city:"",backgroundColor:"#ffffff",website:""},editMode:!1,editId:null}},methods:{async fetchEventPlaces(){const e=await m.A.get("/event-places");this.eventPlaces=e.data},async addEventPlace(){if(this.editMode)await m.A.put(`/event-places/${this.editId}`,this.newEventPlace);else{const e=await m.A.post("/event-places",this.newEventPlace);this.eventPlaces.push(e.data)}this.resetForm(),await this.fetchEventPlaces()},async updateEventPlace(e){await m.A.put(`/event-places/${e.id}`,e),this.fetchEventPlaces()},async deleteEventPlace(e){await m.A.delete(`/event-places/${e}`),this.fetchEventPlaces()},editEventPlace(e){this.newEventPlace={...e},this.editMode=!0,this.editId=e.id},resetForm(){this.newEventPlace={name:"",street:"",zipcode:"",city:"",backgroundColor:"#ffffff",website:""},this.editMode=!1,this.editId=null}},created(){this.fetchEventPlaces()}},L=n(6262);const y=(0,L.A)(w,[["render",E],["__scopeId","data-v-4e6631f7"]]);var C=y}}]);
//# sourceMappingURL=187.83b148e8.js.map