0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-29 17:36:49 +01:00
Commit Graph

15955 Commits

Author SHA1 Message Date
Matt Westcott
85a4a9ebf7 Release note for #10939 in 5.1.2 2023-09-22 18:34:32 +01:00
Matt Westcott
02a08ff2be Allow BaseSiteSetting instances retrieved via for_request to be pickled
Strip out the cached _request attribute which breaks pickling. Fixes #10879
2023-09-22 18:32:01 +01:00
Matt Westcott
e6e29b5518 Release note for #10935 2023-09-22 11:46:21 +01:00
Matt Westcott
240b65f309 Use more concise code for appending to classname 2023-09-22 11:44:24 +01:00
Matt Westcott
981ca512e5 Move 'sort menu order' URL logic to PageListingSortMenuOrderButton 2023-09-22 11:44:24 +01:00
Matt Westcott
f1ef9bd22c Move show-or-not tests into the button classes 2023-09-22 11:44:24 +01:00
Matt Westcott
7111e1ea85 Move the 'should I add a next parameter to the delete action' logic into PageListingDeleteButton 2023-09-22 11:44:24 +01:00
Matt Westcott
7e3cf66071 Allow settting attrs at the class level 2023-09-22 11:44:24 +01:00
Matt Westcott
6e7eaea08b Render all of self.attrs in the dropdown item rendering of a button, not just aria-label
This is needed to correctly pass the `rel="noreferrer"` attribute for the view-draft and view-live actions.
2023-09-22 11:44:24 +01:00
Matt Westcott
3dbff3b6a5 Allow specifying a url_name at the class level 2023-09-22 11:44:24 +01:00
Matt Westcott
2c66d58620 Support setting aria-label format at the class level 2023-09-22 11:44:24 +01:00
Matt Westcott
c05c2ccb6e Create button subclasses for page listing buttons 2023-09-22 11:44:24 +01:00
Matt Westcott
e195b01502 Allow setting label and icon_name at the class level rather than just the constructor 2023-09-22 11:44:24 +01:00
Matt Westcott
45beb8ce56 Use PageListingButton for all buttons registered for page listings
This will allow us to do some cleverer refactoring shortly.
2023-09-22 11:44:24 +01:00
Matt Westcott
ba1870be3a Do not pass on classname to buttons rendered via _dropdown_items.html
There are no useful classnames available for dropdown items, and not passing this on means that we can use ListingButton instances here without the standard button styles interfering with the rendering.
2023-09-22 11:44:24 +01:00
Matt Westcott
f3adefe362 Replace 'classes' argument with a 'classname' string
as per https://docs.wagtail.org/en/stable/contributing/general_guidelines.html#use-classname-in-python-html-template-tag-variables
2023-09-22 11:44:24 +01:00
Matt Westcott
26c2e686f1 make the code for joining a list of classnames with spaces a bit less enterprisey 2023-09-22 11:44:24 +01:00
Matt Westcott
276d0c1a2b Remove unnecessary test on len(bulk_actions_list) 2023-09-22 11:44:24 +01:00
Matt Westcott
c9edee3894 Remove button_classes kwarg from ButtonWithDropdown
It does exactly the same thing as the existing `classes` kwarg.
2023-09-22 11:44:24 +01:00
Matt Westcott
eb44925c58 Convert buttons to components 2023-09-22 11:44:24 +01:00
Matt Westcott
f27aecc465 Eliminate unnecessary context variables from _page_header_buttons.html
It's only used in this one place, so things like classnames can be hard-coded instead of passing them as variables.
2023-09-22 11:44:24 +01:00
Matt Westcott
c7005b944f Remove redundant |safe filter
All button classes defined in wagtail.admin.widgets.button use either format_html or render_to_string, which mark their results as safe. And if you pass some other object as part of the buttons list that isn't as well-behaved, it's probably about time you fixed that...
2023-09-22 11:44:24 +01:00
Matt Westcott
eaaf450c14 drop buttons_data argument from ButtonWithDropdown in favour of passing Button instances
If Button instances are going to be our standard mechanism for passing the bundle of properties for a menu item, we don't need to invent another one.
2023-09-22 11:44:24 +01:00
SebCorbin
0ab4bb8db5 Make admin login template display non_fields_errors
- Add tests
- Fixes #10912
2023-09-22 07:27:24 +10:00
Matt Westcott
689c7dcbd8 Update linter versions in package.json, setup.py and pre-commit hooks 2023-09-21 17:25:08 +01:00
Andreas Nüßlein
6eda5d5d12 fix typo 2023-09-21 16:45:57 +01:00
Sage Abdullah
faaab535b0
Release notes for #10900 2023-09-21 12:21:39 +01:00
Sage Abdullah
ce8f655b6f
Add upgrade considerations for ModelViewSet URL changes 2023-09-21 12:21:14 +01:00
Sage Abdullah
9fbc62ab52
Mark ModelViewSet and SnippetViewSet legacy URL patterns for removal 2023-09-21 12:21:14 +01:00
Sage Abdullah
f6c2f0bd95
Add legacy URL patterns for ModelViewSet's edit and delete URLs
In case people hardcode the URLs instead of using reverse().

