0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-12-01 11:41:20 +01:00
Commit Graph

13994 Commits

Author SHA1 Message Date
Stefan Hammer
b2bdbfdb9b Synchronize i18n between timesince_simple and timesince_last_update
This lower-cases "Just now" and uses capfirst in the template.
Related: #9219
2022-10-06 06:30:00 +10:00
Stefan Hammer
a7fb8157d3 Improve timesince_last_update-tag
* "time_prefix" has been replaced by the boolean "show_time_prefix"
  to only handle the single prefix "at ".
* It now always uses complete gettext strings to allow better
  customization in each language.
* For dates older then the current date "user_display_name" is now
  used correctly.
* Improved the tests to handle some of the missing cases.
2022-10-06 06:30:00 +10:00
Matt Westcott
4c7e1ea1ce Add release note for #9279 and documentation for rebuild_references_index 2022-10-05 19:38:14 +01:00
Matt Westcott
32906b7f0a Add more detailed code comments for reference extraction 2022-10-05 19:38:14 +01:00
Matt Westcott
0b995bdcf6 Ensure that indexing a less-specific model doesn't delete references belonging to a more-specific one
(Mostly) fixes the issue described in https://github.com/wagtail/wagtail/pull/9170#issuecomment-1263592392. When deleting old references within `ReferenceIndex.create_or_update_for_object`, skip over any with a source content_type that does not match the currently-indexed object or any of its superclasses - these can be assumed to come from a more specific version of the object, with relations that we don't know about from inspecting the less-specific one.

This does have the side effect that once an object has been indexed in its more specific form, any invocations of create_or_update_for_object on the less-specific model will be over-cautious, and fail to delete records even if they legitimately refer to relations that exist on the base model - i.e. those references will stick around until the more specific model is indexed. This is a lesser bug than the original, though, and running `rebuild_references_index` will make the index consistent with the database state.
2022-10-05 19:38:14 +01:00
Matt Westcott
b882f0d281 Move snippet usage link to sidebar 2022-10-05 19:38:14 +01:00
Matt Westcott
be72dc5e96 Hide titles of items user doesn't have edit permission on 2022-10-05 19:38:14 +01:00
Matt Westcott
cf467cf7b3 Add reference extraction to document rich text link handler 2022-10-05 19:38:14 +01:00
Karl Hobley
d0fed42492 Check user has "change" permission when viewing object usage 2022-10-05 19:38:14 +01:00
Matt Westcott
5c3fb13335 Suppress output when running rebuild_references_index in tests 2022-10-05 19:38:14 +01:00
Karl Hobley
c8689acb37 Check field for .extract_references method instead of field type
Co-authored-by: Matt Westcott <matthew@torchbox.com>
2022-10-05 19:38:14 +01:00
Karl Hobley
2d8de9f166 Add docstrings to ReferenceIndex model 2022-10-05 19:38:14 +01:00
Karl Hobley
53ba1c6f78 indexible => indexable 2022-10-05 19:38:14 +01:00
Karl Hobley
e0717d8c9a Move ReferenceIndex into a separate module 2022-10-05 19:38:14 +01:00
Karl Hobley
b714a30bff Remove WAGTAIL_USAGE_COUNT_ENABLED setting 2022-10-05 19:38:14 +01:00
Karl Hobley
212b2e19a6 Automatically update reference index when objects are saved/deleted 2022-10-05 19:38:13 +01:00
Karl Hobley
8691b19967 Make all usage reports use the reference index 2022-10-05 19:38:13 +01:00
Karl Hobley
d2332fdb90 Add rebuild_references_index management command 2022-10-05 19:38:13 +01:00
Karl Hobley
b5596cd58d Add a separate hash field for content path on ReferenceIndex
MySQL doesn't allow long fields to be used in unique indexes.
2022-10-05 19:38:13 +01:00
Karl Hobley
a9db3e966b Extract references from rich text 2022-10-05 19:38:13 +01:00
Karl Hobley
a295cdf8e4 Extract references from chooser blocks in StreamFields 2022-10-05 19:38:13 +01:00
Karl Hobley
3a00c1ebe6 Implement ReferenceIndex model 2022-10-05 19:38:13 +01:00
LB Johnston
466a911e54 update documentation examples got user hooks 2022-10-05 21:43:07 +10:00
Mehrdad Moradizadeh
af15072eca moving the generic view tests into their own file 2022-10-05 21:42:13 +10:00
Mehrdad Moradizadeh
143d89c09e improving the generic view tests 2022-10-05 21:42:13 +10:00
Dan Hayden
9bf7a7423a Documentation - Fix register_snippet import path typo 2022-10-05 21:39:48 +10:00
Mehrdad Moradizadeh
92407354a9
Add basic unit tests for ordering param in wagtail.users.views.users.index
* writing test to making sure ordering is valid ordering based on the result of get_valid_orderings
* checking that the default ordering is used when ordering is invalid
* relates to #9114
2022-10-05 21:39:05 +10:00
Mehrdad Moradizadeh
eccd84ba87 Generic views - add better support for non-integer ids
- changing object.id to object.pk and using `quote` to handle non-url-safe primary keys
- ensure we're using the quote/unquote consistently to handle non-url-safe primary keys
- creating new test for genericviews
- fixes #9205
2022-10-04 20:30:53 +10:00
Adinapunyo Banerjee
f5200dab64 Added .button-secondary bicolor button-icon in styleguide and pattern library
- relates to #9198
- does not add any new styling for these types of button but instead
2022-10-04 16:36:57 +10:00
Mehrdad Moradizadeh
61a5e197cd Refactor user edit view into class based view
- relates to #8622
2022-10-04 16:23:49 +10:00
Mehrdad Moradizadeh
eba6a2b407 Refactor the user delete view into a class based view
- adapting the new approach for the template title
- moving the check to dispatch method
- relates to #8622
2022-10-04 15:47:57 +10:00
Mehrdad Moradizadeh
d56df52a3d refactor User create view to use the generic wagtail CreateView class
- remove subclassing PermissionRequiredMixin
- relates to #8622
2022-10-04 14:41:31 +10:00
Mehrdad Moradizadeh
f34b4be164 Adopt generic class based view for User index listingproblem
- improving user_management tests
- refactoring test_authorised_with_add_permission, test_authorised_with_change_permission, and test_authorised_with_delete_permission into a single function
- Update wagtail/users/views/users.py
- Update wagtail/users/templates/wagtailusers/users/results.html
- Update wagtail/users/templates/wagtailusers/users/index.html (changing to generic/base.html)
- relates to #8622
2022-10-04 12:44:17 +10:00
Haydn Greatnews
02b2b7c9f2 Fix some casing code in examples in API configuration docs 2022-10-01 17:56:08 +10:00
Sage Abdullah
725cc2b64a Fix status side panel info in edit view for snippets without DraftStateMixin
Make sure the last edited info is shown and scheduled publishing info isn't shown
2022-09-30 16:15:06 +01:00
Sage Abdullah
05b9d2d4f9 Add tests for ensuring last updated info is always shown in Snippets
Also add test to ensure that scheduled publishing info isn't shown if the model doesn't extend DraftStateMixin
2022-09-30 16:15:06 +01:00
Sage Abdullah
57beeb7154 Improve docs on scheduled publishing mechanism for clarity
Explicitly state that clicking Publish is required for the schedule to take effect.

