diff --git a/public/js/apps/Cis/Stundenplan.js b/public/js/apps/Cis/Stundenplan.js index 933bd39f7..edbb21cdf 100644 --- a/public/js/apps/Cis/Stundenplan.js +++ b/public/js/apps/Cis/Stundenplan.js @@ -121,10 +121,19 @@ const app = Vue.createApp({ diff --git a/public/js/components/Calendar/Day/Page.js b/public/js/components/Calendar/Day/Page.js index b14025e5b..3b0465a96 100644 --- a/public/js/components/Calendar/Day/Page.js +++ b/public/js/components/Calendar/Day/Page.js @@ -1,13 +1,21 @@ import CalendarDate from '../../../composables/CalendarDate.js'; +import LvMenu from "../../../components/Cis/Mylv/LvMenu.js" +import LvInfo from "../../../components/Cis/Mylv/LvInfo.js" function ggt(m, n) { return n == 0 ? m : ggt(n, m % n); } function kgv(m, n) { return (m * n) / ggt(m, n); } export default { + components:{ + LvMenu, + LvInfo, + }, data() { return { hourPosition: null, hourPositionTime: null, + lvMenu:null, + selectedEvent: null, } }, inject: [ @@ -88,6 +96,24 @@ export default { }, }, methods: { + eventClick(evt) { + let event = evt.orig; + this.selectedEvent = event; + if (event.type == 'lehreinheit') { + this.$fhcApi.factory.stundenplan.getLehreinheitStudiensemester(event.lehreinheit_id[0]).then( + res => res.data + ).then( + studiensemester_kurzbz => { + this.$fhcApi.factory.addons.getLvMenu(event.lehrveranstaltung_id, studiensemester_kurzbz).then(res => { + if (res.data) { + this.lvMenu = res.data; + } + }); + } + ) + } + this.$emit('input', event); + }, calcHourPosition(event) { let height = this.$refs.eventcontainer.getBoundingClientRect().height; let top = this.$refs.eventcontainer.getBoundingClientRect().top; @@ -149,8 +175,8 @@ export default { }, template: /*html*/`
-
-
+
+
@@ -166,12 +192,12 @@ export default {

Keine Lehrveranstaltungen

- +
{{hour}}:00
-
+

this is a placeholder which means that no template was passed to the Calendar Page slot

@@ -180,13 +206,16 @@ export default {
- +
-
-
-

other content goes in here

+
+
+
+ +
+
diff --git a/public/js/components/Cis/Mylv/LvInfo.js b/public/js/components/Cis/Mylv/LvInfo.js new file mode 100644 index 000000000..829850cbc --- /dev/null +++ b/public/js/components/Cis/Mylv/LvInfo.js @@ -0,0 +1,96 @@ +import { numberPadding, formatDate } from "../../../helpers/DateHelpers.js" + + +export default { + props: { + event: Object, + titel: String, + }, + data() { + return { + + } + }, + computed: { + start_time: function () { + if (!this.event.start) return 'N/A'; + if (!this.event.start instanceof Date) { + return this.event.start; + } + return numberPadding(this.event.start.getHours()) + ":" + numberPadding(this.event.start.getMinutes()); + }, + end_time: function () { + if (!this.event.end) return 'N/A'; + if (!this.event.end instanceof Date) { + return this.event.end; + } + return numberPadding(this.event.end.getHours()) + ":" + numberPadding(this.event.end.getMinutes()); + } + }, + methods: { + mehtodNumberPadding: function (number) { + return numberPadding(number); + }, + methodFormatDate: function (d) { + return formatDate(d); + }, + }, + template:/*html*/` +
+

{{titel}}

+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
{{ + $p.t('global','datum')? + $p.t('global','datum')+':' + :'' + }}{{methodFormatDate(event.datum)}}
{{ + $p.t('global','raum')? + $p.t('global','raum')+':' + :'' + }}{{event.ort_kurzbz}}
{{ + $p.t('lehre','lehrveranstaltung')? + $p.t('lehre','lehrveranstaltung')+':' + :'' + }}{{'('+event.lehrform+') ' + event.lehrfach_bez}}
{{ + $p.t('lehre','lektor')? + $p.t('lehre','lektor')+':' + :'' + }}{{event.lektor.map(lektor=>lektor.kurzbz).join("/")}}
{{ + $p.t('ui','zeitraum')? + $p.t('ui','zeitraum')+':' + :'' + }}{{start_time + ' - ' + end_time}}
{{ + $p.t('lehre','organisationseinheit')? + $p.t('lehre','organisationseinheit')+':' + :'' + }}{{event.organisationseinheit}}
+
+ ` +} + diff --git a/public/js/components/Cis/Mylv/LvMenu.js b/public/js/components/Cis/Mylv/LvMenu.js index d5e091f31..0bbad589f 100644 --- a/public/js/components/Cis/Mylv/LvMenu.js +++ b/public/js/components/Cis/Mylv/LvMenu.js @@ -5,6 +5,7 @@ export default { type:Array, default:null, }, + titel:String, }, data(){ return{ @@ -34,14 +35,17 @@ export default { }, template:/*html*/`
No Menu available
-
-
-
- - - {{menuItem.name}} - {{text}} - + diff --git a/public/js/components/Cis/Mylv/LvModal.js b/public/js/components/Cis/Mylv/LvModal.js index 84eedbf92..fcffdeb5c 100644 --- a/public/js/components/Cis/Mylv/LvModal.js +++ b/public/js/components/Cis/Mylv/LvModal.js @@ -1,13 +1,14 @@ import BsModal from "../../Bootstrap/Modal.js"; import Alert from "../../Bootstrap/Alert.js"; import LvMenu from "./LvMenu.js" -import { numberPadding,formatDate } from "../../../helpers/DateHelpers.js" +import LvInfo from "./LvInfo.js" export default { components: { BsModal, Alert, LvMenu, + LvInfo, }, mixins: [BsModal], props: { @@ -35,31 +36,7 @@ export default { info: null, }; }, - computed: { - start_time: function(){ - if(!this.event.start) return 'N/A'; - if (!this.event.start instanceof Date){ - return this.event.start; - } - return numberPadding(this.event.start.getHours()) + ":" + numberPadding(this.event.start.getMinutes()); - }, - end_time: function(){ - if (!this.event.end) return 'N/A'; - if (!this.event.end instanceof Date) { - return this.event.end; - } - return numberPadding(this.event.end.getHours()) + ":" + numberPadding(this.event.end.getMinutes()); - } - }, methods:{ - mehtodNumberPadding: function(number) - { - return numberPadding(number); - }, - methodFormatDate: function(d) - { - return formatDate(d); - }, onModalShow: function() { if (this.event.type == 'lehreinheit') { @@ -90,63 +67,8 @@ export default {