#7810 closed (fixed)
Url to contrib.admindocs is still hardcoded in base template of contrib.admin
Reported by: | Remco Wendt | Owned by: | Jacob |
---|---|---|---|
Component: | contrib.admin | Version: | dev |
Severity: | Keywords: | ||
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | yes |
Easy pickings: | no | UI/UX: | no |
Description
In revision 7947 of newforms-admin, the base template of contrib.admin app still hardlinks to the admindocs with:
<a href="{{ root_path }}doc/">{% trans 'Documentation' %}</a>
This behaviour is incorrect, since users now decide for themselves where the admindocs recide. The hard coding of the url effectively forces a user to add:
(r'^admin/doc/', include('django.contrib.admindocs.urls')),
Above their admin app mapping in urls.py. In the current situation changing the url to for example be:
(r'^admin/documentation/', include('django.contrib.admindocs.urls')),
In #6962 it was already mentioned to use a named url, since there is coupling between the admin and admindocs app anyway.
Attachments (1)
Change History (16)
comment:1 by , 16 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:2 by , 16 years ago
Version: | newforms-admin → SVN |
---|
comment:3 by , 16 years ago
milestone: | 1.0 alpha → 1.0 beta |
---|
comment:4 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
by , 16 years ago
Attachment: | named-urls-admindocs-7810.diff added |
---|
adds names for the admindocs urls and uses the named URL in admin's base.html
comment:5 by , 16 years ago
I used the namespace django-admindocs-* for all the named pattens; it's a little long, but it will likely be unique for applications (unless someone is looking for trouble), and it probably won't need to be typed often anyway. This change has the interesting side effect of making the Documentation url simple point to the admin's root if the admindocs URLs are not loaded. This gets rid of the 404, but is arguably a more confusing behavior.
comment:6 by , 16 years ago
It looks like I missed some spots in bookmarkets, so I'm revising my patch.
comment:7 by , 16 years ago
Has patch: | set |
---|
comment:8 by , 16 years ago
Triage Stage: | Accepted → Ready for checkin |
---|
Ran this against rev. 8229, changed the admin doc urls, and this does what it's supposed to. Marking ready for checkin.
comment:10 by , 16 years ago
milestone: | 1.0 beta → 1.0 |
---|
comment:11 by , 16 years ago
Patch needs improvement: | set |
---|---|
Triage Stage: | Ready for checkin → Accepted |
I have some Secret Inside Knowledge(tm) here. Matt's patch was done at the DC sprint on August 1 and after he attached it, we realised there was one problematic case: bookmarklets. They assume there is a single admin site (no longer necessarily true) and seem to have to make some assumptions about the URL of that site.
The patch here is a good start, but it doesn't quite solve all the problems (see comment:6). We need to make a decision about bookmarklets -- carve them off to somewhere else,? Require configuration? Inventive third option we didn't think of yet? But current patch only shuffles the bugs until that is worked out.
(Remember, campers, tickets aren't the place to do design work, so resist the urge to post random suggestions on that item in the comments. We have a mailing list for that.)
comment:12 by , 16 years ago
Owner: | changed from | to
---|---|
Status: | assigned → new |
comment:13 by , 16 years ago
Status: | new → assigned |
---|
comment:14 by , 16 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Not critical for 1.0-alpha.