Unify the legacy redirects with SnippetViewSet to use the same
_legacy_urlpatterns property.
2023-09-21 12:21:14 +01:00
Sage Abdullah
f77125155f
Change FeatureCompleteToy test model to use custom CharField primary key 2023-09-21 12:21:14 +01:00
Sage Abdullah
38c9e1d521
Safely use unquote() by converting to pks to str first 2023-09-21 12:21:14 +01:00
Sage Abdullah
05a846423a
Allow non-integer primary keys in ModelViewSet 2023-09-21 12:21:13 +01:00
Sage Abdullah
47af24381e
Do not use super().get_urlpatterns in ModelViewSet and SnippetViewSet
In ModelViewSet, this doesn't do anything as the base ViewSet class
returns an empty list.

In SnippetViewSet, this causes the ModelViewSet's urlpatterns to be
carried over, resulting in duplicate URLs that we do not want.
2023-09-21 12:21:13 +01:00
Stefan Hammer
bc09537136 Fix theme of logo in README.md
Github seems to have removed the dark-mode/light-mode switch using a URL-fragment.
2023-09-21 20:56:42 +10:00
Matt Westcott
235f1f4104 Set title line-height in em rather than rem 2023-09-21 09:51:51 +01:00
Matt Westcott
2ed0910e26 Remove margin on ul elements within tables
Fixes the Usage view - https://github.com/wagtail/wagtail/pull/10896#discussion_r1328281681
2023-09-21 09:51:51 +01:00
Matt Westcott
19e57cda7f Adjust page header actions menu to match the order in the listing 2023-09-21 09:51:51 +01:00
Matt Westcott
fa5decfb5f Remove unnecessary utility classes from page title icons 2023-09-21 09:51:51 +01:00
Matt Westcott
9d1b38030f Remove outdated comments about setting up permissions to only give certain buttons
These were only relevant when the assertions were retrieving the relevant buttons by index.

These were only meaningful when
2023-09-21 09:51:51 +01:00
Matt Westcott
4815ae03d5 Move Edit action into the 'more' dropdown 2023-09-21 09:51:51 +01:00
Matt Westcott
4c7a1aae94 Make action buttons in listings always visible 2023-09-21 09:51:51 +01:00
Matt Westcott
29244cf006 Fix mismatches between aria-label and title in buttons
We have mostly standardised on passing an "aria-label" attribute when constructing buttons. However, _dropdown_items.html was still trying to pull this from 'title' when producing its own rendering of the button (probably because you can't write `{{ button.attrs.aria-label }}` in a template...) which meant that the original aria-label attribute wasn't being passed through. Fix this so that we consistently expect an aria-label attribute everywhere, and correct for this in the base Button class if a 'title' attribute has been passed instead.
2023-09-21 09:51:51 +01:00
Matt Westcott
210a9c5df3 Set title-wrapper to inline so we don't have to change it to a span everywhere 2023-09-21 09:51:51 +01:00
Matt Westcott
04eca55b13 Add folder icon for pages with children 2023-09-21 09:51:51 +01:00
Matt Westcott
1746cdec58 Remove align-top classname and use top alignment in listings as standard
This is the most sensible rendering when one cell's content is overly tall - see for example the thumb image column on the bakerydemo People listing.
2023-09-21 09:51:51 +01:00
Matt Westcott
7ee53a9714 Update listing table styling 2023-09-21 09:51:51 +01:00
Matt Westcott
7dc6be54a8 Move all but the Edit button into More 2023-09-21 09:51:51 +01:00
Matt Westcott
3ad7c54267 Allow specifying icon on a dropdown button 2023-09-21 09:51:51 +01:00
Matt Westcott
32caf644c0 Move dropdown button contents into an include 2023-09-21 09:51:51 +01:00