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
5ded6324
Commit
5ded6324
authored
4 years ago
by
Nik | Klampfradler
Browse files
Options
Downloads
Plain Diff
Merge branch '129-full-register-printout-doesn-t-load-in-time' into 'master'
Resolve "Full register printout doesn't load in time" Closes
#129
See merge request
!127
parents
ff640d71
17956598
No related branches found
No related tags found
1 merge request
!127
Resolve "Full register printout doesn't load in time"
Pipeline
#5418
passed
4 years ago
Stage: test
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/templates/alsijil/print/full_register.html
+30
-32
30 additions, 32 deletions
...s/apps/alsijil/templates/alsijil/print/full_register.html
aleksis/apps/alsijil/views.py
+37
-29
37 additions, 29 deletions
aleksis/apps/alsijil/views.py
with
67 additions
and
61 deletions
aleksis/apps/alsijil/templates/alsijil/print/full_register.html
+
30
−
32
View file @
5ded6324
...
...
@@ -316,40 +316,38 @@
</thead>
<tbody>
{% for note in person.personal_notes.all %}
{% if note.lesson_period in lesson_periods %}
{% if note.absent or note.late or note.remarks or note.extra_marks.all %}
{% weekday_to_date note.calendar_week note.lesson_period.period.weekday as note_date %}
<tr>
<td>
{{ note_date }}
</td>
<td>
{{ note.lesson_period.period.period }}
</td>
<td>
{{ note.lesson_period.get_subject.short_name }}
</td>
<td>
{{ note.lesson_period.get_teachers.first.short_name }}
</td>
<td>
{% if note.absent %}
{% trans 'Yes' %}
{% if note.excused %}
{% if note.excuse_type %}
({{ note.excuse_type.short_name }})
{% else %}
({% trans 'e' %})
{% endif %}
{% for note in person.filtered_notes %}
{% if note.absent or note.late or note.remarks or note.extra_marks.all %}
{% weekday_to_date note.calendar_week note.lesson_period.period.weekday as note_date %}
<tr>
<td>
{{ note_date }}
</td>
<td>
{{ note.lesson_period.period.period }}
</td>
<td>
{{ note.lesson_period.get_subject.short_name }}
</td>
<td>
{{ note.lesson_period.get_teachers.first.short_name }}
</td>
<td>
{% if note.absent %}
{% trans 'Yes' %}
{% if note.excused %}
{% if note.excuse_type %}
({{ note.excuse_type.short_name }})
{% else %}
({% trans 'e' %})
{% endif %}
{% endif %}
</td>
<td>
{% if note.late %}
{{
note.late }
}'
{
% endif %}
</td>
<td>
{% for extra_mark in note.extra_marks.all %}
{{
extra_mark
.short_name }}{%
i
f
not
forloop.last %},{% endif
%}
{
%
e
ndfor
%}
</td>
<td>
{{ note.remarks }}
</td>
<
/tr
>
{% endif %}
{% endif %}
<
/
td>
<td>
{% if
note.late
%
}
{
{ note.late }}'
{% endif %}
<
/
td>
<td>
{% for
extra_mark i
n
not
e.extra_marks.all
%}
{
{
e
xtra_mark.short_name }}{% if not forloop.last %},{% endif
%}
{% endfor %}
</td>
<
td>
{{ note.remarks }}
</td
>
</tr>
{% endif %}
{% endfor %}
</tbody>
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
37
−
29
View file @
5ded6324
...
...
@@ -402,20 +402,29 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
group
=
get_object_or_404
(
Group
,
pk
=
id_
)
# Get all lesson periods for the selected group
lesson_periods
=
(
LessonPeriod
.
objects
.
filter_group
(
group
)
.
distinct
()
personal_notes
=
(
PersonalNote
.
objects
.
select_related
(
"
lesson_period
"
)
.
prefetch_related
(
"
documentations
"
,
"
personal_notes
"
,
"
personal_notes__excuse_type
"
,
"
personal_notes__extra_marks
"
,
"
personal_notes__person
"
,
"
personal_notes__groups_of_person
"
,
"
lesson_period__substitutions
"
,
"
lesson_period__lesson__teachers
"
,
"
groups_of_person
"
)
.
filter
(
~
Q
(
remarks
=
""
)
|
Q
(
absent
=
True
)
|
~
Q
(
late
=
0
)
|
Q
(
extra_marks__isnull
=
False
))
.
filter
(
Q
(
lesson_period__lesson__groups
=
group
)
|
Q
(
lesson_period__lesson__groups__parent_groups
=
group
)
)
)
documentations
=
(
LessonDocumentation
.
objects
.
select_related
(
"
lesson_period
"
)
.
filter
(
~
Q
(
topic
=
""
)
|
~
Q
(
group_note
=
""
)
|
~
Q
(
homework
=
""
))
.
filter
(
Q
(
lesson_period__lesson__groups
=
group
)
|
Q
(
lesson_period__lesson__groups__parent_groups
=
group
)
)
)
# Get all lesson periods for the selected group
lesson_periods
=
LessonPeriod
.
objects
.
filter_group
(
group
).
distinct
()
weeks
=
CalendarWeek
.
weeks_within
(
group
.
school_term
.
date_start
,
group
.
school_term
.
date_end
,)
periods_by_day
=
{}
...
...
@@ -428,39 +437,38 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
<=
day
<=
lesson_period
.
lesson
.
validity
.
date_end
):
documentations
=
list
(
filtered_
documentations
=
list
(
filter
(
lambda
d
:
d
.
week
==
week
.
week
and
d
.
year
==
week
.
year
,
lesson_period
.
documentations
.
all
(),
lambda
d
:
d
.
week
==
week
.
week
and
d
.
year
==
week
.
year
and
d
.
lesson_period
==
lesson_period
,
documentations
,
)
)
notes
=
list
(
filtered_personal_
notes
=
list
(
filter
(
lambda
d
:
d
.
week
==
week
.
week
and
d
.
year
==
week
.
year
,
lesson_period
.
personal_notes
.
all
(),
lambda
d
:
d
.
week
==
week
.
week
and
d
.
year
==
week
.
year
and
d
.
lesson_period
==
lesson_period
,
personal_notes
,
)
)
substitution
=
lesson_period
.
get_substitution
(
week
)
periods_by_day
.
setdefault
(
day
,
[]).
append
(
(
lesson_period
,
documentations
,
notes
,
substitution
)
(
lesson_period
,
filtered_
documentations
,
filtered_personal_
notes
,
substitution
)
)
persons
=
Person
.
objects
.
prefetch_related
(
"
personal_notes
"
,
"
personal_notes__excuse_type
"
,
"
personal_notes__extra_marks
"
,
"
personal_notes__lesson_period__lesson__subject
"
,
"
personal_notes__lesson_period__substitutions
"
,
"
personal_notes__lesson_period__substitutions__subject
"
,
"
personal_notes__lesson_period__substitutions__teachers
"
,
"
personal_notes__lesson_period__lesson__teachers
"
,
"
personal_notes__lesson_period__period
"
,
)
persons
=
Person
.
objects
.
prefetch_related
(
None
).
select_related
(
None
)
persons
=
group
.
generate_person_list_with_class_register_statistics
(
persons
)
prefetched_persons
=
[]
for
person
in
persons
:
person
.
filtered_notes
=
list
(
filter
(
lambda
d
:
d
.
person
==
person
,
personal_notes
))
prefetched_persons
.
append
(
person
)
context
[
"
school_term
"
]
=
group
.
school_term
context
[
"
persons
"
]
=
persons
context
[
"
persons
"
]
=
prefetched_
persons
context
[
"
excuse_types
"
]
=
ExcuseType
.
objects
.
all
()
context
[
"
extra_marks
"
]
=
ExtraMark
.
objects
.
all
()
context
[
"
group
"
]
=
group
...
...
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