Author: jacob
Date: 2008-08-29 14:28:53 -0500 (Fri, 29 Aug 2008)
New Revision: 8717

Modified:
   django/trunk/django/contrib/admin/templates/admin/base.html
   django/trunk/django/contrib/admindocs/urls.py
Log:
Fixed #7810: added named URLs for admin docs, and use them in the admin base 
template. Thanks, MattBowen.

Modified: django/trunk/django/contrib/admin/templates/admin/base.html
===================================================================
--- django/trunk/django/contrib/admin/templates/admin/base.html 2008-08-29 
19:28:03 UTC (rev 8716)
+++ django/trunk/django/contrib/admin/templates/admin/base.html 2008-08-29 
19:28:53 UTC (rev 8717)
@@ -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>

Modified: django/trunk/django/contrib/admindocs/urls.py
===================================================================
--- django/trunk/django/contrib/admindocs/urls.py       2008-08-29 19:28:03 UTC 
(rev 8716)
+++ django/trunk/django/contrib/admindocs/urls.py       2008-08-29 19:28:53 UTC 
(rev 8717)
@@ -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'
+    ),
 )


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to