#1390 closed defect (fixed)
Add app name to title and navigation-bar in admin interface
| Reported by: | rfroger[at]estrate[dot]nl | Owned by: | Julia |
|---|---|---|---|
| Component: | contrib.admin | Version: | dev |
| Severity: | normal | Keywords: | nfa-someday |
| Cc: | Julia | Triage Stage: | Ready for checkin |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | yes |
| Easy pickings: | no | UI/UX: | no |
Description
I've got a suggestion/feature request which I'll explain by providing an example:
An app named 'book' with the models 'books' and 'categories' and an app named 'magazine' with the models 'magazines' and 'categories'. When I use the admin interface and I add or change a category for 'book' then the only way to know you are in the 'book' app is by looking at the URL. The title of the page tells me 'Add category' and the navigation bar tells me 'Home > Categories', which is exactly the same for magazine categories. I think it would be more user friendly if you can see (by just looking at the page) in which app you are. Maybe a title like 'Add category (books)' or 'Add book category' and the navigation bar with 'Home > Categories (book)' or 'Home > Book categories'.
The navigation bar could even show 'Home > Book > Categories', that introduces a new admin view which shows all models for one app.
By the way I'm using the trunk version. I'm new to Django so I can't provide you with a patch to add my suggestion (yet!).
Attachments (4)
Change History (28)
comment:1 by , 20 years ago
| Reporter: | changed from to |
|---|
comment:2 by , 19 years ago
| Triage Stage: | Unreviewed → Design decision needed |
|---|
comment:3 by , 19 years ago
comment:4 by , 19 years ago
| Triage Stage: | Design decision needed → Accepted |
|---|
Let's call this "accepted" so that somebody might be interested in writing a patch. It'll be easier to debate the final look with a patch to work against.
comment:5 by , 18 years ago
| Owner: | changed from to |
|---|
by , 18 years ago
| Attachment: | app-name-in-admin-breadcrumbs.diff added |
|---|
Extended breadcrums in admin (newforms-admin branch)
comment:6 by , 18 years ago
| Has patch: | set |
|---|---|
| Version: | SVN → newforms-admin |
The patch I attached extends admin's (newforms-admin) breadcrumbs placing app_label between Home and model name. It now looks as suggested by reporter:
'Home > Book > Categories'
I also introduced a new admin view which shows all models for one app so the app_label (Book in above example) is clickable.
The solution makes it easy to get to know what application a specific model belongs to, but I think that there are some design decisions needed to choose whether:
- Should app_label be clickable? Is it really useful to have a view on application specific models only?
- Should app_label visibility be configurable? Are there any situations when one doesn't want to see an application name? Maybe app_label should have also something like model's verbose_name?
- Does it still makes sense to add an application name to title? I think no, so I discontinued my work on it.
comment:7 by , 18 years ago
| Keywords: | nfa-someday added |
|---|---|
| Patch needs improvement: | set |
Assuming this patch still applies cleanly I think it should go in. Marking patch needs improvement so that it can be unchecked once verified or has been updated.
comment:9 by , 18 years ago
| Patch needs improvement: | unset |
|---|
I've updated the patch so it applies cleanly to rev. 6930 (latest one at the moment). I've unchecked path-needs-improvement tick.
comment:10 by , 17 years ago
| milestone: | → 1.0 |
|---|
by , 17 years ago
| Attachment: | updated_app_name_link.diff added |
|---|
comment:11 by , 17 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Added updated patch to reflect rev. 8252, post 1.0 alpha 2. Just a slight difference to reflect updates and changes to site.py in django/contrib/admin. I have tested locally and it works for me. Might want to think about expanding the navigation.
comment:12 by , 17 years ago
| Patch needs improvement: | set |
|---|---|
| Triage Stage: | Ready for checkin → Accepted |
A few quick comments from reading through this:
- Make sure you start from a clean tree with no other changes. The change in
django/contrib/auth/models.pyis unrelated to this (it was another patch you were creating yesterday). - Be careful not to change more than you need to. All the changes from double-quotes to single-quotes aren't changing any functionality, so they aren't necessary. Also, the change in
django/contrib/admin/options.pyon line 689 (line 692 in the new version) actually introduces a bug (for python 2.3). So be careful about not making unnecessary changes like that.
The rest of it -- the core functional changes -- look fine, although I haven't reviewed the additions in django/contrib/admin/sites.py beyond an initial read through yet.
comment:13 by , 17 years ago
This looks good to me. In addition to what Malcolm said the latest patch also is missing the app_index.html template. You likely need to do the svn add on the file before svn diff. :)
comment:14 by , 17 years ago
| Cc: | added |
|---|---|
| Version: | newforms-admin → SVN |
@brosner: I spoke to Julia in real life about this and she mentioned she's got the missing files on her laptop and will update the patch.
comment:15 by , 17 years ago
| Owner: | changed from to |
|---|---|
| Status: | new → assigned |
comment:16 by , 17 years ago
Updated patch to fix issues listed above - thanks guys! Also, idea to add a "Recent Actions" panel to this part of the admin interface (thanks to Nathan Borror). Working on this today and will keep you posted on my progress.
by , 17 years ago
| Attachment: | updated_app_name_link2.diff added |
|---|
comment:17 by , 17 years ago
| Triage Stage: | Accepted → Ready for checkin |
|---|
Spoke with Malcolm this morning and decided that the addition of "Recent Actions" to app_index.html template should be added post 1.0.
comment:18 by , 17 years ago
The updated_app_name_link2.diff patch passes all tests against r8466, and the admin changes work properly.
comment:19 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
comment:20 by , 17 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
comment:21 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
comment:22 by , 17 years ago
| Resolution: | fixed |
|---|---|
| Status: | closed → reopened |
The change made to django/contrib/admin/sites.py generated:
Traceback (most recent call last):
File "/usr/lib/python2.3/site-packages/django/core/handlers/base.py", line 86, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 175, in root
return self.app_index(request, url)
File "/usr/lib/python2.3/site-packages/django/contrib/admin/sites.py", line 392, in app_index
app_dict = {
UnboundLocalError: local variable 'model_dict' referenced before assignment
comment:23 by , 17 years ago
| Resolution: | → fixed |
|---|---|
| Status: | reopened → closed |
Please do not reopen this ticket, the original issue has been solved, if you find that there is a new issue, please open a new ticket.
This isn't a bad suggestion. Not worth worrying about in existing admin, but should be looked at for newforms-admin, once that's completed. Still needs design work to decide how to display the titles, since there are a few variations, but the concept seems sound.
Note that anybody thinking about this should focus on how the title as a whole looks, not how it looks in tabs, since difference browsers abbreviate tab titles in different ways (chopping at either the front or the back). So now arguments along the lines of "it should be this way because my browser's tabs show the first few characters", please.