Skip to content

Commit 3e2b1fc

Browse files
authored
feat: Add a bug report link to the menu bar (ietf-tools#4525)
This required making some horizontal room for it, mostly by showing a user photo or shorter tag when they are logged in.
1 parent 9b896e5 commit 3e2b1fc

4 files changed

Lines changed: 36 additions & 14 deletions

File tree

ietf/static/css/ietf.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,13 @@ th {
227227
}
228228
}
229229

230+
// Style the navbar user photo
231+
.nav-link .user-photo {
232+
object-fit: cover;
233+
height: 40px;
234+
width: 40px;
235+
}
236+
230237
// Style the righthand navigation panel
231238
#righthand-panel {
232239
max-height: 80vh;

ietf/templates/base.html

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,32 @@
4242
<img alt="IETF Logo" class="me-2"
4343
src="{% static 'ietf/images/ietf-logo-nor-white.svg' %}">
4444
Datatracker
45-
{% if server_mode and server_mode != "production" %}Dev Mode{% endif %}
45+
{% if server_mode and server_mode != "production" %}
46+
<span class="text-danger">&delta;</span>
47+
{% endif %}
4648
</a>
4749
<div class="collapse navbar-collapse" id="navbar-collapse">
4850
<ul class="nav navbar-nav">
4951
{% include "base/menu.html" with flavor="top" %}
5052
</ul>
5153
</div>
52-
{% if not user.is_authenticated %}
53-
<a class="d-none d-sm-block mx-5 btn {% if server_mode and server_mode == "production" %} btn-warning {% else %} btn-info {% endif %}"
54-
rel="nofollow"
55-
href="{% url 'ietf.ietfauth.views.login' %}?next={{ request.get_full_path|removesuffix:'accounts/logout/'|urlencode }}">
56-
Sign
57-
in
54+
<div class="d-flex align-items-center">
55+
<a class="nav-link {% if server_mode and server_mode != "production" %}text-danger{% else %}text-warning{% endif %} d-none d-xl-inline me-xl-4"
56+
target="_blank"
57+
href="https://github.com/ietf-tools/datatracker/issues/new/choose">
58+
Report a bug
59+
<i class="bi bi-bug"></i>
5860
</a>
59-
{% endif %}
60-
<div class="d-flex d-none d-lg-block">
61-
<label aria-label="Document search">
61+
62+
{% if not user.is_authenticated %}
63+
<a class="btn me-1 {% if server_mode and server_mode == "production" %} btn-warning {% else %} btn-info {% endif %} d-none d-sm-block"
64+
rel="nofollow"
65+
href="{% url 'ietf.ietfauth.views.login' %}?next={{ request.get_full_path|removesuffix:'accounts/logout/'|urlencode }}">
66+
Sign in
67+
</a>
68+
{% endif %}
69+
70+
<label class="d-none d-md-block" aria-label="Document search">
6271
<input class="form-control select2-field"
6372
id="navbar-doc-search"
6473
data-select2-ajax-url="{% url 'ietf.doc.views_search.ajax_select2_search_docs' model_name='docalias' doc_type='draft' %}"
@@ -137,7 +146,7 @@
137146
<span class="mx-2 text-danger">
138147
<i class="bi bi-bug"></i>
139148
Report a bug:
140-
<a class="text-reset" href="https://github.com/ietf-tools/datatracker/issues/new/choose">GitHub</a>
149+
<a class="text-reset" target="_blank" href="https://github.com/ietf-tools/datatracker/issues/new/choose">GitHub</a>
141150
{% if bugreport_email %}
142151
<a class="text-reset" href="mailto:{{ bugreport_email }}">Email</a>
143152
{% endif %}

ietf/templates/base/menu.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,7 @@
420420
{% endif %}
421421
<li>
422422
<a class="dropdown-item text-danger {% if flavor != 'top' %}text-wrap link-primary{% endif %}"
423-
href="https://github.com/ietf-tools/datatracker/issues/new/choose">
423+
target="_blank" href="https://github.com/ietf-tools/datatracker/issues/new/choose">
424424
<i class="bi bi-bug">
425425
</i>
426426
Report a bug

ietf/templates/base/menu_user.html

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,18 @@
55
<li class="nav-item dropdown">
66
{% if flavor == "top" %}
77
<a href="#"
8-
class="nav-link dropdown-toggle"
8+
class="nav-link dropdown-toggle{% if user.person.photo_thumb %} p-0{% endif %}"
99
role="button"
1010
data-bs-toggle="dropdown"
1111
aria-expanded="false">
1212
{% if user.is_authenticated %}
13-
{{ user }}
13+
{% if user.person.photo_thumb %}
14+
<img class="user-photo rounded-circle ms-1" width="40" height="40"
15+
src="{{ user.person.photo_thumb.url }}"
16+
alt="Photo of {{ user.person.name }}">
17+
{% else %}
18+
{{ user.username|split:'@'|first }}
19+
{% endif %}
1420
{% else %}
1521
User
1622
{% endif %}

0 commit comments

Comments
 (0)