Opened 11 years ago

Closed 8 years ago

Last modified 5 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: master
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: UI/UX:

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 9 years ago.
Extended breadcrums in admin (newforms-admin branch)
app-name-in-admin-breadcrumbs2.diff (10.5 KB) - added by eXt 9 years ago.
Updated patch against 6930
updated_app_name_link.diff (10.3 KB) - added by Julia 8 years ago.
updated_app_name_link2.diff (8.7 KB) - added by Julia 8 years ago.

Download all attachments as: .zip

Change History (28)

comment:1 Changed 11 years ago by Jacob

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

comment:2 Changed 10 years ago by Simon G. <dev@…>

Triage Stage: UnreviewedDesign decision needed

comment:3 Changed 10 years ago by Malcolm Tredinnick

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 Changed 9 years ago by Malcolm Tredinnick

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 Changed 9 years ago by Jakub Wiśniowski

Owner: changed from nobody to Jakub Wiśniowski

Changed 9 years ago by Jakub Wiśniowski

Extended breadcrums in admin (newforms-admin branch)

comment:6 Changed 9 years ago by Jakub Wiśniowski

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 Changed 9 years ago by Brian Rosner

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 Changed 9 years ago by Brian Rosner

Marked #2292 as a duplicate of this.

Changed 9 years ago by eXt

Updated patch against 6930

comment:9 Changed 9 years ago by Jakub Wiśniowski

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 Changed 8 years ago by Jeff Anderson

milestone: 1.0

Changed 8 years ago by Julia

Attachment: updated_app_name_link.diff added

comment:11 Changed 8 years ago by Julia

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 Changed 8 years ago by Malcolm Tredinnick

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 Changed 8 years ago by Brian Rosner

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 Changed 8 years ago by Malcolm Tredinnick

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 Changed 8 years ago by Julia

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

comment:16 Changed 8 years ago by Julia

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.

Changed 8 years ago by Julia

Attachment: updated_app_name_link2.diff added

comment:17 Changed 8 years ago by Julia

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 Changed 8 years ago by Charlie La Mothe

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

comment:19 Changed 8 years ago by Charlie La Mothe

Resolution: fixed
Status: assignedclosed

comment:20 Changed 8 years ago by Charlie La Mothe

Resolution: fixed
Status: closedreopened

comment:21 Changed 8 years ago by Brian Rosner

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 Changed 8 years ago by evenrik

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 Changed 8 years ago by Alex Gaynor

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 Changed 5 years ago by Jacob

milestone: 1.0

Milestone 1.0 deleted

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