Skip to content

Commit

Permalink
fix: "Django administration > Log out user" menu not working on Djang…
Browse files Browse the repository at this point in the history
…o 5.0
  • Loading branch information
erkesado committed Jan 25, 2024
1 parent 1428c0d commit c49ddcb
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 6 deletions.
35 changes: 35 additions & 0 deletions djangocms_admin_style/sass/components/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,41 @@
background: $color-primary;
}
}
form {
box-shadow: none;
margin: 0;
padding: 0;
button {
float: none;
white-space: nowrap;
line-height: 30px;
height: 30px;
padding: 0 10px 0 15px !important;
cursor: pointer;

border: none !important;
border-radius: 0 !important;
width: 100% !important;
color: $black !important;
font-size: $font-size-normal !important;
font-weight: bold;
font-family: $base-font-family !important;
text-align: left;

&:active,
&:focus {
filter: none !important;
box-shadow: none !important;
text-decoration: underline !important;
}
&:hover {
filter: none !important;
color: $white !important;
background: $color-primary !important;
text-decoration: none !important;
}
}
}
}
}
}
Expand Down

Large diffs are not rendered by default.

13 changes: 8 additions & 5 deletions djangocms_admin_style/templates/admin/inc/branding.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,14 @@ <h1>{{ site_header|default:_('Django Administration') }}</h1>
</li>
<li class="toolbar-item-navigation-break">-----</li>
{% endif %}
<li>
<a href="{% url 'admin:logout' %}">
<span>{% trans 'Log out' %} {% firstof user.get_short_name user.get_username %}</span>
</a>
</li>
{% if user.is_authenticated %}
<li>
<form method="POST" action="{% url 'admin:logout' %}">
{% csrf_token %}
<button type="submit">{% trans 'Log out' %} {% firstof user.get_short_name user.get_username %}</button>
</form>
</li>
{% endif %}
</ul>
</li>
</ul>
Expand Down

0 comments on commit c49ddcb

Please sign in to comment.