Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
AlekSIS-Core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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-Core
Commits
9b99b876
Verified
Commit
9b99b876
authored
5 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Add function to mark notifications as read.
parent
c651ef22
No related branches found
No related tags found
1 merge request
!100
Resolve "Dashboard"
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
aleksis/core/templates/core/index.html
+4
-1
4 additions, 1 deletion
aleksis/core/templates/core/index.html
aleksis/core/urls.py
+1
-0
1 addition, 0 deletions
aleksis/core/urls.py
aleksis/core/views.py
+13
-1
13 additions, 1 deletion
aleksis/core/views.py
with
18 additions
and
2 deletions
aleksis/core/templates/core/index.html
+
4
−
1
View file @
9b99b876
...
...
@@ -33,7 +33,7 @@
{% if notifications %}
<ul
class=
"collection"
>
{% for notification in notifications %}
{% for notification in
unread_
notifications %}
<li
class=
"collection-item"
>
<span
class=
"badge new primary-color"
>
{{ notification.app }}
</span>
<span
class=
"title"
>
{{ notification.title }}
</span>
...
...
@@ -48,6 +48,9 @@
<a
href=
"{{ notification.link }}"
>
{% blocktrans %}More information →{% endblocktrans %}
</a>
</p>
{% endif %}
<p>
<a
href=
"{% url 'notification_mark_read' notification.id %}"
>
{% blocktrans %}Mark as read{% endblocktrans%}
</a>
</p>
</li>
{% endfor %}
</ul>
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/urls.py
+
1
−
0
View file @
9b99b876
...
...
@@ -29,6 +29,7 @@ urlpatterns = [
path
(
"
group/<int:id_>
"
,
views
.
group
,
name
=
"
group_by_id
"
),
path
(
"
group/<int:id_>/edit
"
,
views
.
edit_group
,
name
=
"
edit_group_by_id
"
),
path
(
""
,
views
.
index
,
name
=
"
index
"
),
path
(
"
notifications/mark-read/<int:id_>
"
,
views
.
notification_mark_read
,
name
=
"
notification_mark_read
"
),
path
(
"
maintenance-mode/
"
,
include
(
"
maintenance_mode.urls
"
)),
path
(
"
impersonate/
"
,
include
(
"
impersonate.urls
"
)),
path
(
"
__i18n__/
"
,
include
(
"
django.conf.urls.i18n
"
)),
...
...
This diff is collapsed.
Click to expand it.
aleksis/core/views.py
+
13
−
1
View file @
9b99b876
...
...
@@ -15,7 +15,7 @@ from .forms import (
EditTermForm
,
PersonsAccountsFormSet
,
)
from
.models
import
Activity
,
Group
,
Person
,
School
from
.models
import
Activity
,
Group
,
Notification
,
Person
,
School
from
.tables
import
GroupsTable
,
PersonsTable
from
.util
import
messages
...
...
@@ -244,3 +244,15 @@ def edit_schoolterm(request: HttpRequest) -> HttpResponse:
context
[
"
edit_term_form
"
]
=
edit_term_form
return
render
(
request
,
"
core/edit_schoolterm.html
"
,
context
)
@admin_required
def
notification_mark_read
(
request
:
HttpRequest
,
id_
:
int
)
->
HttpResponse
:
context
=
{}
notification
=
get_object_or_404
(
Notification
,
pk
=
id_
)
Notification
.
objects
.
get
(
id
=
notification
).
delete
()
messages
.
success
(
request
,
_
(
"
Marked as read
"
))
return
redirect
(
"
index
"
)
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