From 8bda0f2f96ee92a98b2838eded83016f0290be62 Mon Sep 17 00:00:00 2001 From: SimonGschnell Date: Wed, 17 Jan 2024 15:34:53 +0100 Subject: [PATCH] first template for the functionality to add a new kontakt/address --- public/css/components/Profil.css | 10 +++- .../components/Cis/Profil/EditProfilSelect.js | 60 ++++++++++++++++--- .../components/Cis/Profil/ProfilComponents.js | 18 +++++- 3 files changed, 77 insertions(+), 11 deletions(-) diff --git a/public/css/components/Profil.css b/public/css/components/Profil.css index 797504786..4ca104dc8 100644 --- a/public/css/components/Profil.css +++ b/public/css/components/Profil.css @@ -77,7 +77,15 @@ padding-left: 0.5rem; } - +.btn-circle { + width: 30px; + height: 30px; + padding: 6px 0px; + border-radius: 15px; + text-align: center; + font-size: 12px; + line-height: 1.42857; +} diff --git a/public/js/components/Cis/Profil/EditProfilSelect.js b/public/js/components/Cis/Profil/EditProfilSelect.js index 1fad1ca92..8e20058bb 100644 --- a/public/js/components/Cis/Profil/EditProfilSelect.js +++ b/public/js/components/Cis/Profil/EditProfilSelect.js @@ -43,16 +43,48 @@ export default { view:null, data:null, breadcrumbItems:[], + topic:null, } }, methods: { + addItem: function(){ + + this.view= this.topic == "Private Kontakte"?"EditKontakt":"EditAdresse" ; + console.log(this.view); + //? updates the topic when a Kontakt or an Address should be added + this.topic = this.topic == "Private Kontakte"?"Add Kontakte":"Add Adressen" + this.$emit('update:topic',this.topic); + + + + this.data= this.view=="EditAdresse"? + { + adresse_id: "to be defined", + strasse: "", + adr_typ: "", + plz: "", + ort: "" + }: + { + kontakt_id: "to be defined", + kontakttyp: "", + kontakt: "", + anmerkung: "", + zustellung: false + } + console.log(this.data); + + }, + deleteItem: function(item){ this.$emit('update:profilUpdate',item.data); //? updates the topic when a Kontakt or an Address should be deleted - this.$emit('update:topic',item.data.kontakt?"Delete Kontakte":"Delete Adressen"); + this.topic = item.data.kontakt?"Delete Kontakte":"Delete Adressen"; + this.$emit('update:topic',this.topic); + this.$emit('submit'); }, @@ -68,7 +100,8 @@ export default { if(item.title){ //? emits the selected topic to the parent component - this.$emit('update:topic',item.title); + this.topic= item.title; + this.$emit('update:topic',this.topic); //? emits the new item for the breadcrumb in the parent component this.breadcrumbItems.push(item.title); @@ -99,21 +132,32 @@ export default { }, template: ` + - -
-