Wykres commitów

17794 Commity (f155546f65ac6c55d9bb4d36ad694760f2c1aff6)

Autor SHA1 Wiadomość Data
Sage Abdullah f155546f65
Ensure non-IndexView BaseListingView subclasses use the correct base templates
Now that the listing_results.html template supports rendering the "There
are x matches" message, we can enforce the consistency between the view
class and the template. Previously there were BaseListingView subclasses
(that are not IndexView subclasses) that used the index_results.html
template just to get that message when filtering.
2024-09-05 18:31:11 +01:00
Sage Abdullah e302c62ef2
Refactor page search view to be closer to universal listings implementation
- Use a single class with index_url_name, index_results_url_name,
  template_name, and results_template_name
- Extend generic/listing.html and generic/listing_results.html templates
- Set page_title and header_icon to show breadcrumbs properly
- Set is_searchable = True and keep using the custom search and
  filtering logic with the full get_queryset override to prevent scope
  creep for now
2024-09-05 18:31:11 +01:00
Sage Abdullah 000d417ec9
Move search implementation from IndexView to BaseListingView 2024-09-05 18:31:11 +01:00
Sage Abdullah c36b891e35
Replace IndexView.get_filterset_class with filterset_class cached property
This is now possible thanks to ViewSet.UNDEFINED. Previously, we would
be getting the unbound cached property instance from the view class,
only to pass it back to the view during as_view() – which results in a
broken state.
2024-09-05 18:31:10 +01:00
Sage Abdullah 9e36fa74b6
Move all interim support of non-breadcrumbs listing views to the index.html template
We want to remove all breadcrumbs_items check in the templates
eventually (as we want all listing views to use breadcrumbs). Instead of
having both BaseListingView's listing.html and IndexView's index.html
templates support the non-breadcrumbs case, do this only for the
index.html template.

The reasoning is because the BaseListingView was extracted more recently
as part of the Universal Listings work. When the filtering support was
moved from the IndexView to BaseListingView in 130c7ff, we still had to
support the non-breadcrumbs case due to the report views still using the
old filters implementation.

Now that we have migrated the report views to use the new AJAX-based
filtering, it's much less likely there's a BaseListingView subclass out
there that uses the non-breadcrumbs version. For such views, it's likely
they would work with IndexView too (as we haven't really documented
BaseListingView since its creation). So, put the interim support in the
IndexView template for now.

We could also completely drop the non-breadcrumbs case for both views,
but this would mean any custom listing view that uses filters now _must_
implement a results-only view _and_ enable breadcrumbs, or include the
filtering template themselves...
2024-09-05 18:31:10 +01:00
Sage Abdullah 3e758e65fd
Enforce breadcrumbs on all listing views
Add a base implementation of get_breadcrumbs_items() in BaseListingView
that uses the page_title and page_subtitle for the main breadcrumbs item
(the final, big one).

Then, remove the implementation in generic IndexView in favour of the base
one. Note that this changes the main breadcrumbs item label on IndexView
subclasses to prioritise the page_title attribute over the model's
verbose name plural.

This makes more sense – if you set page_title, you'd presumably want this
to be the one that shows up as the big title at the top too. This also
makes it consistent with how the <title> tag is generated. Previously,
they would go out of sync, as can be seen in Tasks and Users: the
breadcrumbs say 'Tasks' while the <title> tag says 'Workflow tasks', and
if a custom user model is used, the breadcrumbs say 'Custom user' while
the <title> tag only says Users.

---

Most of core views that extend from BaseListingView (including IndexView
subclasses) already use breadcrumbs at this point. Any custom listing
views, provided that they use the documented approaches, i.e.:

- ModelViewSet and SnippetViewSet index views
- Custom report views
- Custom form submission listing views
- Custom GroupViewSet and UserViewSet index views

also already use the breadcrumbs.

In core, the only BaseListingView subclass that doesn't yet use
breadcrumbs is the ContentTypeUseView (the "pages that use X type"
view). With this change, the view now nicely uses the breadcrumbs.

As for the generic/listing.html template, the only non-BaseListingView
view that uses it without breadcrumbs is the workflows usage view. It's
currently still a function-based view and the template overrides the
whole 'content' block, so it's unaffected.

