-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Rearrange order of Snippets in ModelViewSet index view #10816
Comments
@Timusan I would like to work on this issue. Can you please assign it to me. |
@abhinav700 Awesome that you want to work on this! However, I am not the maintainer of the Wagtail repo so I am unable to assign tickets to someone I'm afraid. |
@abhinav700 - I'm not sure that this functionality is suited to Wagtail core. It would need some discussion on how you intend to implement this before any kind of PR or Dev starts. I think the best solution would be for the existing package, or a new package, be managed by the community for this kind of thing. There is some functionality for ordering in the admin (pages), maybe it's worth exploring making that JS code reusable with migrating it to Stimulus. This would pave the way for part of this functionality to be usable in Snippets. If you're keen on contributing that JavaScript change, I can raise a new issue that specifies what's needed. |
@lb- Yeah, I would like to contribute that javascript change. Can you please raise that issue? |
@abhinav700 - #10909 created. |
Now that #10909 is in, we're in a good position to consider what the server-side code for this would look like. Proposed outline:
|
Is your proposal related to a problem?
With the deprecation of ModelAdmin in favor of Snippets we lose the functionality delivered by Wagtail Orderable: Ordering Snippets in the Index view by the use of drag & drop.
Describe the solution you'd like
As is already the case for a listing of Page models (using the "Sort menu order" feature), enable Snippets to be ordered by drag & drop. It seems Wagtail admin's core already has the functionality build in. Enabling custom sort order this way would, as with Pages, negate the sorting columns. Clicking on a header column for sort disables the drag & drop again.
The above module, that does this for ModelAdmin, adds in a
sort_order
field to do its bidding, yet extending the functionality that the Pages Index already uses would fit more as no third-party package is needed.The text was updated successfully, but these errors were encountered: