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

10857 Commits

Author SHA1 Message Date
Matt Westcott
293e29f97d Create a shared base class for AddView 2021-01-15 20:05:21 +00:00
Matt Westcott
40093b6713 Split up wagtail.admin.views.generic module 2021-01-15 20:05:21 +00:00
Matt Westcott
e2adb8729c Extract methods for constructing the form/json response context 2021-01-15 20:05:20 +00:00
Matt Westcott
80d142c1e4 make object / upload_object into instance attributes 2021-01-15 20:05:20 +00:00
Matt Westcott
3d0e3ccc99 Convert AddView to a TemplateView 2021-01-15 20:05:20 +00:00
Matt Westcott
ad683f219e Make permission_policy into a class property
Also replace permission checker decorator with PermissionCheckedMixin
2021-01-15 20:05:19 +00:00
Matt Westcott
ac5730c167 Break out getter methods for models / forms 2021-01-15 20:05:19 +00:00
Matt Westcott
662761b74b Refactor into get/post methods 2021-01-15 20:05:19 +00:00
Matt Westcott
828436ffe3 Convert multiple image/document uploaders into class-based views 2021-01-15 20:05:18 +00:00
Matt Westcott
b13641e936 Support custom document models with required fields
Same approach as 4023a90d6e for images - define an UploadedDocument model to hold the uploaded file up to the point where the required metadata has been supplied.
2021-01-15 20:05:08 +00:00
Matt Westcott
c29a92f801 Fix trailing whitespace 2021-01-15 19:44:37 +00:00
Fernando
30ad03d4ca Update S3 CORS documentation for Boto3 (#6668)
Boto3 has been around for a long time now. Adding a Boto-specific parameter in a tutorial is confusing (it was for me) as people are likely to install Boto3 directly and skip Boto. The `AWS_HEADERS` parameter was replaced by the `AWS_S3_OBJECT_PARAMETERS` parameter in Boto3 and the parameter that controls the access control list specifically is the `ACL`.

By the way, are the instructions on line 50 still relevant today?
2021-01-15 19:42:41 +00:00
Karl Hobley
5e54382aae Remove userbars dependency on the vendor bundle
Fixes #6657
2021-01-15 17:18:48 +00:00
Karl Hobley
773de3eded Update webpack to version 5 2021-01-15 17:13:39 +00:00
LB
7737497239 fix JS code example in hooks docs
- when returning format_html `{` (brace) characters must be escaped
- https://docs.python.org/3/library/string.html#format-string-syntax
2021-01-15 13:18:15 +00:00
LB
7fb4d69d92 clean up - remove console log (commented out) 2021-01-15 13:17:13 +00:00
David Beitey
3c3df689f7
Fix formatting in Development documentation (#6686)
Co-authored-by: Thibaud Colas <thibaudcolas@gmail.com>
2021-01-13 13:26:41 +00:00
Thibaud Colas
1914394bc8
Update wagtail forms accessibility considerations to link to Django tickets (#6687) 2021-01-12 16:39:57 +00:00
Luis Nell
a726c93df4 fix: signal receivers example raising exception
Signal receivers must accept `**kwargs`, otherwise one runs into this:

```
File "/lib/python3.8/site-packages/django/dispatch/dispatcher.py", line 94, in connect
raise ValueError("Signal receivers must accept keyword arguments (**kwargs).")
ValueError: Signal receivers must accept keyword arguments (**kwargs).
```
2021-01-11 11:25:19 +00:00
Matt Westcott
14f63519c2 Rename 'config' to 'options' 2021-01-07 15:03:56 +00:00
Matt Westcott
47d68c7632 Make snippet chooser data available via get_value_data 2021-01-07 15:03:56 +00:00
Matt Westcott
68ee88796e Move snippet-chooser to client, and refactor to expose JS API 2021-01-07 15:03:56 +00:00
Matt Westcott
a0cb7a9c81 make document title / edit_url available through get_value_data 2021-01-07 15:03:56 +00:00
Matt Westcott
1606d4d09e Move document-chooser to client, and refactor to expose a js API 2021-01-07 15:03:56 +00:00
Matt Westcott
7b8d5f504c Fix page chooser getValue so that it doesn't fail on an empty state 2021-01-07 15:03:56 +00:00
Matt Westcott
afa9b16f13 Make image chooser title/preview/edit url accessible through a get_value_data method 2021-01-07 15:03:56 +00:00
Matt Westcott
4714a8424f Implement public JS API for ImageChooser 2021-01-07 15:03:56 +00:00
Matt Westcott
bbc61fb2bc lint image-chooser.js 2021-01-07 15:03:56 +00:00
Matt Westcott
fcddbfd58a Move image-chooser.js to client/src/entrypoints 2021-01-07 15:03:56 +00:00
Matt Westcott
a2ff3e1252 Move entrypoints into an admin subfolder
This allows us to have entrypoints compiling to other apps besides wagtailadmin.
2021-01-07 15:03:56 +00:00
Robert Rollins
d18ffb0233 Implemented a 'choose' permission for Images and Documents (#6466)
This PR adds the 'choose' permission discussed in #4488. It limits Image and Document choosers to showing only those Collections (and their contents) for which the current user has the Choose permission.

It grants Choose permissions to the Root Collection to every existing Group that has the "Can access Wagtail admin" perm, via data migration. So there will be no change in behavior unless the user goes in and alters the Choose perms for their site's groups.

This PR has no effect on anything except choosers. The Image and Document index pages are still controlled solely by the 'add' and 'change' permissions, as those are only accessible by users who have those permissions in the first place. This means that it's now possible to configure a Group to allow its members to choose images from existing Collections when editing pages, *without* them being able to edit said images or add new ones.
2021-01-05 12:23:49 +00:00
Karl Hobley
b161b66b79 Add a github action to build the docs into JSON format 2021-01-02 11:01:31 +00:00
Matt Westcott
d302bea68c
Prevent remove_stale_contenttypes from removing the access_admin permission (#6652)
Fixes #4444. Thanks to @berekuk for the pointer to how to fix this cleanly.
2020-12-23 23:35:17 +01:00
Karl Hobley
fe79fbb48f Remove pre-es6 module patterns 2020-12-22 23:39:24 +00:00
Karl Hobley
9873c23e3c Manually fix/ignore remaining legacy JS linting issues 2020-12-22 23:39:24 +00:00
Karl Hobley
d32ed81124 Run 'eslint --fix' on legacy JS 2020-12-22 23:39:24 +00:00
Karl Hobley
f42ac4b410 Switch to 2-space indentation 2020-12-22 23:39:24 +00:00
Matt Westcott
58927f91dc Add a preprocessing step to WidgetWithScript where database lookups can happen
This avoids separate lookups during render_html and render_js_init, and means that shared logic such as building the edit-view URL can be accessed outside of template rendering (so that we can pass it to chooser.setState in the Javascript chooser API, for example).
2020-12-20 12:56:22 +00:00
Matt Westcott
d2ccd0eb84 Refactor choosers to not pass model instances to templates
Passing the model instance means that logic such as rendering thumbnails and generating URLs to edit pages ends up on the template. This is bad because we're going to want to populate these widgets through mechanisms other than rendering the template (e.g. setState on the widget's Javascript API), and that would end up duplicating the logic on the template.
2020-12-20 12:56:22 +00:00
Matt Westcott
d401d6dbf6 Move configuration parameters for createPageChooser into a dict
This will make them easier to manage when they need to be passed through additional levels of indirection between the Python widget code and the eventual call to createPageChooser, e.g. in PageChooserBlock.
2020-12-20 12:56:22 +00:00
Matt Westcott
73623cc66a Implement a public Javascript API for PageChooser 2020-12-20 12:56:22 +00:00
Matt Westcott
09fb115a2d Catch JSON decode errors in oembed responses (#6648)
Fixes #6646 - for private videos, Youtube's oembed endpoint returns the text "Forbidden", but with a 200 status code, which fails JSON decoding.
2020-12-18 15:59:51 +00:00
Bohreromir
3d18986610 fix ModelAdmin example (#6645) 2020-12-17 16:39:30 +00:00
Luis Nell
e48c1704cb
Change embed finder credit order (#6636)
It's a really small thing, but I honestly feel like Cynthia did most of the work of taking my workaround to production quality code and pushing it over the finish line. So she should be first here.
2020-12-16 14:35:00 +00:00
Vadim Karpenko
4cfd303db9 Check action menu items (pages and snippets) for None before using (#6566) 2020-12-15 19:17:53 +00:00
Matt Westcott
3768483352 Fill in release date for 2.11.3 2020-12-10 17:59:21 +00:00
Matt Westcott
c21d82924e Update translator credits 2020-12-10 17:58:56 +00:00
Matt Westcott
c610e661c5 Fetch new translations from Transifex 2020-12-10 17:53:49 +00:00
Matt Westcott
49136ea4a5 Prevent error on publish check in create_log_entries_from_revisions (#6628)
Fixes #6498
2020-12-10 17:34:57 +00:00
Matt Westcott
971bdc0799 Fix combining locale/translation_of API filters with search (#6627)
Fixes #6626
2020-12-10 16:26:41 +00:00