Thursday, April 27, 2017

Django admin base.html template

I would like to suggest a small change to
contrib/admin/templates/admin/base.html ...

33 {% block userlinks %}
34 {% if site_url %}
35 <a href="{{ site_url }}">{% trans 'View site' %}</a> /
36 {% endif %}
37 {% if user.is_active and user.is_staff %}
38 {% url 'django-admindocs-docroot' as docsroot %}
39 {% if docsroot %}
40 <a href="{{ docsroot }}">{% trans
'Documentation' %}</a> /
41 {% endif %}
42 {% endif %}
43 {% if user.has_usable_password %}
44 <a href="{% url 'admin:password_change' %}">{% trans
'Change password' %}</a> /
45 {% endif %}
46 <a href="{% url 'admin:logout' %}">{% trans 'Log out'
%}</a>
47 {% endblock %}

... to include a new block around the docsrootfrom line 37 (above) to 42
inclusive. The business case (for me) is that ordinary user.is_staff
users have no interest in the innards of the design, models, tags etc.
Superusers are interested but not the others.

Hence, if that bit of the template were surrounded by a new block - say
{% docs %} - then I could over-ride just that bit and send ordinary
users to the user-documentation instead.

Thoughts?

Mike

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/39ffd3dc-557e-5676-3558-7f0d4c33199f%40dewhirst.com.au.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment