Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Alsijil
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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®
Official
AlekSIS-App-Alsijil
Commits
f1929d7c
Commit
f1929d7c
authored
5 months ago
by
Jonathan Weth
Browse files
Options
Downloads
Plain Diff
Merge branch '343-room-substitutions-are-not-shown-correctly' into 'master'
Resolve "Room substitutions are not shown correctly" Closes
#343
See merge request
!454
parents
bd736269
9f636abc
No related branches found
No related tags found
1 merge request
!454
Resolve "Room substitutions are not shown correctly"
Pipeline
#194600
failed
5 months ago
Stage: prepare
Stage: test
Stage: build
Stage: publish
Stage: docker
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue
+50
-33
50 additions, 33 deletions
...components/coursebook/documentation/LessonInformation.vue
aleksis/apps/alsijil/util/predicates.py
+8
-0
8 additions, 0 deletions
aleksis/apps/alsijil/util/predicates.py
with
58 additions
and
33 deletions
aleksis/apps/alsijil/frontend/components/coursebook/documentation/LessonInformation.vue
+
50
−
33
View file @
f1929d7c
...
@@ -10,25 +10,16 @@ import SubjectChipSelectField from "aleksis.apps.cursus/components/SubjectChipSe
...
@@ -10,25 +10,16 @@ import SubjectChipSelectField from "aleksis.apps.cursus/components/SubjectChipSe
<div
class=
"d-flex"
>
<div
class=
"d-flex"
>
<documentation-status
v-if=
"compact"
v-bind=
"documentationPartProps"
/>
<documentation-status
v-if=
"compact"
v-bind=
"documentationPartProps"
/>
<div
<div
v-if=
"
documentation.amends?.
slotNumberStart"
v-if=
"slotNumberStart"
:class=
"
{
:class=
"
{
'text-h5 mr-3 d-flex flex-column justify-center slot-number': true,
'text-h5 mr-3 d-flex flex-column justify-center slot-number': true,
'ml-2 slot-number-mobile': !largeGrid,
'ml-2 slot-number-mobile': !largeGrid,
}"
}"
>
>
<span
<span
v-if=
"slotNumberStart == slotNumberEnd"
>
v-if=
"
{{
slotNumberStart
}}
.
documentation.amends?.slotNumberStart ==
documentation.amends?.slotNumberEnd
"
>
{{
documentation
.
amends
?.
slotNumberStart
}}
.
</span>
<span
v-else
>
{{
documentation
.
amends
?.
slotNumberStart
}}
.–
{{
documentation
.
amends
?.
slotNumberEnd
}}
.
</span>
</span>
<span
v-else
>
{{
slotNumberStart
}}
.–
{{
slotNumberEnd
}}
.
</span>
</div>
</div>
<div
:class=
"
{ 'text-right d-flex flex-column fit-content': largeGrid }">
<div
:class=
"
{ 'text-right d-flex flex-column fit-content': largeGrid }">
<time
:datetime=
"documentation.datetimeStart"
class=
"text-no-wrap"
>
<time
:datetime=
"documentation.datetimeStart"
class=
"text-no-wrap"
>
...
@@ -94,22 +85,14 @@ import SubjectChipSelectField from "aleksis.apps.cursus/components/SubjectChipSe
...
@@ -94,22 +85,14 @@ import SubjectChipSelectField from "aleksis.apps.cursus/components/SubjectChipSe
}"
}"
>
>
<person-chip
<person-chip
v-for=
"teacher in
documentation.teacher
s"
v-for=
"teacher in
teachersWithStatu
s"
:key=
"documentation.id + '-teacher-' + teacher.id"
:key=
"documentation.id + '-teacher-' + teacher.id"
:person=
"teacher"
:person=
"teacher"
:no-link=
"compact"
:no-link=
"compact"
v-bind=
"compact ? dialogActivator.attrs : {}"
v-bind=
"compact ? dialogActivator.attrs : {}"
v-on=
"compact ? dialogActivator.on : {}"
v-on=
"compact ? dialogActivator.on : {}"
/>
:class=
"{ 'text-decoration-line-through': teacher?.removed }"
<person-chip
:disabled=
"teacher?.removed"
v-for=
"teacher in amendedTeachers"
:key=
"documentation.id + '-amendedTeacher-' + teacher.id"
:person=
"teacher"
:no-link=
"compact"
v-bind=
"compact ? dialogActivator.attrs : {}"
v-on=
"compact ? dialogActivator.on : {}"
class=
"text-decoration-line-through"
disabled
/>
/>
</div>
</div>
</div>
</div>
...
@@ -147,16 +130,50 @@ export default {
...
@@ -147,16 +130,50 @@ export default {
largeGrid
()
{
largeGrid
()
{
return
this
.
compact
&&
!
this
.
$vuetify
.
breakpoint
.
mobile
;
return
this
.
compact
&&
!
this
.
$vuetify
.
breakpoint
.
mobile
;
},
},
amendedTeachers
()
{
// Group teachers by their substitution status (regular, removed)
if
(
teachersWithStatus
()
{
this
.
documentation
?.
amends
?.
amends
?.
teachers
&&
if
(
this
.
documentation
?.
amends
?.
amends
)
{
this
.
documentation
.
amends
.
amends
.
teachers
.
length
// Only do grouping if documentation is based on substitution and substitution
)
{
// has teachers linked with it.
return
this
.
documentation
.
amends
.
amends
.
teachers
.
filter
(
if
(
this
.
documentation
.
teachers
.
length
>
0
)
{
(
at
)
=>
!
this
.
documentation
.
teachers
.
includes
((
t
)
=>
t
.
id
===
at
.
id
),
// IDs of teachers of amended lesson
);
const
oldIds
=
this
.
documentation
.
amends
.
amends
.
teachers
.
map
(
(
teacher
)
=>
teacher
.
id
,
);
// IDs of teachers of new substitution lesson
const
newIds
=
this
.
documentation
.
teachers
.
map
(
(
teacher
)
=>
teacher
.
id
,
);
const
allTeachers
=
new
Set
(
this
.
documentation
.
amends
.
amends
.
teachers
.
concat
(
this
.
documentation
.
teachers
,
),
);
let
teachersWithStatus
=
Array
.
from
(
allTeachers
).
map
((
teacher
)
=>
{
let
removed
=
false
;
if
(
!
newIds
.
includes
(
teacher
.
id
)
&&
oldIds
.
includes
(
teacher
.
id
))
{
// Mark teacher as being removed if they are only linked to the amended lesson
removed
=
true
;
}
return
{
...
teacher
,
removed
:
removed
};
});
return
teachersWithStatus
;
}
return
this
.
documentation
.
amends
.
amends
.
teachers
;
}
return
this
.
documentation
.
teachers
;
},
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
[]
;
return
this
.
documentation
.
amends
?.
slotNumberEnd
;
},
},
},
},
};
};
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/util/predicates.py
+
8
−
0
View file @
f1929d7c
...
@@ -193,6 +193,7 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent):
...
@@ -193,6 +193,7 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent):
Checks whether the person linked to the user is a owner of any group
Checks whether the person linked to the user is a owner of any group
(or their respective parent groups) linked to the lesson event,
(or their respective parent groups) linked to the lesson event,
or a owner of any group linked to the course, if the lesson event has one.
or a owner of any group linked to the course, if the lesson event has one.
Also checks for groups linked to the lesson being amended, if one exists.
"""
"""
if
obj
:
if
obj
:
for
g
in
obj
.
groups
.
all
():
for
g
in
obj
.
groups
.
all
():
...
@@ -201,6 +202,13 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent):
...
@@ -201,6 +202,13 @@ def is_lesson_event_group_owner(user: User, obj: LessonEvent):
for
pg
in
g
.
parent_groups
.
all
():
for
pg
in
g
.
parent_groups
.
all
():
if
user
.
person
in
pg
.
owners
.
all
():
if
user
.
person
in
pg
.
owners
.
all
():
return
True
return
True
if
obj
.
amends
:
for
g
in
obj
.
amends
.
groups
.
all
():
if
user
.
person
in
g
.
owners
.
all
():
return
True
for
pg
in
g
.
parent_groups
.
all
():
if
user
.
person
in
pg
.
owners
.
all
():
return
True
return
False
return
False
...
...
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