Opened 19 years ago

Closed 16 years ago

Last modified 13 years ago

#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)

app-name-in-admin-breadcrumbs.diff (10.5 KB ) - added by Jakub Wiśniowski 17 years ago.
Extended breadcrums in admin (newforms-admin branch)
app-name-in-admin-breadcrumbs2.diff (10.5 KB ) - added by eXt 17 years ago.
Updated patch against 6930
updated_app_name_link.diff (10.3 KB ) - added by Julia 16 years ago.
updated_app_name_link2.diff (8.7 KB ) - added by Julia 16 years ago.

Download all attachments as: .zip

Change History (28)

comment:1 by Jacob, 19 years ago

Reporter: changed from rfroger@… to rfroger[at]estrate[dot]nl

comment:2 by Simon G. <dev@…>, 18 years ago

Triage Stage: UnreviewedDesign decision needed

comment:3 by Malcolm Tredinnick, 18 years ago

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.

comment:4 by Malcolm Tredinnick, 18 years ago

Triage Stage: Design decision neededAccepted

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 Jakub Wiśniowski, 17 years ago

Owner: changed from nobody to Jakub Wiśniowski

by Jakub Wiśniowski, 17 years ago

Extended breadcrums in admin (newforms-admin branch)

comment:6 by Jakub Wiśniowski, 17 years ago

Has patch: set
Version: SVNnewforms-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:

  1. Should app_label be clickable? Is it really useful to have a view on application specific models only?
  2. 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?
  3. 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 Brian Rosner, 17 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:8 by Brian Rosner, 17 years ago

Marked #2292 as a duplicate of this.

by eXt, 17 years ago

Updated patch against 6930

comment:9 by Jakub Wiśniowski, 17 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 Jeff Anderson, 17 years ago

milestone: 1.0

by Julia, 16 years ago

Attachment: updated_app_name_link.diff added

comment:11 by Julia, 16 years ago

Triage Stage: AcceptedReady 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 Malcolm Tredinnick, 16 years ago

Patch needs improvement: set
Triage Stage: Ready for checkinAccepted

A few quick comments from reading through this:

  1. Make sure you start from a clean tree with no other changes. The change in django/contrib/auth/models.py is unrelated to this (it was another patch you were creating yesterday).
  2. 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.py on 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 Brian Rosner, 16 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 Malcolm Tredinnick, 16 years ago

Cc: Julia added
Version: newforms-adminSVN

@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 Julia, 16 years ago

Owner: changed from Jakub Wiśniowski to Julia
Status: newassigned

comment:16 by Julia, 16 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 Julia, 16 years ago

Attachment: updated_app_name_link2.diff added

comment:17 by Julia, 16 years ago

Triage Stage: AcceptedReady 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 Charlie La Mothe, 16 years ago

The updated_app_name_link2.diff patch passes all tests against r8466, and the admin changes work properly.

comment:19 by Charlie La Mothe, 16 years ago

Resolution: fixed
Status: assignedclosed

comment:20 by Charlie La Mothe, 16 years ago

Resolution: fixed
Status: closedreopened

comment:21 by Brian Rosner, 16 years ago

Resolution: fixed
Status: reopenedclosed

(In [8474]) Fixed #1390 -- Added an app index in the admin interface. Thanks juliae and ext for their work on patches.

comment:22 by evenrik, 16 years ago

Resolution: fixed
Status: closedreopened

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 Alex Gaynor, 16 years ago

Resolution: fixed
Status: reopenedclosed

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.

comment:24 by Jacob, 13 years ago

milestone: 1.0

Milestone 1.0 deleted

Note: See TracTickets for help on using tickets.
Back to Top