diff --git a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js index 4eabf82c6..82d8f6382 100644 --- a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js +++ b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangInformation.js @@ -15,31 +15,47 @@ data(){ jahrgangsvertr: null, } }, +props:{ + displayWidget:{ + type:Boolean, + default:false, + } +}, components:{ StudiengangPerson, StudiengangVertretung, }, template:/*html*/` - - Studiengang: + Studiengang: {{studiengang.bezeichnung}} - Semester: + Semester: {{semester}} - {{title}} - - - - + + {{title}} + + + + + + + + + + + + + + @@ -54,8 +70,31 @@ template:/*html*/` `, computed:{ + // this function concatenates the studiengangsleitung and the assistenz or the + // geschaeftsfuehrende-Stellvertretende Leitung if both collections only contain one person collection_array: function(){ - return [{ title: "Studiengangsleitung", collection: this.stg_ltg }, { title: "geschäftsführende Leitung", collection: this.gf_ltg },{ title: "stellvertretende Leitung", collection: this.stv_ltg },{ title: "Sekretariat", collection: this.ass} ]; + let returnData = []; + + if (Array.isArray(this.stg_ltg) && this.stg_ltg.length == 1 && Array.isArray(this.ass) && this.ass.length == 1) + { + returnData.push({ title: "Studiengangsleitung / Assistenz", collection: [...this.stg_ltg, ...this.ass] }); + } + else + { + returnData.push({ title: "Studiengangsleitung", collection: this.stg_ltg }); + returnData.push({ title: "Sekretariat", collection: this.ass }); + } + if (Array.isArray(this.gf_ltg) && this.gf_ltg.length == 1 && Array.isArray(this.stv_ltg) && this.stv_ltg.length == 1) + { + returnData.push({ title: "Geschäftsführende/Stellvertretende Leitung", collection: [...this.gf_ltg, ...this.stv_ltg] }); + } + else + { + returnData.push({ title: "Geschäftsführende Leitung", collection: this.gf_ltg }); + returnData.push({ title: "Stellvertretende Leitung", collection: this.stv_ltg }); + } + + return returnData; }, }, mounted(){ diff --git a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js index 9a077ef82..10e74ef84 100644 --- a/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js +++ b/public/js/components/Cis/Cms/StudiengangInformation/StudiengangPerson.js @@ -1,7 +1,21 @@ export default { - props:["uid","vorname","nachname","titelpre","kontakt","telefonklappe","email","planbezeichnung","foto"], + props:{ + uid:String, + vorname:String, + nachname:String, + titelpre:String, + kontakt:String, + telefoneklappe:String, + email:String, + planbezeichnung:String, + foto:String, + displayWidget:{ + type:Boolean, + default:false, + } + }, template:/*html*/` - + diff --git a/public/js/components/DashboardWidget/Studiengang.js b/public/js/components/DashboardWidget/Studiengang.js new file mode 100644 index 000000000..3542bb523 --- /dev/null +++ b/public/js/components/DashboardWidget/Studiengang.js @@ -0,0 +1,20 @@ +import AbstractWidget from './Abstract.js'; +import StudiengangInformation from '../Cis/Cms/StudiengangInformation/StudiengangInformation.js'; + +export default { + data(){ + return {}; + }, + components:{ + StudiengangInformation, + }, + mixins:[AbstractWidget], + mounted(){ + this.$emit('setConfig', false); + }, + template:/*html*/` + + + + ` +}; \ No newline at end of file