Skip to content

Commit

Permalink
Add admin button
Browse files Browse the repository at this point in the history
  • Loading branch information
Xpirix committed Oct 2, 2024
1 parent 7a0ef15 commit d29b2e3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion qgis-app/static/style/scss/bulma/components/navbar.sass
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ body
color: $navbar-item-color
display: block
line-height: 1.5
padding: 0.5rem 1.75rem
padding: 0.5rem 1rem
position: relative
.icon
&:only-child
Expand Down
2 changes: 1 addition & 1 deletion qgis-app/static/style/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ p {
&.is-active {
display: block;
position: fixed;
height: 88dvh;
height: calc(100% - 112px);
overflow: auto;
left: 0;
animation: slideInFromLeft 0.3s ease-out forwards;
Expand Down
20 changes: 18 additions & 2 deletions qgis-app/templates/layouts/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,12 @@
{% endif %}
</div>
</div>
{% if user.is_authenticated and user.is_staff %}
<a class="navbar-item has-text-weight-semibold is-size-7" href="/admin">
<i class="fas fa-tools mr-3"></i>
{% trans "Admin" %}
</a>
{% endif %}

</div>
<div class="navbar-end">
Expand All @@ -78,9 +84,19 @@
</div>
<div class="navbar-item">
{% if user.is_authenticated %}
<a class="button is-danger is-small is-outlined" href="{% url "logout" %}">{% trans "Logout" %}</a>
<a class="button is-danger is-small is-outlined is-fullwidth" href="{% url "logout" %}">
<span class="icon">
<i class="fas fa-sign-out-alt"></i>
</span>
<span>
{% trans "Logout" %}
</span>
</a>
{% else %}
<a class="button is-info is-small" href="{% url "login" %}">{% trans "Login" %}</a>
<a class="button is-info is-small" href="{% url "login" %}">
<i class="fas fa-sign-in-alt mr-3"></i>
{% trans "Login" %}
</a>
{% endif %}
{% block navigation_extra %}
{% endblock %}
Expand Down

0 comments on commit d29b2e3

Please sign in to comment.