X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/5913c54d19b8f6775633176032161d49f9b2f1aa..817ce226770c3b003d85b7e77e96360c433c80ed:/src/redakcja/templates/registration/head_login.html

diff --git a/src/redakcja/templates/registration/head_login.html b/src/redakcja/templates/registration/head_login.html
index 2a8fd3bd..ccbfd85e 100644
--- a/src/redakcja/templates/registration/head_login.html
+++ b/src/redakcja/templates/registration/head_login.html
@@ -1,16 +1,22 @@
 {% load i18n %}
+{% load gravatar %}
 
 {% if user.is_authenticated %}
-<span class="user_name">{{ user.username }}</span> |
-
-{% if user.is_staff %}
-    <a href="{% url 'admin:index' %}">{% trans "Admin" %}</a> |
-{% endif %}
-
-<a href='{% url "logout" %}{% if logout_to %}?next={{ logout_to }}{% endif %}'>{% trans "Log Out" %}</a>
+  <div class="nav-item dropdown">
+    <a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" title="{{ user.username }}">
+      <img src="{% gravatar_url user.email 26 %}" alt="{{ user.username }}">
+    </a>
+    <div class="dropdown-menu dropdown-menu-right" aria-labelledby="navbarDropdown">
+      <h6 class="dropdown-header">{{ user.username }}</h6>
+      {% if user.is_staff %}
+        <a target="_blank" class="dropdown-item" href="{% url 'admin:index' %}">{% trans "Admin" %}</a>
+      {% endif %}
+      <a class="dropdown-item" href='{% url "logout" %}{% if logout_to %}?next={{ logout_to }}{% endif %}'>{% trans "Log Out" %}</a>
+    </div>
+  </div>
 {% else %}
-{% url "login" as login_url %}
-{% ifnotequal login_url request.path %}
-    <a href='{{ login_url }}'>{% trans "Log In" %}</a>
-{% endifnotequal %}
+  {% url "cas_ng_login" as login_url %}
+  {% if login_url != request.path %}
+    <a id="login" class="nav-item nav-link" href='{{ login_url }}'>{% trans "Log In" %}</a>
+  {% endif %}
 {% endif %}