Ticket #6962: 6962_admindoc_url_fix.1.diff

File 6962_admindoc_url_fix.1.diff, 1.8 KB (added by brosner, 7 years ago)

use a named url for admin doc

  • django/contrib/admin/templates/admin/base.html

    diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html
    index 479e18b..ecc9b30 100644
    a b  
    2222        {% block branding %}{% endblock %}
    2323        </div>
    2424        {% if user.is_authenticated and user.is_staff %}
    25         <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
     25        <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}<a href="{% url admin_doc_index %}">{% trans 'Documentation' %}</a> / <a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
    2626        {% endif %}
    2727        {% block nav-global %}{% endblock %}
    2828    </div>
  • django/contrib/admindocs/urls.py

    diff --git a/django/contrib/admindocs/urls.py b/django/contrib/admindocs/urls.py
    index e7baa76..117bcef 100644
    a b from django.conf.urls.defaults import * 
    22from django.contrib.admindocs import views
    33
    44urlpatterns = patterns('',
    5     ('^$', views.doc_index),
     5    ('^$', views.doc_index, {}, "admin_doc_index"),
    66    ('^bookmarklets/$', views.bookmarklets),
    77    ('^tags/$', views.template_tag_index),
    88    ('^filters/$', views.template_filter_index),
Back to Top