Adding the admin nav sidebar to (almost) every page

The admin sidebar was built with a lot of compromises. I am still not very happy that it can be disabled, but that’s another forum post. One thing that bothers me still is that we ended up not adding it to the site index and app index pages. From my unreliable memory this is because it would just duplicate what the index does. I think this is a good thing. Having multiple options to move around a site (nav bar, body links, breadcrumbs, site map, etc.) is very useful (and an accessibility criterion). It’s also not redundant on the app index because it also shows models not in the current app.

I think there is a bit of work involved to do this, especially to make sure all models are in the sidebar on the app list page, but I think nothing too difficult.

Not having this has led to tickets like 34044, which to me feels like more of a hack than a feature. I personally don’t really like having the filter work one way for some pages, but a totally different way for other pages, because of (what I believe is) a bad decision that I agreed to at the time and accept my own contribution to.

When I say “almost” in the title, we of course shouldn’t have it for pages where you’re not logged in :slight_smile:

2 Likes

I think @thibaudcolas is raising the idea of modernising the admin. Is this effort part of that?

Not necessarily, though I can say that any modernised admin would have the sidebar on every page.

One thing I also forgot to mention is that having the sidebar on the index page in particular frees up the main content of the page to have other info on it. Perhaps some metrics. Something user-defined most likely but just having the ability to do that without breaking your navigation or having to compromise by having both nav and whatever else you need there would make life easier when doing something like this.

2 Likes

That sounds good. Cautiously intrigued by the suggestion. (I suspect it’s quite a bit job.)

I’m in favor of this idea. For the index page’s main content, besides metrics (where would this come from?), we could include the existing “recent actions” list.

What would be the plan for the Add/Change links? The index page has both, while the sidebar has only Add. As a Django (admin) user, I gotta confess that I haven’t used those :scream:. Considering that the Change pencil-link takes the user to the same page as clicking on the model’s name, I think it’s OK to drop it.

(As a side note, I think that a “Change” action next to a model name should take the user to a page to change model details (which does not exist, I know), not to a model instances list page.)

Thank you Tom!
Natalia.

I am the one currently working on ticket 34044 I also think this is a good idea. I had the concern of redundancy at index page but seeing main content put to other good use is great.

Perhaps I was a bit unclear, I don’t think we should do anything here ourselves but rather document a user overriding the main area of the page and adding context to do whatever they want.

Indeed the change link on the index is redundant, that’s why it was removed from the navbar, to save space.

For now we probably need to keep the model list on those pages as well as the sidebar can still be disabled. In the future, who knows.

1 Like

OH I was very excited about the idea of having some default content in the main area, even if minimal. I would suggest adding (by default, but overrideable) a (perhaps) extended view of the “recent actions” and maybe a list of app names only? While the sidebar does list the apps, if an app has a long list of models, and/or there is a lot of apps, many apps names are not visible, so I think that a list of apps could be handy in the admin landing page.

1 Like

I see Carlton cc-ed me and I never replied – Yes please! Yes, I think this would be an excellent change independently of other ways to modernise the admin. For the accessibility reasons you mentioned Tom (see SC 3.2.3 Consistent Navigation, SC 2.4.5 Multiple Ways). And just general UX - consistency of where navigation elements are placed.

As far as the index, I like this idea of an extended “recent actions” list. Could just start with the current list but have a datetime / relative time for each. I think the sidebar move will be valuable in its own right without also having to rework those index views, but afterwards they’d be great places to add different means of navigation.