Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed #7810: added named URLs for admin docs, and use them in the adm…

…in base template. Thanks, MattBowen.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@8717 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 0871ff2c9c0745b203776467b9d6319adb7214fd 1 parent c068bc1
@jacobian jacobian authored
View
2  django/contrib/admin/templates/admin/base.html
@@ -22,7 +22,7 @@
{% block branding %}{% endblock %}
</div>
{% if user.is_authenticated and user.is_staff %}
- <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>
+ <div id="user-tools">{% trans 'Welcome,' %} <strong>{% if user.first_name %}{{ user.first_name|escape }}{% else %}{{ user.username }}{% endif %}</strong>. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %}</div>
{% endif %}
{% block nav-global %}{% endblock %}
</div>
View
46 django/contrib/admindocs/urls.py
@@ -2,14 +2,40 @@
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<view>[^/]+)/$', views.view_detail),
- ('^models/$', views.model_index),
- ('^models/(?P<app_label>[^\.]+)\.(?P<model_name>[^/]+)/$', views.model_detail),
-# ('^templates/$', views.template_index),
- ('^templates/(?P<template>.*)/$', views.template_detail),
+ url('^$',
+ views.doc_index,
+ name='django-admindocs-docroot'
+ ),
+ url('^bookmarklets/$',
+ views.bookmarklets,
+ name='django-admindocs-bookmarklets'
+ ),
+ url('^tags/$',
+ views.template_tag_index,
+ name='django-admindocs-tags'
+ ),
+ url('^filters/$',
+ views.template_filter_index,
+ name='django-admindocs-filters'
+ ),
+ url('^views/$',
+ views.view_index,
+ name='django-admindocs-views-index'
+ ),
+ url('^views/(?P<view>[^/]+)/$',
+ views.view_detail,
+ name='django-admindocs-views-detail'
+ ),
+ url('^models/$',
+ views.model_index,
+ name='django-admindocs-models-index'
+ ),
+ url('^models/(?P<app_label>[^\.]+)\.(?P<model_name>[^/]+)/$',
+ views.model_detail,
+ name='django-admindocs-models-detail'
+ ),
+ url('^templates/(?P<template>.*)/$',
+ views.template_detail,
+ name='django-admindocs-templates'
+ ),
)
Please sign in to comment.
Something went wrong with that request. Please try again.