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
641024f5
Verified
Commit
641024f5
authored
5 years ago
by
Tom Teichler
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' into core#65
parents
df08609c
d57158f2
No related branches found
No related tags found
1 merge request
!4
Make page titles and headers consistent. Advances BiscuIT-ng#65.
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
biscuit/apps/alsijil/menus.py
+1
-1
1 addition, 1 deletion
biscuit/apps/alsijil/menus.py
biscuit/apps/alsijil/templates/alsijil/lesson.html
+12
-10
12 additions, 10 deletions
biscuit/apps/alsijil/templates/alsijil/lesson.html
biscuit/apps/alsijil/views.py
+9
-5
9 additions, 5 deletions
biscuit/apps/alsijil/views.py
with
22 additions
and
16 deletions
biscuit/apps/alsijil/menus.py
+
1
−
1
View file @
641024f5
...
...
@@ -6,7 +6,7 @@ MENUS = {
'
name
'
:
_
(
'
Class register
'
),
'
url
'
:
'
#
'
,
'
root
'
:
True
,
'
validators
'
:
[
'
menu_generator.validators.is_authenticated
'
],
'
validators
'
:
[
'
menu_generator.validators.is_authenticated
'
,
'
biscuit.core.util.core_helpers.has_person
'
],
'
submenu
'
:
[
{
'
name
'
:
_
(
'
Current lesson
'
),
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/alsijil/templates/alsijil/lesson.html
+
12
−
10
View file @
641024f5
...
...
@@ -9,7 +9,17 @@
{% endblock %}
{% block page_title %}
{% blocktrans %}Lesson documentation{% endblocktrans %}
{{ day }} -
{% for group in lesson_period.get_groups.all %}
<span>
{{ group.short_name }}
</span>
,
{% endfor %},
{{ lesson_period.get_subject.name }},
{% for teacher in lesson_period.get_teachers.all %}
{{ teacher.short_name }}
{% endfor %}
{% endblock %}
{% block content %}
...
...
@@ -19,15 +29,7 @@
<div
class=
"card"
>
<div
class=
"card-header bg-light text-dark"
>
{% for group in lesson_period.get_groups.all %}
<span>
{{ group.short_name }}
</span>
,
{% endfor %}
{{ lesson_period.get_subject.name }},
{% for teacher in lesson_period.get_teachers.all %}
{{ teacher.short_name }}
{% endfor %}
{% blocktrans %}Lesson documentation{% endblocktrans %}
</div>
<div
class=
"card-body"
>
{% csrf_token %}
...
...
This diff is collapsed.
Click to expand it.
biscuit/apps/alsijil/views.py
+
9
−
5
View file @
641024f5
...
...
@@ -5,6 +5,7 @@ from django.contrib.auth.decorators import login_required
from
django.db.models
import
Q
from
django.http
import
HttpRequest
,
HttpResponse
from
django.shortcuts
import
render
from
django.views.decorators.cache
import
cache_page
from
biscuit.apps.chronos.models
import
LessonPeriod
,
TimePeriod
from
biscuit.apps.chronos.util
import
current_lesson_periods
,
current_week
,
week_days
...
...
@@ -30,6 +31,7 @@ def lesson(request: HttpRequest, week: Optional[int] = None, period_id: Optional
context
[
'
lesson_period
'
]
=
lesson_period
context
[
'
week
'
]
=
wanted_week
context
[
'
day
'
]
=
week_days
(
wanted_week
)[
lesson_period
.
period
.
weekday
]
if
lesson_period
:
# Create or get lesson documentation object; can be empty when first opening lesson
...
...
@@ -40,7 +42,7 @@ def lesson(request: HttpRequest, week: Optional[int] = None, period_id: Optional
# Create all missing personal notes about members of all groups in lesson
for
group
in
lesson_period
.
lesson
.
groups
.
all
():
for
person
in
group
.
members
.
all
(
):
for
person
in
group
.
members
.
filter
(
is_active
=
True
):
note
,
created
=
PersonalNote
.
objects
.
get_or_create
(
person
=
person
,
lesson_period
=
lesson_period
,
week
=
wanted_week
)
...
...
@@ -63,6 +65,7 @@ def lesson(request: HttpRequest, week: Optional[int] = None, period_id: Optional
@login_required
@cache_page
(
60
*
60
*
4
)
def
group_week
(
request
:
HttpRequest
,
week
:
Optional
[
int
]
=
None
)
->
HttpResponse
:
context
=
{}
...
...
@@ -81,10 +84,11 @@ def group_week(request: HttpRequest, week: Optional[int] = None) -> HttpResponse
periods_by_day_unsorted
=
{}
if
group
:
for
lesson
in
group
.
lessons
.
filter
(
date_start__lte
=
week_start
,
date_end__gte
=
week_end
):
for
lesson_period
in
lesson
.
lesson_periods
.
all
():
periods_by_day_unsorted
.
setdefault
(
lesson_period
.
period
.
weekday
,
[]).
append
(
lesson_period
)
for
act_group
in
[
group
]
+
list
(
group
.
child_groups
.
all
()):
for
lesson
in
act_group
.
lessons
.
filter
(
date_start__lte
=
week_start
,
date_end__gte
=
week_end
):
for
lesson_period
in
lesson
.
lesson_periods
.
all
():
periods_by_day_unsorted
.
setdefault
(
lesson_period
.
period
.
weekday
,
[]).
append
(
lesson_period
)
periods_by_day
=
OrderedDict
()
for
weekday
,
periods
in
sorted
(
periods_by_day_unsorted
.
items
()):
...
...
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