diff --git a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue index a104d84425d8317091d649ce7b0b88919fdf9c52..eeee1819fb6ecc70c17ec0fa5989224bee183cd1 100644 --- a/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue +++ b/aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue @@ -10,24 +10,19 @@ import SubjectChipSelectField from "aleksis.apps.cursus/components/SubjectChipSe <div class="d-flex"> <documentation-status v-if="compact" v-bind="documentationPartProps" /> <div - v-if="documentation.amends?.slotNumberStart" + v-if="slotNumberStart" :class="{ 'text-h5 mr-3 d-flex flex-column justify-center slot-number': true, 'ml-2 slot-number-mobile': !largeGrid, }" > <span - v-if=" - documentation.amends?.slotNumberStart == - documentation.amends?.slotNumberEnd - " + v-if="slotNumberStart == slotNumberEnd" > - {{ documentation.amends?.slotNumberStart }}. + {{ slotNumberStart }}. </span> <span v-else> - {{ documentation.amends?.slotNumberStart }}.–{{ - documentation.amends?.slotNumberEnd - }}. + {{ slotNumberStart }}.–{{slotNumberEnd}}. </span> </div> <div :class="{ 'text-right d-flex flex-column fit-content': largeGrid }"> @@ -158,6 +153,18 @@ export default { } return []; }, + slotNumberStart() { + if (this.documentation?.amends?.amends?.slotNumberStart) { + return this.documentation.amends.amends.slotNumberStart; + } + return this.documentation.amends?.slotNumberStart; + }, + slotNumberEnd() { + if (this.documentation?.amends?.amends?.slotNumberEnd) { + return this.documentation.amends.amends.slotNumberEnd; + } + return this.documentation.amends?.slotNumberEnd; + }, }, }; </script>