Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
80e000c4
authored
Mar 18, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: notifications on all pages
parent
ec135334
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
13 deletions
+15
-13
circle/circle/settings/base.py
+1
-0
circle/dashboard/context_processors.py
+6
-0
circle/dashboard/templates/dashboard/base.html
+8
-2
circle/dashboard/templates/dashboard/index.html
+0
-11
No files found.
circle/circle/settings/base.py
View file @
80e000c4
...
...
@@ -171,6 +171,7 @@ TEMPLATE_CONTEXT_PROCESSORS = (
'django.core.context_processors.tz'
,
'django.contrib.messages.context_processors.messages'
,
'django.core.context_processors.request'
,
'dashboard.context_processors.notifications'
,
)
# See: https://docs.djangoproject.com/en/dev/ref/settings/#template-loaders
...
...
circle/dashboard/context_processors.py
0 → 100644
View file @
80e000c4
def
notifications
(
request
):
count
=
(
request
.
user
.
notification_set
.
filter
(
status
=
"new"
)
.
count
()
if
request
.
user
.
is_authenticated
()
else
None
)
return
{
'NEW_NOTIFICATIONS_COUNT'
:
count
}
circle/dashboard/templates/dashboard/base.html
View file @
80e000c4
...
...
@@ -33,8 +33,14 @@
</div>
<!-- .navbar-header -->
<div
class=
"collapse navbar-collapse"
>
<ul
class=
"nav navbar-nav pull-right"
>
{% block navbar-ul %}
{% endblock %}
<li
class=
"dropdown"
id=
"notification-button"
>
<a
href=
"{% url "
dashboard
.
views
.
notifications
"
%}"
style=
"color: white; font-size: 12px;"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
{% trans "Notifications" %}{% if NEW_NOTIFICATIONS_COUNT > 0 %}
<span
class=
"badge"
>
{{ NEW_NOTIFICATIONS_COUNT }}
</span>
{% endif %}
</a>
<ul
class=
"dropdown-menu notification-messages"
>
<li>
{% trans "Loading..." %}
</li>
</ul>
</li>
</ul>
{% if user.is_authenticated %}
<a
class=
"navbar-brand pull-right"
href=
"{% url "
logout
"
%}?
next=
{%
url
"
login
"
%}"
style=
"color: white; font-size: 10px;"
><i
class=
"icon-signout icon-sign-out"
></i>
{% trans "Log out" %}
</a>
...
...
circle/dashboard/templates/dashboard/index.html
View file @
80e000c4
...
...
@@ -3,17 +3,6 @@
{% block title-page %}{% trans "Dashboard" %}{% endblock %}
{% block navbar-ul %}
<li
class=
"dropdown"
id=
"notification-button"
>
<a
href=
"{% url "
dashboard
.
views
.
notifications
"
%}"
style=
"color: white; font-size: 12px;"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
{% trans "Notifications" %}{% if new_notifications %}
<span
class=
"badge"
>
{{ new_notifications }}
</span>
{% endif %}
</a>
<ul
class=
"dropdown-menu notification-messages"
>
<li>
{% trans "Loading..." %}
</li>
</ul>
</li>
{% endblock %}
{% block content %}
<div
class=
"body-content dashboard-index"
>
<div
class=
"row"
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment