Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-App-Chronos
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-Chronos
Commits
ed540ae9
Unverified
Commit
ed540ae9
authored
5 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Patches
Plain Diff
Use and highlight substitute lessons in timetables, advances
#7
.
parent
ec738fde
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
biscuit/apps/chronos/models.py
+21
-0
21 additions, 0 deletions
biscuit/apps/chronos/models.py
biscuit/apps/chronos/templates/chronos/tt_lesson.html
+11
-5
11 additions, 5 deletions
biscuit/apps/chronos/templates/chronos/tt_lesson.html
with
32 additions
and
5 deletions
biscuit/apps/chronos/models.py
+
21
−
0
View file @
ed540ae9
...
@@ -85,6 +85,27 @@ class LessonPeriod(models.Model):
...
@@ -85,6 +85,27 @@ class LessonPeriod(models.Model):
substitution
=
models
.
OneToOneField
(
'
LessonSubstitution
'
,
models
.
CASCADE
,
substitution
=
models
.
OneToOneField
(
'
LessonSubstitution
'
,
models
.
CASCADE
,
'
lesson_period
'
,
null
=
True
)
'
lesson_period
'
,
null
=
True
)
def
get_subject
(
self
):
if
self
.
substitution
:
return
self
.
substitution
.
subject
else
:
return
self
.
lesson
.
subject
def
get_teachers
(
self
):
if
self
.
substitution
:
return
self
.
substitution
.
teachers
else
:
return
self
.
lesson
.
teachers
def
get_room
(
self
):
if
self
.
substitution
:
return
self
.
substitution
.
room
else
:
return
self
.
room
def
get_groups
(
self
):
return
self
.
lesson
.
groups
class
LessonSubstitution
(
models
.
Model
):
class
LessonSubstitution
(
models
.
Model
):
subject
=
models
.
ForeignKey
(
subject
=
models
.
ForeignKey
(
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/chronos/templates/chronos/tt_lesson.html
+
11
−
5
View file @
ed540ae9
<div
class=
"card chronos-lesson"
<div
class=
"card chronos-lesson
{% if lesson_period.substitution %}
border border-warning
{% endif %}
"
style=
"
style=
"
{% if lesson_period.lesson.subject.colour_fg %}
{% if lesson_period.lesson.subject.colour_fg %}
color: {{ lesson_period.lesson.subject.colour_fg }};
color: {{ lesson_period.lesson.subject.colour_fg }};
...
@@ -10,17 +14,19 @@
...
@@ -10,17 +14,19 @@
<div
class=
"card-body"
>
<div
class=
"card-body"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm"
>
<div
class=
"col-sm"
>
<span
class=
"card-title"
>
{{ lesson_period.lesson.subject.abbrev }}
</span>
<span
class=
"card-title"
>
{{ lesson_period.get_subject.abbrev }}
</span>
</div>
</div>
</div>
</div>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-sm"
>
<div
class=
"col-sm"
>
{% for group in lesson_period.
lesson.
groups.all %}
{% for group in lesson_period.
get_
groups.all %}
<span
class=
"card-text"
>
{{ group.short_name }}
</span>
<span
class=
"card-text"
>
{{ group.short_name }}
</span>
{% endfor %}
{% endfor %}
</div>
</div>
<div
class=
"col-sm"
>
<div
class=
"col-sm"
>
{% for teacher in lesson_period.
lesson.
teachers.all %}
{% for teacher in lesson_period.
get_
teachers.all %}
<a
href=
"{% url 'person_by_id' teacher.id %}"
<a
href=
"{% url 'person_by_id' teacher.id %}"
title=
"{{ teacher.first_name }} {{ teacher.last_name }}"
title=
"{{ teacher.first_name }} {{ teacher.last_name }}"
class=
"card-text"
class=
"card-text"
...
@@ -30,7 +36,7 @@
...
@@ -30,7 +36,7 @@
{% endfor %}
{% endfor %}
</div>
</div>
<div
class=
"col-sm"
>
<div
class=
"col-sm"
>
<span
class=
"card-text"
>
{{ lesson_period.room.short_name }}
</span>
<span
class=
"card-text"
>
{{ lesson_period.
get_
room.short_name }}
</span>
</div>
</div>
</div>
</div>
</div>
</div>
...
...
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