Other than the above two, the only possible cases of a listing view that
doesn't use breadcrumbs in Wagtail core mean that they are:
- not a BaseListingView subclass, or
- not using a template that extends generic/listing.html

For code outside of Wagtail core, the only likely possibilities of a listing
view without breadcrumbs that would be affected by this change are:

- if a BaseListingView or IndexView subclass is registered directly (without
  being part of the above viewsets). In this case, they can set
  _show_breadcrumbs to False to undo the effect (but they really shouldn't).
- if the _show_breadcrumbs flag is already set to False on the view class
  or via the viewset. In this case, they won't be affected by the change.

For both cases, instead of setting _show_breadcrumbs to False
(essentially ignoring any problems), they should start looking into
fixing any issues they find with the breadcrumbs (if any – there likely
isn't).

We are planning to enforce breadcrumbs everywhere, so eventually we'll
drop the _show_breadcrumbs flag altogether. This commit starts from the
listing views, by setting it to True directly on the BaseListingView
instead of the subclasses.
2024-09-05 18:31:10 +01:00
Vince Salvino 9545193907 Add official hosting documentation
- Create a deploy section of the documentation
- Move fly.io deployment from tutorial to it's own page under deploy
- Clean up deployment docs and references throughout documentation
2024-09-03 07:59:20 +10:00
LB Johnston 4af8ab528b Documentation - formatting clean up 2024-08-29 18:32:20 +01:00
LB Johnston 7f2bcb677b Update 6.3 release notes (clean up + docs links) 2024-08-29 18:28:07 +01:00
LB Johnston 29d9b0d72e Add docs links for 6.2 release notes 2024-08-29 18:28:07 +01:00
LB Johnston 1790bdd158 Align recent docs & release notes to US spelling 2024-08-29 18:28:07 +01:00
LB Johnston 23d32faf36 Update NPM packages (minor only) 2024-08-29 18:25:19 +01:00
Matt Westcott 05d40271ae Test against psycopg 2 and 3 2024-08-29 18:04:06 +01:00
Matt Westcott 0d8b8386e2 Refactor StreamField get_prep_value for closer alignment with JSONField (#12269) 2024-08-29 18:04:06 +01:00
Matt Westcott 7051363f9f Change Twitter to X in security.md 2024-08-27 15:32:17 +01:00
Matt Westcott c574954a0a Release note for #12244 in 6.2.2 2024-08-27 15:06:15 +01:00
Matt Westcott ce5ba9efdf Add release note template for 6.2.2 2024-08-27 15:06:13 +01:00
Matt Westcott 50c4d32a54 Release note for #12251 2024-08-27 14:16:03 +01:00
Matt Westcott 2b96c3e364 Add clarifying comment to Column 2024-08-27 14:15:34 +01:00
Matt Westcott b670a3251b Remove now-unnecessary str wrapper 2024-08-27 14:15:34 +01:00
Matt Westcott 490acebcf5 Only patch number formatting functions if WAGTAIL_CHECK_TEMPLATE_NUMBER_FORMAT environment variable is set
The patch for filesizeformat in particular is quite heavyweight, and we don't want our CI to never test against the real version (for example, if it changes in a future Django release).
2024-08-27 14:15:34 +01:00
Matt Westcott ff7e016eb5 Patch number formatting functions during tests to flag up potential USE_THOUSAND_SEPARATOR issues 2024-08-27 14:15:34 +01:00
Matt Westcott 85c0047268 Audit all uses of localized/unlocalized numbers in templates
Address bugs caused by the `USE_THOUSAND_SEPARATOR=True` setting inserting commas where they are invalid, such as image width/height attributes. All numbers output on templates are now passed through one of `|unlocalize` (for numbers that must never have separators), `|intcomma` (for numbers displayed to users which should always include separators) or `|localize` (for when the choice is delegated to the project-wide setting).
2024-08-27 14:15:32 +01:00
Matt Westcott cbf06df4eb Prevent versioned_static failure when INSTALLED_APPS is a tuple
Fixes #12253
2024-08-27 08:55:05 +01:00
Matt Westcott 6857f6431a Release note for #12217 2024-08-23 16:18:18 +01:00
Jake Howard db331618b4 Ensure hashes are the correct length 2024-08-23 16:12:10 +01:00
Jake Howard 3fd329339e Use `INSTALLED_APPS` as a unique-ish id for masking version 2024-08-23 16:12:10 +01:00
Jake Howard f263f2a40f Use shorter digest for version hash
This helps protect the secret key by using a smaller digest, ensuring the previously-discarded data is included in the output hash. Using a salt and personalization also goes to further obscure the values.
2024-08-23 16:12:10 +01:00
Jake Howard 35c0d5d6e0 Remove secret key from icon sprite hash
This is just the hash of a file returned to the user - there's no need to salt it
2024-08-23 16:12:10 +01:00
Matt Westcott 5014d50490 Release note for #12226 2024-08-23 15:54:02 +01:00
Sage Abdullah a99df18f6c Optimise logic for showing 'Translate' button on the page listing
External translation packages e.g. wagtail-localize can make use of the annotation to get the same performance benefit
2024-08-23 15:53:16 +01:00
Sage Abdullah c5a90d3c7c Add missing globe icon in 'Translate' button in page listing dropdown 2024-08-23 15:53:16 +01:00
Sage Abdullah c46e07ef63 Use approved_schedule property for detecting ScheduledForPublishLock
We only need to know about the existence of a scheduled revision,
and not the revision itself.

This method is used by 'PagePermissionTester.can_unpublish', which
in turn is used by the 'Unpublish' button in the page listing 'more'
button. As a result, this method is run on every single item in the
listing.

We already have annotate_approved_schedule to optimise the display
of the 'scheduled' status tag (for pages). Use the approved_schedule
property so we can reuse that annotation instead of performing an
N+1 query.
2024-08-23 15:53:16 +01:00
SebCorbin d0098f394d Fix duplicate class attribute in image chooser (#12245) 2024-08-23 15:40:07 +01:00
vossisboss 7582a9932a Adding updated tutorial link requested by DIVIO. 2024-08-23 15:31:24 +01:00
SebCorbin b0b33514dd Fix typo in attribute (#12246) 2024-08-23 15:28:26 +01:00
Matt Westcott a59a2d0585 Update latest.txt for 6.2.1 2024-08-20 16:48:00 +01:00
Matt Westcott 688d833451 Fill in release date for 6.2.1 2024-08-20 16:20:46 +01:00
Matt Westcott 1ebe9a1a13 Fetch new translations from Transifex 2024-08-20 16:20:26 +01:00
Matt Westcott 9c921481dd Release note for #12237 2024-08-20 16:04:15 +01:00
Matt Westcott a7d243b9b6 Ensure that moderators without explicit edit permission on snippets are granted access to the ping endpoint
Fixes #12209
2024-08-16 13:21:37 +02:00
Matt Westcott deaf45309a Ensure that moderators without explicit edit permission on pages are granted access to the ping endpoint 2024-08-16 09:36:15 +01:00
Matt Westcott df08f99945 Avoid importing custom user models at load time in wagtail.admin.models
As per https://docs.djangoproject.com/en/5.0/topics/auth/customizing/#referencing-the-user-model , module-level code such as ForeignKey definitions should use `AUTH_USER_MODEL` rather than `get_user_model()`.

Probably fixes #12228 (unconfirmed)
2024-08-15 11:08:24 +01:00
Matt Westcott bd87ccf517 Release note for #12223 2024-08-13 20:23:56 +01:00
Sage Abdullah 986c08789a Add small gap between permissions in 'Custom permissions' column 2024-08-13 19:14:54 +01:00
Sage Abdullah 1825f5c60f Fix error when shift+clicking across groups in object permissions table 2024-08-13 19:14:54 +01:00
Sage Abdullah cf90275196 Move publish, lock, and unlock permissions to 'Custom permissions' column
These permissions only show up for models that have the corresponding
mixins enabled, which are likely to be the minority – which results in
the other rows having an empty cell for the column. This takes up space
in an already crowded table.

Move them to the "Custom permissions" column so we can reclaim the space
for other, more important columns.
2024-08-13 19:14:54 +01:00
Sage Abdullah f8589b3dcd Fix text alignment of model names in object permissions section 2024-08-13 19:14:54 +01:00
Matt Westcott 72b965cd94 Formalise support for Django 5.1 2024-08-12 11:26:44 +01:00
Sage Abdullah e83d23ca2a Fix broken task type filter in workflow task chooser modal (#12213)
Fixes #12210
2024-08-08 18:52:26 +01:00