feature(News-StudiengangsInformationen): adds the Studiengangsinformationen next to the news view

This commit is contained in:
SimonGschnell
2024-12-04 15:04:05 +01:00
parent f7bc01e63f
commit ecbb65c2a4
6 changed files with 44 additions and 8 deletions
+11 -1
View File
@@ -1,8 +1,10 @@
import Pagination from "../../Pagination/Pagination.js";
import StudiengangInformation from "./StudiengangInformation/StudiengangInformation.js";
export default {
components: {
Pagination,
StudiengangInformation,
},
data() {
return {
@@ -39,6 +41,14 @@ export default {
<hr/>
<pagination :page_size="page_size" @page="loadNewPageContent" :maxPageCount="maxPageCount">
</pagination>
<div v-html="content"></div>
<div class="container-xxl">
<div class="row">
<div class="col-12 col-md-8 col-xl-9" v-html="content">
</div>
<div class="col-12 col-md-4 col-xl-3">
<studiengang-information></studiengang-information>
</div>
</div>
</div>
`,
};
@@ -18,14 +18,32 @@ components:{
StudiengangPerson
},
template:/*html*/`
<template v-if="studiengang?.bezeichnung && semester">
<h5>Studiengang: {{studiengang.bezeichnung}}</h5>
<h5>Semester: {{semester}}</h5>
</template>
<template v-for="{title, collection} in collection_array">
<h3 v-if="Array.isArray(collection) && collection.length !==0">{{title}}</h3>
<h5 v-if="Array.isArray(collection) && collection.length !==0">{{title}}</h5>
<template v-for="person in studiengangs_person_data(collection)">
<div class="mb-3">
<studiengang-person :person_data="person"></studiengang-person>
</div>
</template>
</template>
<div v-if="studiengang?.zusatzinfo_html" v-html="studiengang?.zusatzinfo_html"></div>
<template v-if="hochschulvertr && Array.isArray(hochschulvertr) && hochschulvertr.length >0">
<h5>Hochschulvertretung</h5>
<p v-for="vertretung in hochschulvertr">{{vertretungFormatedName(vertretung)}}</p>
</template>
<template v-if="stdv && Array.isArray(stdv) && stdv.length >0">
<h5>Studienvertretung {{studiengang.kurzbzlang??''}}</h5>
<p v-for="vertretung in stdv">{{vertretungFormatedName(vertretung,false)}}</p>
</template>
<template v-if="jahrgangsvertr && Array.isArray(jahrgangsvertr) && jahrgangsvertr.length >0">
<h5>Jahrgangsvertretung</h5>
<p v-for="vertretung in jahrgangsvertr">{{vertretungFormatedName(vertretung,false)}}</p>
</template>
`,
computed:{
collection_array: function(){
@@ -48,6 +66,10 @@ computed:{
},
},
methods:{
vertretungFormatedName: function(vertretung,bezeichnung=true){
if(!vertretung) return null;
return `${vertretung.vorname ?? ''} ${vertretung.nachname ?? ''} ${vertretung.bezeichnung && bezeichnung ? '('.concat(vertretung.bezeichnung.replace("(","").replace(")","")).concat(")") : ''}`
},
studiengangs_person_data: function (collection) {
// early return if the reactive data is not yet loaded or not present
if (!collection || !Array.isArray(collection) || collection.length === 0)
@@ -110,6 +132,7 @@ mounted(){
.then(res => res.data)
.then(studiengangInformationen => {
Object.assign(this, studiengangInformationen);
console.log(studiengangInformationen,"das sind die Informationen")
});
},
@@ -25,7 +25,7 @@ export default {
<img :src="person_data.foto" alt="person_dataFoto" style="width: 110px; height: auto; object-fir:scale-down;" class="card-img-top" >
</div>
<div class="card-body">
<h5 class="text-center card-title mb-0">{{person_data.fullname}}</h5>
<h6 class="text-center card-title mb-0">{{person_data.fullname}}</h6>
</div>
<hr class="my-0">
<div class="card-body">