From 0871ff2c9c0745b203776467b9d6319adb7214fd Mon Sep 17 00:00:00 2001 From: Jacob Kaplan-Moss Date: Fri, 29 Aug 2008 19:28:53 +0000 Subject: [PATCH] Fixed #7810: added named URLs for admin docs, and use them in the admin base template. Thanks, MattBowen. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8717 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- .../contrib/admin/templates/admin/base.html | 2 +- django/contrib/admindocs/urls.py | 46 +++++++++++++++---- 2 files changed, 37 insertions(+), 11 deletions(-) diff --git a/django/contrib/admin/templates/admin/base.html b/django/contrib/admin/templates/admin/base.html index 479e18b2ee3..f99e6d88b62 100644 --- a/django/contrib/admin/templates/admin/base.html +++ b/django/contrib/admin/templates/admin/base.html @@ -22,7 +22,7 @@ {% block branding %}{% endblock %} {% if user.is_authenticated and user.is_staff %} -
{% trans 'Welcome,' %} {% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}. {% block userlinks %}{% trans 'Documentation' %} / {% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %}
+
{% trans 'Welcome,' %} {% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}{% trans 'Documentation' %} / {% endif %}{% trans 'Change password' %} / {% trans 'Log out' %}{% endblock %}
{% endif %} {% block nav-global %}{% endblock %} diff --git a/django/contrib/admindocs/urls.py b/django/contrib/admindocs/urls.py index e7baa76fc04..57edb5697bc 100644 --- a/django/contrib/admindocs/urls.py +++ b/django/contrib/admindocs/urls.py @@ -2,14 +2,40 @@ from django.conf.urls.defaults import * from django.contrib.admindocs import views urlpatterns = patterns('', - ('^$', views.doc_index), - ('^bookmarklets/$', views.bookmarklets), - ('^tags/$', views.template_tag_index), - ('^filters/$', views.template_filter_index), - ('^views/$', views.view_index), - ('^views/(?P[^/]+)/$', views.view_detail), - ('^models/$', views.model_index), - ('^models/(?P[^\.]+)\.(?P[^/]+)/$', views.model_detail), -# ('^templates/$', views.template_index), - ('^templates/(?P