Also document the edge cases for scheduled publishing when a page is scheduled to be unpublished
2022-09-30 16:13:19 +01:00
Sage Abdullah
c94443fd96 Add docs on how to enable schedule publishing on snippets 2022-09-30 16:13:19 +01:00
Dan Bentley
01c250859a Fix preview for pages using Form page models
- Adds missing form to preview context
- broke when moving to `PreviewableMixin` - see #8709
2022-09-30 07:33:04 +10:00
LB Johnston
02ffdd4213 changelog for #9265 2022-09-30 06:35:19 +10:00
Matt Westcott
035ff70835 Reword special-purpose FieldPanel deprecation message for clarity
Multiple people on Slack support have asked "how do I fix this error" now, which suggests that the wording here needs improvement...

* change "is obsolete" to "is no longer required", to make it sound less "your code is broken" and more "here's an improvement you can make" (but also state that it'll be removed in a future release, to make it clear that you have to do it soomer or later)
* leave out the full module paths - they're probably coming across as internal tech gobbledegook rather than informative, and obscuring the word "Panel" which is the most important thing in the message
* link to the release note to clear up any remaining confusion
2022-09-30 06:33:20 +10:00
LB Johnston
c4d0f8f5e2 add changelog for #8812
- fixes #7374
2022-09-29 22:12:56 +10:00
Jaap Roes
c5a6eded96 Change order of export fields & Update mixins
Makes the export file easier to import as the first two columns are used by default in the import command
2022-09-29 22:12:56 +10:00
Jaap Roes
07adb156d1 Stop using tablib & use openpyxl
Remove copyright notice, the code has been replaced
2022-09-29 22:12:56 +10:00
Jaap Roes
05cd1df4f9 Strip base_formats module to the bare essentials
Generate the list of supported extensions
2022-09-29 22:12:56 +10:00
Jaap Roes
c4edac723e Only support csv, tsv and xlsx for redirect import 2022-09-29 22:12:56 +10:00
Matt Westcott
d8ba045826 Release note for #8976 2022-09-29 11:55:28 +01:00
Sage Abdullah
48761ef5a9 Update docs for renaming publish_scheduled_pages command to publish_scheduled 2022-09-29 10:28:36 +01:00
Sage Abdullah
5a34f050ef Add tests for publish_scheduled management command with snippets 2022-09-29 10:28:36 +01:00
Sage Abdullah
94242ecb9b Add tests for setting scheduled publishing fields in snippets with DraftStateMixin 2022-09-29 10:28:36 +01:00