Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Lesrooster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Onboarding
AlekSIS-App-Lesrooster
Commits
fe76d41c
Commit
fe76d41c
authored
11 months ago
by
Julian
Browse files
Options
Downloads
Patches
Plain Diff
Support concurrent lessons in mini timetables
parent
4ffe5501
No related branches found
No related tags found
1 merge request
!39
Resolve "Mini timetables should also work with parallel lessons"
Pipeline
#180996
passed with warnings
11 months ago
Stage: prepare
Stage: test
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
aleksis/apps/lesrooster/frontend/components/timetable_management/timetables/MiniTimeTable.vue
+49
-12
49 additions, 12 deletions
...ponents/timetable_management/timetables/MiniTimeTable.vue
with
49 additions
and
12 deletions
aleksis/apps/lesrooster/frontend/components/timetable_management/timetables/MiniTimeTable.vue
+
49
−
12
View file @
fe76d41c
...
...
@@ -64,15 +64,40 @@ export default defineComponent({
lessons
()
{
return
[];
},
lessonsPerSlot
()
{
let
weekdayPeriodSlots
=
Object
.
fromEntries
(
this
.
weekdays
.
map
((
weekday
)
=>
[
weekday
,
Object
.
fromEntries
(
this
.
periods
.
map
((
period
)
=>
[
period
,
[]])),
]),
);
this
.
lessons
?.
forEach
((
lesson
)
=>
{
const
weekdayStart
=
lesson
.
slotStart
.
weekday
;
const
weekdayEnd
=
lesson
.
slotEnd
.
weekday
;
const
periodStart
=
lesson
.
slotStart
.
period
;
const
periodEnd
=
lesson
.
slotEnd
.
period
;
// If lesson start and end is on the same day, just add it in between the periods
if
(
weekdayStart
===
weekdayEnd
)
{
this
.
periods
.
map
((
period
)
=>
{
if
(
period
<=
periodEnd
&&
period
>=
periodStart
)
{
weekdayPeriodSlots
[
weekdayStart
][
period
].
push
(
lesson
);
}
});
}
else
{
// this is more complicated.
// As it is currently not possible to create timetables like this, we will just ignore it
}
});
return
weekdayPeriodSlots
;
},
},
methods
:
{
styleFor
Lesson
(
lesson
)
{
styleFor
WeekdayAndPeriod
(
weekday
,
period
)
{
return
{
gridArea
:
`period-
${
lesson
.
slotStart
.
period
}
/
${
lesson
.
slotStart
.
weekday
}
/ `
+
`span
${
lesson
.
slotEnd
.
period
-
lesson
.
slotStart
.
period
+
1
}
/
${
lesson
.
slotEnd
.
weekday
}
`
,
gridArea
:
`period-
${
period
}
/
${
weekday
}
/ `
+
`span 1 /
${
weekday
}
`
,
};
},
},
...
...
@@ -100,12 +125,20 @@ export default defineComponent({
>
<v-card-text>
{{
$t
(
"
weekdays.
"
+
weekday
)
}}
</v-card-text>
</v-card>
<lesson-card
v-for=
"lesson in lessons"
:lesson=
"lesson"
:style=
"styleForLesson(lesson)"
:key=
"lesson.id"
/>
<template
v-for=
"weekday in weekdays"
>
<div
v-for=
"period in periods"
:key=
"'lesson-container-' + weekday + '-' + period"
:style=
"styleForWeekdayAndPeriod(weekday, period)"
class=
"d-flex flex-column gap-small"
>
<lesson-card
v-for=
"lesson in lessonsPerSlot[weekday][period]"
:lesson=
"lesson"
:key=
"lesson.id"
/>
</div>
</
template
>
<message-box
type=
"info"
v-if=
"!lessons || lessons.length === 0"
>
{{ $t("lesrooster.timetable_management.no_lessons") }}
...
...
@@ -127,4 +160,8 @@ export default defineComponent({
width
:
100%
;
height
:
100%
;
}
.gap-small
{
gap
:
0.4em
;
}
</
style
>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment