From 0cea0f21a67d227a393c1caced9ffbd779a658c5 Mon Sep 17 00:00:00 2001 From: Jorran de Wit <jorrandewit@outlook.com> Date: Mon, 11 Sep 2017 21:59:08 +0200 Subject: [PATCH] Add notifications to navbar --- scipost/static/scipost/assets/css/_navbar.scss | 10 ++++++++++ scipost/templates/scipost/bare_base.html | 2 ++ scipost/templates/scipost/navbar.html | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/scipost/static/scipost/assets/css/_navbar.scss b/scipost/static/scipost/assets/css/_navbar.scss index e267881bd..be65a9f8c 100644 --- a/scipost/static/scipost/assets/css/_navbar.scss +++ b/scipost/static/scipost/assets/css/_navbar.scss @@ -73,3 +73,13 @@ white-space: nowrap; } } + +.navbar-counter { + position: relative; + + .badge { + position: absolute; + right: -3px; + top: 2px; + } +} diff --git a/scipost/templates/scipost/bare_base.html b/scipost/templates/scipost/bare_base.html index 663e6e2da..6b326d991 100644 --- a/scipost/templates/scipost/bare_base.html +++ b/scipost/templates/scipost/bare_base.html @@ -21,6 +21,8 @@ <link rel="stylesheet" href="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css"> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script> + <script src="https://use.fontawesome.com/1f60a2fe64.js"></script><!-- Temporary --> + {% block headsup %} {% endblock headsup %} </head> diff --git a/scipost/templates/scipost/navbar.html b/scipost/templates/scipost/navbar.html index ed33013d1..7a17dc6f2 100644 --- a/scipost/templates/scipost/navbar.html +++ b/scipost/templates/scipost/navbar.html @@ -22,7 +22,13 @@ {% if user.is_authenticated %} <li class="nav-item highlighted"> - <span class="nav-link">Logged in as {{ user.username }}</span> + <div class="d-s nav-link"> + Logged in as {{ user.username }} + <a class="d-inline nav-link navbar-counter" href="{% url 'notifications:all' %}"> + <i class="fa fa-bell-o" aria-hidden="true"></i> + <span class="badge badge-pill badge-primary">2</span> + </a> + </div> </li> {% if perms.scipost.can_oversee_refereeing %} <li class="nav-item{% if '/submissions/admin' in request.path %} active{% endif %}"> -- GitLab