mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-16 22:42:16 +00:00
changes the data format from the studierendenEmail api call and displays the mailto on the modal
This commit is contained in:
@@ -57,6 +57,11 @@ class Lehre extends FHCAPI_Controller
|
||||
|
||||
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
|
||||
|
||||
//convert array of objects into array of strings
|
||||
$studentenMails = array_map(function($element){
|
||||
return $element->mail;
|
||||
}, $studentenMails);
|
||||
|
||||
$this->terminateWithSuccess($studentenMails);
|
||||
}
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@ export default {
|
||||
lehreinheit:null,
|
||||
stg:null,
|
||||
lv:null,
|
||||
emailAnStudierende:null,
|
||||
|
||||
result: false,
|
||||
}
|
||||
@@ -26,11 +27,11 @@ export default {
|
||||
},
|
||||
methods:{
|
||||
showModal: function(){
|
||||
|
||||
this.$fhcApi.factory.lehre.getStudentenMail(this.event.lehreinheit_id).then(res =>
|
||||
{
|
||||
console.log(res.data,"API response");
|
||||
});
|
||||
{
|
||||
// prepare the mailto link with all the emails from the students of the lv
|
||||
this.emailAnStudierende = "mailto:"+res.data.join(",");
|
||||
});
|
||||
},
|
||||
},
|
||||
mounted(){
|
||||
@@ -40,7 +41,9 @@ export default {
|
||||
template:/*html*/`
|
||||
<bs-modal @showBsModal="showModal" ref="modalContainer" dialogClass="modal-lg">
|
||||
<template #title>
|
||||
<p>{{JSON.stringify(event,null,2)}}</p>
|
||||
|
||||
<p>{{JSON.stringify(emailAnStudierende,null,2)}}</p>
|
||||
<p>{{JSON.stringify(event,null,2)}}</p>
|
||||
<!--<span v-if="lv ">
|
||||
{{lv + (stg?' / ' + stg:'')}}
|
||||
</span>
|
||||
@@ -51,8 +54,14 @@ export default {
|
||||
<template #default>
|
||||
<div :style="{'display':'grid', 'row-gap':'10px', 'column-gap':'10px', 'grid-template-columns':'repeat(3,minmax(100px,1fr))', 'grid-template-rows':'repeat('+Math.ceil(items.length / 3)+',minmax(100px,1fr))'} ">
|
||||
<div class="d-flex flex-column align-items-center justify-content-center" v-for="item in items" :key="item">
|
||||
<span>{{item}}</span>
|
||||
<i class="fa fa-file"></i>
|
||||
<a v-if="item=='E-mail'" :href="emailAnStudierende">
|
||||
<span>{{item}}</span>
|
||||
<i class="fa fa-file"></i>
|
||||
</a>
|
||||
<a v-else :href="#">
|
||||
<span>{{item}}</span>
|
||||
<i class="fa fa-file"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user