Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Listings filters and sorting for usage count #12550

Open
thibaudcolas opened this issue Nov 7, 2024 · 4 comments
Open

Listings filters and sorting for usage count #12550

thibaudcolas opened this issue Nov 7, 2024 · 4 comments
Labels

Comments

@thibaudcolas
Copy link
Member

Is your proposal related to a problem?

We’ve introduced image usage reporting a while ago (#3886), and as of a few releases Wagtail now has usage / references tracking across a lot of models. It’d be great to showcase this information in the different listings, so I don’t have to look at individual items to understand which ones have the highest usage count.

Describe the solution you'd like

For all models that are tracked in the reference index:

  1. Show usage count as a column in listings
  2. Support ordering by usage count (asc and desc / low to high and high to low)
  3. Possibly – support filtering by usage count?

Describe alternatives you've considered

Considered two alternatives:

  • This feels like it could also be a report ("images usage"), but seems like a lot of reports for something that’s useful as part of navigating through existing content.
  • Or possibly document how people can add those columns themselves, though this seems like a lot of work for built-in images and documents features where there might not be any other customization of the listings functionality.

Additional context

This is a follow-up to existing discussions in Universal listings (search and filtering) #10446.

Working on this

Anyone can contribute to this. View our contributing guidelines, add a comment to the issue once you’re ready to start.

@laymonage
Copy link
Member

This feels like it could also be a report ("images usage"), but seems like a lot of reports for something that’s useful as part of navigating through existing content.

Or, perhaps have one report that is filterable by the model?

Note that the image listing uses a grid view, so for images specifically it's going to need new designs rather than adding another column. Unless, we add the ability to toggle between grid and list view 🤔

@Rohit-Singh-01
Copy link

Rohit-Singh-01 commented Nov 7, 2024

hii ! You could add a " usage count " column in the Wagtail listings for tracked models, allowing for easy sorting and better content management. For images, since they use a grid view, introducing a toggle between grid and list views might be a good idea to balance design and usability. This way, you can keep the grid view clean while showing necessary data in a list view when needed and , I would love to look into it .

@Rohit-Singh-01
Copy link

But i have a doubt "Where should we implement the functionality to add a usage count column for the Image model in the Wagtail admin interface? Should I use the admin.py file for model registration and customization, or is it better to implement it in wagtail_hooks.py for Wagtail-specific customizations?"

@thibaudcolas
Copy link
Member Author

thibaudcolas commented Nov 11, 2024

Hi @Rohit-Singh-01, thank you for taking a look. I think even in images’ grid view we could find a way to display additional metadata for each image.

I don’t understand your question about admin.py and wagtail_hooks.py, neither of those files seem to contain the code that’s relevant here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants