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
2197e680
Verified
Commit
2197e680
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
[Full register printout] Show statistics on extra marks and personal notes with extra marks
parent
5a66f5fb
No related branches found
No related tags found
1 merge request
!68
Resolve "Add option to configure extra marks for personal notes"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/templates/alsijil/print/full_register.html
+31
-2
31 additions, 2 deletions
...s/apps/alsijil/templates/alsijil/print/full_register.html
aleksis/apps/alsijil/views.py
+10
-0
10 additions, 0 deletions
aleksis/apps/alsijil/views.py
with
41 additions
and
2 deletions
aleksis/apps/alsijil/templates/alsijil/print/full_register.html
+
31
−
2
View file @
2197e680
...
@@ -77,6 +77,9 @@
...
@@ -77,6 +77,9 @@
<th>
{% trans 'Absences' %}
</th>
<th>
{% trans 'Absences' %}
</th>
<th>
{% trans 'Unexcused' %}
</th>
<th>
{% trans 'Unexcused' %}
</th>
<th>
{% trans 'Tard.' %}
</th>
<th>
{% trans 'Tard.' %}
</th>
{% for extra_mark in extra_marks %}
<th>
{{ extra_mark.short_name }}
</th>
{% endfor %}
</tr>
</tr>
</thead>
</thead>
...
@@ -91,6 +94,9 @@
...
@@ -91,6 +94,9 @@
<td>
{{ person.absences_count }}
</td>
<td>
{{ person.absences_count }}
</td>
<td>
{{ person.unexcused }}
</td>
<td>
{{ person.unexcused }}
</td>
<td>
{{ person.tardiness }}'
</td>
<td>
{{ person.tardiness }}'
</td>
{% for extra_mark in extra_marks %}
<td>
{{ person|get_dict:extra_mark.count_label }}
</td>
{% endfor %}
</tr>
</tr>
{% endfor %}
{% endfor %}
</tbody>
</tbody>
...
@@ -243,6 +249,18 @@
...
@@ -243,6 +249,18 @@
</tbody>
</tbody>
</table>
</table>
{% if extra_marks %}
<h5>
{% trans 'Extra marks' %}
</h5>
<table>
{% for extra_mark in extra_marks %}
<tr>
<th>
{{ extra_mark.name }}
</th>
<td>
{{ person|get_dict:extra_mark.count_label }}
</td>
</tr>
{% endfor %}
</table>
{% endif %}
<h5>
{% trans 'Relevant personal notes' %}
</h5>
<h5>
{% trans 'Relevant personal notes' %}
</h5>
<table
class=
"small-print"
>
<table
class=
"small-print"
>
<thead>
<thead>
...
@@ -253,13 +271,13 @@
...
@@ -253,13 +271,13 @@
<th>
{% trans 'Te.' %}
</th>
<th>
{% trans 'Te.' %}
</th>
<th>
{% trans 'Absent' %}
</th>
<th>
{% trans 'Absent' %}
</th>
<th>
{% trans 'Tard.' %}
</th>
<th>
{% trans 'Tard.' %}
</th>
<th>
{% trans 'Remarks' %}
</th>
<th
colspan=
"2"
>
{% trans 'Remarks' %}
</th>
</tr>
</tr>
</thead>
</thead>
<tbody>
<tbody>
{% for note in person.personal_notes.all %}
{% for note in person.personal_notes.all %}
{% if note.absent or note.late or note.remarks %}
{% if note.absent or note.late or note.remarks
or note.extra_marks.all
%}
{% period_to_date note.week note.lesson_period.period as note_date %}
{% period_to_date note.week note.lesson_period.period as note_date %}
<tr>
<tr>
<td>
{{ note_date }}
</td>
<td>
{{ note_date }}
</td>
...
@@ -279,6 +297,11 @@
...
@@ -279,6 +297,11 @@
{{ note.late }}'
{{ note.late }}'
{% endif %}
{% endif %}
</td>
</td>
<td>
{% for extra_mark in note.extra_marks.all %}
{{ extra_mark.short_name }}{% if not forloop.last %},{% endif %}
{% endfor %}
</td>
<td>
{{ note.remarks }}
</td>
<td>
{{ note.remarks }}
</td>
</tr>
</tr>
{% endif %}
{% endif %}
...
@@ -363,6 +386,12 @@
...
@@ -363,6 +386,12 @@
{% endif %}
{% endif %}
</span>
</span>
{% endif %}
{% endif %}
{% for extra_mark in note.extra_marks.all %}
<span>
{{ note.person.last_name }}, {{ note.person.first_name|slice:"0:1" }}.
({{ extra_mark.short_name }})
</span>
{% endfor %}
{% endfor %}
{% endfor %}
</td>
</td>
<td
class=
"lesson-te"
>
<td
class=
"lesson-te"
>
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/views.py
+
10
−
0
View file @
2197e680
...
@@ -332,6 +332,15 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
...
@@ -332,6 +332,15 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
tardiness
=
Sum
(
"
personal_notes__late
"
),
tardiness
=
Sum
(
"
personal_notes__late
"
),
)
)
for
extra_mark
in
ExtraMark
.
objects
.
all
():
persons
=
persons
.
annotate
(
**
{
extra_mark
.
count_label
:
Count
(
"
personal_notes
"
,
filter
=
Q
(
personal_notes__extra_marks
=
extra_mark
,),
)
}
)
# FIXME Move to manager
# FIXME Move to manager
personal_note_filters
=
PersonalNoteFilter
.
objects
.
all
()
personal_note_filters
=
PersonalNoteFilter
.
objects
.
all
()
for
personal_note_filter
in
personal_note_filters
:
for
personal_note_filter
in
personal_note_filters
:
...
@@ -347,6 +356,7 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
...
@@ -347,6 +356,7 @@ def full_register_group(request: HttpRequest, id_: int) -> HttpResponse:
}
}
)
)
context
[
"
extra_marks
"
]
=
ExtraMark
.
objects
.
all
()
context
[
"
persons
"
]
=
persons
context
[
"
persons
"
]
=
persons
context
[
"
personal_note_filters
"
]
=
personal_note_filters
context
[
"
personal_note_filters
"
]
=
personal_note_filters
context
[
"
group
"
]
=
group
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