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
e120eca7
Verified
Commit
e120eca7
authored
4 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
[Lesson overview] Use template engine for notification body
parent
dabdf514
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!152
Overview of all register objects
Pipeline
#6409
passed
4 years ago
Stage: test
Stage: build
Stage: publish
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/apps/alsijil/actions.py
+4
-7
4 additions, 7 deletions
aleksis/apps/alsijil/actions.py
aleksis/apps/alsijil/templates/alsijil/notifications/check.html
+4
-0
4 additions, 0 deletions
...s/apps/alsijil/templates/alsijil/notifications/check.html
with
8 additions
and
7 deletions
aleksis/apps/alsijil/actions.py
+
4
−
7
View file @
e120eca7
...
...
@@ -3,6 +3,7 @@ from typing import Sequence
from
django.contrib
import
messages
from
django.contrib.humanize.templatetags.humanize
import
apnumber
from
django.http
import
HttpRequest
from
django.template.loader
import
get_template
from
django.urls
import
reverse
from
django.utils.translation
import
gettext_lazy
as
_
...
...
@@ -22,17 +23,13 @@ def send_request_to_check_entry(modeladmin, request: HttpRequest, selected_items
grouped_by_teachers
.
setdefault
(
teacher
,
[])
grouped_by_teachers
[
teacher
].
append
(
entry
)
template
=
get_template
(
"
alsijil/notifications/check.html
"
)
for
teacher
,
items
in
grouped_by_teachers
.
items
():
msg
=
template
.
render
({
"
items
"
:
items
})
title
=
_
(
f
"
{
request
.
user
.
person
.
addressing_name
}
wants you to check some class register entries.
"
)
msg
=
_
(
"
Please check if the following class register entries are complete and correct:
\n
"
)
# Add one line for each entry to check
for
entry
in
items
:
reg_object
=
entry
[
"
register_object
"
]
date
=
entry
[
"
date
"
]
msg
+=
f
"
-
{
reg_object
}
(
{
date
}
)
\n
"
n
=
Notification
(
title
=
title
,
...
...
This diff is collapsed.
Click to expand it.
aleksis/apps/alsijil/templates/alsijil/notifications/check.html
0 → 100644
+
4
−
0
View file @
e120eca7
{% load i18n %}{% trans "Please check if the following class register entries are complete and correct:" %}
{% for entry in items %}
- {{ entry.register_object }} ({{ entry.date }})
{% endfor %}
\ No newline at end of file
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