|
1 | 1 | {% load i18n static %}
|
2 | 2 |
|
3 |
| -{% block extra_js %} |
4 |
| - <script defer src="{% static 'user_menu.js' %}"></script> |
5 |
| -{% endblock %} |
6 |
| - |
7 |
| -<div class="usermenu__container"> |
8 |
| - <div class="usermenu__wrapper"> |
| 3 | +<div class="user-indicator__container"> |
| 4 | + <div id="js-user-indicator" class="user-indicator__wrapper"> |
9 | 5 | {% if request.user.is_authenticated %}
|
10 | 6 | <button
|
11 |
| - class="js-usermenu-btn" |
| 7 | + id="js-user-indicator-trigger" |
12 | 8 | type="button"
|
13 | 9 | aria-haspopup="menu"
|
14 |
| - aria-controls="user-actions" |
| 10 | + aria-controls="js-user-indicator-dropdown" |
15 | 11 | tabindex="0">
|
16 | 12 | <i class="fas fa-user text--color-primary" aria-hidden="true"></i>
|
17 | 13 | {{ request.user.username }}
|
18 | 14 | </button>
|
19 |
| - <div role="menu" class="dropdown js-usermenu" id="user-actions" aria-label="Login of Register" tabindex="-1"> |
| 15 | + <div role="menu" class="dropdown" id="js-user-indicator-dropdown" aria-label="Login of Register" tabindex="-1"> |
20 | 16 | <ul class="list--clean">
|
21 |
| - <li ><a href="{% url 'account' %}" role="menuitem">{% translate "Account Settings" %}</a></li> |
| 17 | + <li><button id="js-user-indicator-close" type="button" class="button button--close user-indicator__close" title="{% translate 'close' %}" aria-label="{% translate 'menu close' %}"></button></li> |
| 18 | + <li><a href="{% url 'account' %}" role="menuitem">{% translate "Account Settings" %}</a></li> |
22 | 19 | {% for organisation in request.user.organisations %}
|
23 | 20 | <li><a href="{% url 'a4dashboard:project-list' organisation_slug=organisation.slug %}" role="menuitem">{{ organisation.name }}</a></li>
|
24 | 21 | {% endfor %}
|
25 | 22 | {% if request.user.is_superuser %}
|
26 | 23 | <li><a href="{% url 'meinberlin_platformemails:create' %}" role="menuitem">{% translate "Platform Email" %}</a></li>
|
27 | 24 | {% endif %}
|
28 | 25 | <li>
|
29 |
| - <form class="u-inline" action="{% url 'account_logout' %}" method="post" aria-label="{% translate 'Logout' %}" role="menuitem"> |
| 26 | + <form class="block--nogap text--color-dark" action="{% url 'account_logout' %}" method="post" aria-label="{% translate 'Logout' %}" role="menuitem"> |
30 | 27 | {% csrf_token %}
|
31 | 28 | <input type="hidden" name="next" value="{{ redirect_field_value }}">
|
32 | 29 | <button type="submit">{% translate "Logout" %}</button>
|
|
36 | 33 | </div>
|
37 | 34 | {% else %}
|
38 | 35 | <button
|
39 |
| - class="js-usermenu-btn" |
| 36 | + id="js-user-indicator-trigger" |
40 | 37 | type="button"
|
41 | 38 | aria-haspopup="menu"
|
42 |
| - aria-controls="login-register-menu" |
| 39 | + aria-controls="js-user-indicator-dropdown" |
43 | 40 | tabindex="0">
|
44 | 41 | <i class="fas fa-user text--color-primary" aria-hidden="true"></i>
|
45 | 42 | {% translate "Login" %}
|
46 | 43 | </button>
|
47 |
| - <div role="menu" class="dropdown js-usermenu" id="login-register-menu" aria-label="Login of Register" tabindex="-1"> |
| 44 | + <div role="menu" class="dropdown" id="js-user-indicator-dropdown" aria-label="Login of Register" tabindex="-1"> |
48 | 45 | <ul class="list--clean">
|
49 |
| - <li><button type="button" class="button button--close user-indicator__close" title="{% translate 'close' %}" aria-label="{% translate 'menu close' %}"></button></li> |
| 46 | + <li><button id="js-user-indicator-close" type="button" class="button button--close user-indicator__close" title="{% translate 'close' %}" aria-label="{% translate 'menu close' %}"></button></li> |
50 | 47 | <li>
|
51 |
| - <a href="{% url 'account_login' %}?next={{ redirect_field_value|urlencode }}" role="menuitem">{% translate "Login" %}</a> |
| 48 | + <a class="button button--light" href="{% url 'account_login' %}?next={{ redirect_field_value|urlencode }}" role="menuitem">{% translate "Login" %}</a> |
52 | 49 | </li>
|
53 | 50 | <li>
|
54 | 51 | <a href="{% url 'account_signup' %}?next={{ redirect_field_value|urlencode }}" role="menuitem">{% translate "Register" %}</a>
|
|
0 commit comments