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
1b484b4b
Verified
Commit
1b484b4b
authored
5 years ago
by
Tom Teichler
Browse files
Options
Downloads
Patches
Plain Diff
Fix view if person is not authenticated.
parent
5b444ff9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!100
Resolve "Dashboard"
Pipeline
#553
failed
5 years ago
Stage: test
Stage: build
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
aleksis/core/templates/core/index.html
+61
-59
61 additions, 59 deletions
aleksis/core/templates/core/index.html
aleksis/core/views.py
+17
-14
17 additions, 14 deletions
aleksis/core/views.py
with
78 additions
and
73 deletions
aleksis/core/templates/core/index.html
+
61
−
59
View file @
1b484b4b
...
...
@@ -4,73 +4,75 @@
{% block content %}
<p
class=
"flow-text"
>
{% blocktrans %}AlekSIS (School Information System){% endblocktrans %}
</p>
{% for notification in unread_notifications %}
<div
class=
"alert primary scale-transition"
>
<div>
<i
class=
"material-icons left"
>
info
</i>
{% if user.is_authenticated %}
{% for notification in unread_notifications %}
<div
class=
"alert primary scale-transition"
>
<div>
<i
class=
"material-icons left"
>
info
</i>
<div
class=
"right"
>
<a
class=
"btn-flat waves-effect"
href=
"{% url "
notification_mark_read
"
notification.id
%}"
>
<i
class=
"material-icons center"
>
close
</i>
</a>
</div>
<div
class=
"right"
>
<a
class=
"btn-flat waves-effect"
href=
"{% url "
notification_mark_read
"
notification.id
%}"
>
<i
class=
"material-icons center"
>
close
</i>
</a>
</div>
<strong>
{{ notification.title }}
</strong>
<p>
{{ notification.description }}
</p>
<strong>
{{ notification.title }}
</strong>
<p>
{{ notification.description }}
</p>
</div>
</div>
</div>
{% endfor %}
{% endfor %}
<div
class=
"row"
>
<div
class=
"col s12 m6"
>
<h5>
{% blocktrans %}Last activities{% endblocktrans %}
</h5>
<div
class=
"row"
>
<div
class=
"col s12 m6"
>
<h5>
{% blocktrans %}Last activities{% endblocktrans %}
</h5>
{% if activities %}
<ul
class=
"collection"
>
{% for activity in activities %}
<li
class=
"collection-item"
>
<span
class=
"badge new primary-color"
>
{{ activity.app }}
</span>
<span
class=
"title"
>
{{ activity.title }}
</span>
<p>
<i
class=
"material-icons left"
>
access_time
</i>
{{ activity.created_at }}
</p>
<p>
{{ activity.description }}
</p>
</li>
{% endfor %}
</ul>
{% else %}
<p>
{% blocktrans %}No activities available yet.{% endblocktrans %}
</p>
{% endif %}
</div>
{% if activities %}
<ul
class=
"collection"
>
{% for activity in activities %}
<li
class=
"collection-item"
>
<span
class=
"badge new primary-color"
>
{{ activity.app }}
</span>
<span
class=
"title"
>
{{ activity.title }}
</span>
<p>
<i
class=
"material-icons left"
>
access_time
</i>
{{ activity.created_at }}
</p>
<p>
{{ activity.description }}
</p>
</li>
{% endfor %}
</ul>
{% else %}
<p>
{% blocktrans %}No activities available yet.{% endblocktrans %}
</p>
{% endif %}
</div>
<div
class=
"col s12 m6"
>
<h5>
{% blocktrans %}Recent notifications{% endblocktrans %}
</h5>
<div
class=
"col s12 m6"
>
<h5>
{% blocktrans %}Recent notifications{% endblocktrans %}
</h5>
{% if notifications %}
<ul
class=
"collection"
>
{% for notification in notifications %}
<li
class=
"collection-item"
>
<span
class=
"badge new primary-color"
>
{{ notification.app }}
</span>
<span
class=
"title"
>
{{ notification.title }}
</span>
<p>
<i
class=
"material-icons left"
>
access_time
</i>
{{ notification.created_at }}
</p>
<p>
{{ notification.description }}
</p>
{% if notification.link %}
{% if notifications %}
<ul
class=
"collection"
>
{% for notification in notifications %}
<li
class=
"collection-item"
>
<span
class=
"badge new primary-color"
>
{{ notification.app }}
</span>
<span
class=
"title"
>
{{ notification.title }}
</span>
<p>
<
a
href=
"{{ notification.link }}"
>
{% blocktrans %}More information →{% endblocktrans %}
</a>
<
i
class=
"material-icons left"
>
access_time
</i>
{{ notification.created_at }}
</p>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<p>
{% blocktrans %}No notifications available yet.{% endblocktrans %}
</p>
{% endif %}
<p>
{{ notification.description }}
</p>
{% if notification.link %}
<p>
<a
href=
"{{ notification.link }}"
>
{% blocktrans %}More information →{% endblocktrans %}
</a>
</p>
{% endif %}
</li>
{% endfor %}
</ul>
{% else %}
<p>
{% blocktrans %}No notifications available yet.{% endblocktrans %}
</p>
{% endif %}
</div>
</div>
</div>
{% endif %}
{% endblock %}
This diff is collapsed.
Click to expand it.
aleksis/core/views.py
+
17
−
14
View file @
1b484b4b
...
...
@@ -23,20 +23,23 @@ from .util import messages
def
index
(
request
:
HttpRequest
)
->
HttpResponse
:
context
=
{}
activities
=
Activity
.
objects
.
filter
(
user
=
request
.
user
.
person
).
order_by
(
"
-created_at
"
)[:
5
]
notifications
=
(
request
.
user
.
person
.
notifications
.
all
().
filter
(
user
=
request
.
user
.
person
).
order_by
(
"
-created_at
"
)[:
5
]
)
unread_notifications
=
(
request
.
user
.
person
.
notifications
.
all
()
.
filter
(
user
=
request
.
user
.
person
,
read
=
False
)
.
order_by
(
"
-created_at
"
)
)
context
[
"
activities
"
]
=
activities
context
[
"
notifications
"
]
=
notifications
context
[
"
unread_notifications
"
]
=
unread_notifications
user
=
request
.
user
if
user
.
is_authenticated
:
activities
=
Activity
.
objects
.
filter
(
user
=
request
.
user
.
person
).
order_by
(
"
-created_at
"
)[:
5
]
notifications
=
(
request
.
user
.
person
.
notifications
.
all
().
filter
(
user
=
request
.
user
.
person
).
order_by
(
"
-created_at
"
)[:
5
]
)
unread_notifications
=
(
request
.
user
.
person
.
notifications
.
all
()
.
filter
(
user
=
request
.
user
.
person
,
read
=
False
)
.
order_by
(
"
-created_at
"
)
)
context
[
"
activities
"
]
=
activities
context
[
"
notifications
"
]
=
notifications
context
[
"
unread_notifications
"
]
=
unread_notifications
return
render
(
request
,
"
core/index.html
"
,
context
)
...
...
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