Ticket #7810: named-urls-admindocs-7810.diff

File named-urls-admindocs-7810.diff, 2.8 KB (added by MattBowen, 16 years ago)

adds names for the admindocs urls and uses the named URL in admin's base.html

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

     
    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 django-admindocs-docroot %}">{% 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

     
    22from django.contrib.admindocs import views
    33
    44urlpatterns = patterns('',
    5     ('^$', views.doc_index),
    6     ('^bookmarklets/$', views.bookmarklets),
    7     ('^tags/$', views.template_tag_index),
    8     ('^filters/$', views.template_filter_index),
    9     ('^views/$', views.view_index),
    10     ('^views/(?P<view>[^/]+)/$', views.view_detail),
    11     ('^models/$', views.model_index),
    12     ('^models/(?P<app_label>[^\.]+)\.(?P<model_name>[^/]+)/$', views.model_detail),
     5    url('^$', views.doc_index, name='django-admindocs-docroot'),
     6    url('^bookmarklets/$', views.bookmarklets, name='django-admindocs-bookmarklets'),
     7    url('^tags/$', views.template_tag_index, name='django-admindocs-tags'),
     8    url('^filters/$', views.template_filter_index, name='django-admindocs-filters'),
     9    url('^views/$', views.view_index, name='django-admindocs-views-index'),
     10    url('^views/(?P<view>[^/]+)/$', views.view_detail, name='django-admindocs-views-detail'),
     11    url('^models/$', views.model_index, name='django-admindocs-models-index'),
     12    url('^models/(?P<app_label>[^\.]+)\.(?P<model_name>[^/]+)/$', views.model_detail, name='django-admindocs-models-detail'),
    1313#    ('^templates/$', views.template_index),
    14     ('^templates/(?P<template>.*)/$', views.template_detail),
     14    url('^templates/(?P<template>.*)/$', views.template_detail, name='django-admindocs-templates'),
    1515)
Back to Top