Skip to content

Instantly share code, notes, and snippets.

@saml
Created January 27, 2016 22:50
Show Gist options
  • Save saml/d9e7f51fa761ad2257a1 to your computer and use it in GitHub Desktop.
Save saml/d9e7f51fa761ad2257a1 to your computer and use it in GitHub Desktop.
{% if user.is_authenticated and user.is_staff %}
<div id="user-tools">
{% trans 'Welcome,' %}
<strong>{% firstof user.first_name user.username %}</strong>.
{% block userlinks %}
{% url django-admindocs-docroot as docsroot %}
{% if docsroot %}
<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> /
{% endif %}
{% url admin:password_change as password_change_url %}
{% if password_change_url %}
<a href="{{ password_change_url }}">
{% else %}
<a href="{{ root_path }}password_change/">
{% endif %}
{% trans 'Change password' %}</a> /
{% url admin:logout as logout_url %}
{% if logout_url %}
<a href="{{ logout_url }}">
{% else %}
<a href="{{ root_path }}logout/">
{% endif %}
{% trans 'Log out' %}</a>
{% endblock %}
</div>
{% endif %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment