0
0
mirror of https://github.com/wagtail/wagtail.git synced 2024-11-30 01:46:24 +01:00
Commit Graph

1492 Commits

Author SHA1 Message Date
Karran Besen
36e777418f Fix: Hide empty 'view live' links 2020-03-20 14:33:09 -04:00
Matt Westcott
205249b317 Release note for #5884 2020-03-19 17:49:33 +00:00
Paulo
494260f8ee Fixed #5537 -- Fetch deferred stream fields from db (#5661) 2020-03-19 17:20:22 +00:00
Michał (Quadric) Sieradzki
5e2d12b518 Add scope attribute to TableBlock generated tables for visually impaired users (#5865) 2020-03-19 16:50:55 +00:00
Michał (Quadric) Sieradzki
06fbde14b3 fix display issue on snippet edit view (#5883) 2020-03-19 16:44:34 +00:00
Fidel Ramos
0ccfe9568f Fix image resizing failing on slim images
Image operations sometimes calculate a target width or height of zero, which
make Willow raise a ValueError.

If an user uploads one such image it's possible to break the whole Wagtail
image manager/picker/uploader for all users.

The fix is to use a minimum of 1 pixel for either the target height or the
width. The image might lose some aspect ratio, but it's better than an
exception.
2020-03-19 16:39:20 +00:00
Matt Westcott
526649008d Release note for #5870 2020-03-19 16:12:40 +00:00
Matt Westcott
f83977c291 Add cache to speed up compiling media declarations for stream blocks
As proposed by @pimarc in https://github.com/wagtail/wagtail/issues/3062#issuecomment-586331423
2020-03-18 16:12:46 +00:00
Matt Westcott
a34d509f7e Release note for #5880 2020-03-13 17:42:11 +00:00
Matt Westcott
98c2aefbe8 Revert "Allow url punctuation as defined in RFC 3986 section 2.3"
This reverts commit 08ef3f4840. Reverting as it breaks serving static files with whitenoise.

Conflicts:
	CHANGELOG.txt
	docs/releases/2.9.rst
2020-03-10 15:51:31 +00:00
Matt Westcott
7dae758ea4 Release note for #5845 2020-03-04 11:53:03 +00:00
Storm Heg
08ef3f4840 Allow url punctuation as defined in RFC 3986 section 2.3 2020-03-03 17:38:07 +00:00
stevelyall
babcbb7f80 Add Vidyard to oEmbed provider whitelist 2020-03-03 17:06:05 +00:00
Casper
19f50c72ce Hide preview button when preview_modes is empty 2020-03-03 16:20:23 +00:00
Matt Westcott
122575d2ee Release note for #5848 2020-02-26 14:11:17 +00:00
Maylon Pedroso
78cc81c505 Set context variable to None if no image provided to image templatetag 2020-02-25 23:16:52 +00:00
Karl Hobley
7e8f8f893c
Add changelog entry for removing Django 1.11 support 2020-02-24 12:26:48 +00:00
Matt Westcott
8931312025 Release note for #5827 2020-02-21 17:29:07 +00:00
Matt Westcott
4df455ea9f
Remove support for Django 2.1 (#5840) 2020-02-18 13:55:53 +00:00
Matt Westcott
a97256a4f7 Release note for #5837 2020-02-18 11:45:53 +00:00
Matt Westcott
51d8433b6b Release note for #5787 2020-02-17 12:30:10 +00:00
Andy Babic
1c2719720d Release notes for #5810 2020-02-16 21:43:36 +00:00
Andy Babic
061f0e2571 Release notes for #5828 2020-02-16 21:18:11 +00:00
jacobtoppm
3ac230f821 Prevent 'status' banners for page locking being doubled up on POST requests (#5818) 2020-02-11 09:25:09 +00:00
Matt Westcott
4314f3d1a1
Implement MultipleChoiceBlock (rebase of #5592) (#5819)
* Implement MultipleChoiceBlock (squashed commits from #5592)

* Omit widget from frozen kwargs

* Rename get_callable_choices to indicate it is an internal method

* Add release notes for MultipleChoiceBlock
2020-02-10 22:24:49 +00:00
Arkadiusz Ryś
47f677577e Make server-side slug generation respect WAGTAIL_ALLOW_UNICODE_SLUGS (#5808) 2020-02-05 17:33:32 +00:00
Matt Westcott
afd707f6b4 Fill in release date for 2.8 2020-02-03 13:34:04 +00:00
Andy Chosak
81d23fc8ab Support the rel attribute on ModelAdmin buttons
Currently it is possible to pass the target attribute to a button
created using ModelAdmin's ButtonHelper framework. This allows you to
generate button links like <a ... target="_blank">.

For example, if adding a new button and modeling it after the existing
edit_button code [0], you can add {'target': "_blank"} to the returned
dict and it'll get passed to the template when the button is rendered.

To be consistent with PR 4844, and to be consistent with what seems to
be the best practice ([1], [2]), we should also support passing the rel
attribute, which would allow for creation of button links like <a ...
target="_blank" rel="noopener noreferrer">.

[0] 5e2f50403b/wagtail/contrib/modeladmin/helpers/button.py (L61-L73)
[1] https://developers.google.com/web/tools/lighthouse/audits/noopener
[2] https://www.jitbit.com/alexblog/256-targetblank---the-most-underestimated-vulnerability-ever/
2020-01-26 21:06:26 -05:00
Jack Paine
70da204eb1 Reduce contrast of rich text toolbar. Fix #4997 (#5740) 2020-01-25 00:05:27 +00:00
Thibaud Colas
2933589680 Add release notes for #5467 2020-01-24 20:56:18 +00:00
Thibaud Colas
eb0612c21c Add release notes for #5784 2020-01-24 15:56:34 +00:00
Thibaud Colas
b7872e3f2f Add release notes for #5773 2020-01-23 16:21:43 +00:00
Thibaud Colas
ef6ace6e98 Add release notes for #5775 2020-01-23 15:59:43 +00:00
Matt Westcott
11ba755f63 Release note for #5777 2020-01-23 15:33:19 +00:00
Matt Westcott
8ad9f8ecf7 Add changelog / release notes for 2.9 2020-01-23 11:56:35 +00:00
LB Johnston
d202195333 fix minor typos in changelog/2.8 release notes 2020-01-22 07:27:34 +10:00
Matt Westcott
25942a4467 Rename WAGTAIL_ENABLE_RESPONSIVE_EMBED to WAGTAILEMBEDS_RESPONSIVE_HTML for consistency with other settings 2020-01-20 18:57:51 +00:00
Saptak S
eda098de58 Abort unfinished ajax before new calls in all search ajax 2020-01-17 17:41:51 +00:00
Eric Sherman
f5f841ed59 dropdown on search page by initing dropdowns on ajax success 2020-01-17 16:56:21 +00:00
Kalob Taulien
aefb0f9506 Responsive emebed setting 2020-01-17 16:44:46 +00:00
Matt Westcott
7a92ca5ad9 Mark nested InlinePanels as experimental for now
See https://github.com/wagtail/wagtail/issues/5126#issuecomment-575607574, https://github.com/wagtail/wagtail/pull/5732#issuecomment-574753410
2020-01-17 13:00:50 +00:00
Matt Westcott
590bea3b7b Revert "Fix submenu footer blocking items in admin" (#5606)
This change causes the footer to no longer be bottom-aligned when the menu is shorter than window height.

This reverts commit a459e91692.
2020-01-17 12:58:20 +00:00
Andy Chosak
349fca66f3 Fix: Properly save ordering of nested InlinePanels
The order of nested InlinePanels (recently formally added in 5566)
doesn't get saved properly due to some now-invalid assumptions in the JS
selector code.

Currently, Wagtail users can use the editor up/down arrows to order
InlinePanel elements that contain child InlinePanels, but these may not
be properly saved.

Before InlinePanel nesting was supported, it was a safer bet that a
child panel would only contain one hidden input named "-ORDER". With
nesting, however, a parent panel will also contain hidden inputs named
like this for its child panels. This breaks the logic used in the
ordering code.

This change modifies the logic to use the jQuery `.children()` selector
instead of `.next()`, ensuring that we reference the correct adjacent
panel item.

An easy way to test this against current master is to use the Wagtail
testapp test models that exercise this behavior:

1. `wagtail start testwagtail` to create a new project.
2. `cd testwagtail`
3. Edit testwagtail/settings/base.py to add the Wagtail test
application `'wagtail.tests.testapp'` to the list of `INSTALLED_APPS`.
For the admin to work properly with this app, you also need to add
`'wagtail.contrib.settings'` to that list and copy the definition of
`WAGTAILADMIN_RICH_TEXT_EDITORS` from wagtail/tests/settings.py.
4. `./manage.py migrate` to create your local database.
5. `./manage.py createsuperuser` to create an admin user.
6. Create a new Event Page
(http://localhost:8000/admin/pages/add/tests/eventpage/3/).
7. Fill in all required items, and then add multiple speakers under
"Speaker Lineup". For each speaker, add at least one Award. Save the
page.
8. Try using the up/down arrows to reorder the speakers (the parent
InlinePanel), and save the page.
9. Note that when the page reloads, the ordering hasn't been saved. If
you debug using the developer tools, you'll notice that this is because
the code being modified here selects the child panel items instead of
the adjacent parent panel item.
2020-01-15 16:43:32 +00:00
Ascani Carlo
4864920555 Fix update_index throwing AttributeError when value is None (#5757) 2020-01-14 11:33:25 +00:00
Dan Braghis
c4a0ec2c4f Use sensitive_post_parameters on password reset form (#5760) 2020-01-14 11:13:21 +00:00
Matt Westcott
e927f6269a Release note for #5634 2020-01-08 15:43:34 +00:00
Matt Westcott
7fdb06c86c Fill in release date for 2.7.1 2020-01-08 10:39:45 +00:00
Matt Westcott
8c49f2e68d Release notes for #5694 2020-01-07 17:03:09 +00:00
Johannes Vogel
4a1b337461 add etag support for documents 2019-12-18 15:28:23 +00:00
Matt Westcott
110101d96e Make Django 3.0 support official 2019-12-17 14:24:31 +00:00
Janneke Janssen
146853914e Add verbose_name_plural to form submission due to translation mismatch 2019-12-17 12:28:56 +00:00
Nick Smith
7acf4889db Move wagtail_urls to the end of template urls.py (#5733)
The `wagtail_urls` patterns is a catch-all list of urlpatterns, and will
prevent any patterns later in the list from being matched. The default
case when Django is in debug mode for local development is to use
`django-admin.py runserver`, and in this case the static patterns in the
example [are redundant][1]. However for anyone using a different server
for local development, this makes them work again.

[1]: https://docs.djangoproject.com/en/3.0/howto/static-files/#serving-static-files-during-development
2019-12-17 12:24:24 +00:00
Matt Westcott
4001516a27 Add formal support for nested InlinePanels
Fixes #1952 and #5511
2019-12-02 10:20:45 +10:00
Benedikt Willi
233e7f5189 Add ability to filter image index by a tag
- Fixed error when searching and filtering by tag at the same time
2019-12-02 09:54:35 +10:00
Dan Swain
749d0172e5 Documentation - include {{ block.super }} example in modelAdmin 2019-12-02 09:43:33 +10:00
Andreas Bernacca
4945acf2db Update document size & hash when changing document file
Resolves #5704
2019-12-01 19:00:57 +10:00
Andreas Bernacca
5a8f468c2d Fix layout issue when using FieldRowPanel with a heading
Resolves #5691
2019-12-01 18:20:44 +10:00
Pete Andrew
abd8320dc3 Update links in docs to point at stable Django version 2019-12-01 13:19:40 +10:00
Karl Hobley
0dbe25c512 Changelog/release note for #5721 2019-11-26 15:50:44 +00:00
Andreas Bernacca
3cb59c2667 Remove Page & Site models from Django admin
- added instructions to release notes on how to reinstate on a per project basis
- Resolves #5703
2019-11-26 22:49:48 +10:00
Timothy Bautista
1b0aed7b20 use block.super in extra CSS/JS blocks
- ensure templates that have extra css/js blocks call {{ block.super }} in them
- wagtail.contrib.settings edit
- modeladmin templates
2019-11-20 20:34:00 +10:00
Karl Hobley
d37d5c1c60 Changelog/release notes for #5676 and #5688 2019-11-19 14:50:01 +00:00
Tom Usher
644ee86e00 Add support for cloudflare API tokens (#5688) 2019-11-19 14:47:52 +00:00
LB
9b64a8647c Update contributor name 2019-11-16 18:28:21 +10:00
Brady Moe
f8c7d7f5f7 adds mark_safe to the render_form method on the structblock (#5687) 2019-11-08 11:03:09 +00:00
WinterComes
06fb0764e0 Move get_document_model to __init__ & add get_document_model_string
Avoids issues where models are not yet loaded and document model is needed.

- apply isort
- fix minor typos
- fixes #5614
2019-11-07 07:47:12 +10:00
Matt Westcott
e756a1879d Add release note for dropping Django 2.0 support 2019-11-06 17:10:32 +00:00
Fidel Ramos
b9f585a6c9 Compare foreign keys using pk, not id (#5681)
Trying to compare revisions of a page that includes changes to a foreign key
field of a related model that declared a custom primary key failed with an
uncaught exception.

The root cause was ForeignObjectComparison filtering by the id field, which is
not present in models that declare a custom primary key.

The solution is simply to filter by pk instead of id, which always maps to the
primary key of the corresponding model.

Include a regression unit test.
2019-11-06 17:00:41 +00:00
Matt Westcott
39422b259e Fill in release date for 2.7 2019-11-06 13:06:22 +00:00
Nick Smith
1c1341e477 Improve contrast of disabled inputs
Fixes #5649
2019-11-03 07:41:08 +10:00
Matt Westcott
6ce9f3a717 Unbundle the l18n library
This was previously bundled in #4721 to avoid installation errors on non-Unicode locales. As of v2018.5, this has now been fixed upstream: https://bitbucket.org/tkhyn/l18n/issues/4/setuppy-raises-unicodedecodeerror-trying

isort fix
2019-10-30 08:03:41 +10:00
Karl Hobley
40dbb940e7 Improve diffing behavior for text fields 2019-10-29 17:22:49 -04:00
LB
34db9a394f Fix contributor name
- incorrectly added the issue creator not the PR creator
- updated name to the correct one - Stefani Castellanos
2019-10-29 08:23:44 +10:00
Stefani Castellanos
92864f22b4 Added label 'URL' for external link
- Regression - missing label for external link URL field in link chooser
- Resolves #5656
2019-10-29 08:19:31 +10:00
Igoranze
a459e91692 Fix submenu footer blocking items in admin
- items longer then the page height are no longer broken by the submenu footer
- long lists of submenu items are no longer blocked by the footer (version number)
2019-10-24 08:17:55 +10:00
David
b6c5eaccfc Fixed 2.6.3 date in Changelog and updated username on Contributors 2019-10-24 07:42:16 +10:00
LB
57d44a38bd Admin documents listing - rename 'uploaded' to 'created
Other changes

- documents listing template - clean up white space

Documentation changes (editors manual)

- update images
- remove popular tags mention as this is no longer applicable
- add references to 'collection'

Resolves #2827
2019-10-24 07:40:59 +10:00
Sergey Fedoseev
eab9198f4c Move flake8 config to setup.cfg 2019-10-23 18:09:07 +02:00
Sergey Fedoseev
40e56cbd7a Remove RichText.__nonzero__() unused on Python 3 2019-10-23 18:05:42 +02:00
Loic Teixeira
80c70c5de8 Add 2.8 section to changelog and release notes 2019-10-23 17:52:20 +02:00
Matt Westcott
a5d54a587b Mark Python 3.8 support as official in changelog 2019-10-22 16:25:59 +01:00
Matt Westcott
96c1c41daa Release note for #5643 in 2.7 2019-10-22 16:14:25 +01:00
Matt Westcott
f1c79e169a Release note for #5643 in 2.6.3 2019-10-22 16:14:17 +01:00
Matt Westcott
fe9132823a Changelog cleanup
* note Python 3.8 support as provisional
* Remove mentions of minor doc fixes (there are many more fixes beyond the ones mentioned here, and including them all in the release notes would add too much noise...)
2019-10-16 18:17:17 +01:00
Matt Westcott
302d22e252 Release note for #5249 / #5629 2019-10-16 16:21:26 +01:00
Matt Westcott
3024e02481 Revert "Formalise Python 3.8 support"
This reverts commit ddbbaea288.
2019-10-16 14:27:59 +01:00
Karl Hobley
b4ecead6d9 [5225] Take number of frames into account when limiting image size 2019-10-16 11:36:07 +01:00
Matt Westcott
ddbbaea288 Formalise Python 3.8 support 2019-10-15 20:08:04 +01:00
LB (Ben Johnston)
03cd4056df Docs - Add AbstractUser import to custom user model
- `from django.contrib.auth.models import AbstractUser`
- revise a previous changelog entry to clarify 'clean up' vs 'fix'
2019-10-12 09:57:47 +10:00
Matt Westcott
9d7d09bd75 Replace format() placeholders in translatable strings with % formatting
Fixes #5539. Transifex and Django's makemessages command have validation to catch invalid placeholder variables within translated strings - for example, where the translator has translated the variable name - but these only recognise old-style `%` formatting, not the `format` method, and so it's better for us to standardise on % formatting.

To reduce the burden on translators having to re-translate these strings, only the ones using named placeholders (`"Edited page {title}"`) rather than numeric ones (`"Edited page {0}"`) have been changed - hopefully the latter give less room for error.

Also fixed some incorrect use of plurals (verbose_name vs verbose_name_plural) in snippet confirmation messages.
2019-10-12 09:46:57 +10:00
David Thompson
6a6555eb19 Fix multiple minor documentation issues
- Typo in readme (verb did not agree with the subject)
- Grammatical error in topics/pages
- #5364 - Update URL config code block in getting-started/integrating-into-django
2019-10-12 09:42:02 +10:00
a-mere-peasant
1eae1e4614 Added 'image uploads in forms' to third party tutorials 2019-10-12 09:31:19 +10:00
Matt Westcott
a0035c33c0 Add example of template rendering to TableBlock docs
Addresses #5540
2019-10-12 09:29:10 +10:00
Matt Westcott
72ba719ac8 Remove mentions of Django 3.0 compatibility from release notes
Work on compatibility is ongoing while Django 3.0 is still in development; we don't want this to be misinterpreted as a statement of formal Django 3.0 support (which we can't promise until the final release)
2019-10-11 12:28:01 +01:00
Matt Westcott
ee68d2214a Release note for #5500 / #5612 2019-10-11 12:18:34 +01:00
Karl Hobley
0507ec5377 Release notes for #5611 2019-10-10 11:03:39 +01:00
Matt Westcott
e1d3390a1f Release note for #5527 2019-10-09 12:53:58 +01:00
Sergey Fedoseev
b9c470df37 Output form media on add/edit/chooser document forms with custom models
Similar to eaad013081, but for Document
2019-10-02 12:54:27 +01:00
Sergey Fedoseev
bbec0c8bc8 Make DraftailRichTextArea be considered as visible (#5583) 2019-10-01 17:31:23 +01:00
Matt Westcott
9a21e79ff8 Add role="table" to TableBlock output
As per https://twitter.com/SaraSoueidan/status/1177622630763028480, certain browsers apply heuristics to decide whether `<table>` elements exist for layout or data purposes, and adjust the behaviour of their accessibility features accordingly. Given that TableBlock intentionally doesn't allow markup within cells, we can be reasonably sure that any tables created with it are genuine data tables, and should therefore indicate that using `role="table"`.
2019-10-01 17:27:32 +01:00
Matt Westcott
44a1e6f9f8 Eliminate dependency on default User model from style guide
Fixes #5442. Building a User object for david@torchbox.com may cause problems if a custom user model is in use, and is redundant anyhow because there's no longer a registered gravatar for that email - we should just hard-code the default blank avatar instead.
2019-09-29 09:10:17 +10:00
Brian Whitton
34f4ab8a3f allow image page sizes to be configurable (#5568) 2019-09-25 10:49:57 +01:00
jacobtm
a7b470bc9d Add ability to hide 'Submit for Moderation' in action menu using setting WAGTAIL_MODERATION_ENABLED. When set to false, SubmitForModerationMenuItem method is_shown returns false (#5574) 2019-09-24 16:28:47 +01:00
Matt Westcott
e87dcaf015 Release note for #5296 2019-09-23 01:25:23 +01:00
Matt Westcott
88a688afe7 Fill in release date for 2.6.2 2019-09-19 15:05:20 +01:00
Kiril Staikov
4b692d67d5 Fix soundcloud embed regex 2019-09-13 12:33:40 +01:00
Matt Westcott
0d4f670625 Release note for #5559 2019-09-11 13:00:11 +01:00
Edy
b9cfc24b37 Fixed broken email header when hosting static files remotely (#5543)
Fixes #5525
2019-09-06 12:13:07 +01:00
Colin Klein
33204be105 Updated the block id initialization (#5552)
The current block id generation only sets the id as the block is serialized for storage in the database, which means that the id is unavailable in the block until it is pulled back from the database. In my debugging this caused the id to be set to new values up to 3 times when saving a brand new page (each time with a new id).
This updated logic applies the new id to the actual block which makes it available right away and prevents the id from being regenerated.
2019-09-06 11:21:46 +01:00
Janne Alatalo
dd0bb9a870 Add setting to disable email management
This commit adds WAGTAIL_EMAIL_MANAGEMENT_ENABLED setting that defaults
to True, but when disabled, hides the 'Change email' button in account
management view, and disables the associated route. This is useful when
using external authentication method like LDAP or OpenID Connect where
email management is handled elsewhere.

Wagtail already includes WAGTAIL_PASSWORD_MANAGEMENT_ENABLED setting.
This is almost exact copy of that implementation.
2019-09-04 10:25:35 +01:00
Bojan Mihelac
df1608b080 fix: Language chosen in user preferences persists on subsequent requests (#4310) 2019-09-02 19:34:06 +01:00
Robert Rollins
ef4b37cf5d Changed Snippet Chooser AJAX delay from 50ms to 200ms, to remove laggy typing. (#5439)
50ms is the equivalent of about 200 words per minute, so typing slower than that
meant that the javascript would send an AJAX request between every single
keystroke. This change makes the javascript wait for 200ms between keystrokes,
which lets you finish typing the word you're looking for before it sends an AJAX
request.
2019-08-29 14:13:23 +01:00
kevinhowbrook
7db44c71b3 Break listing titles by word so action buttons are visible on smaller screens (#5429) 2019-08-29 14:06:16 +01:00
kevinhowbrook
48c82516db Allow content to define the tab width on xs screens to stop cutting off text (#5392) 2019-08-29 12:27:32 +01:00
Matt Westcott
e263aaf749 Update release schedule info and move dates table to the wiki
Document release schedule in readme
2019-08-23 13:15:24 -04:00
Matt Westcott
6feb29d54a Release note for StreamField design update (#5476) 2019-08-23 15:53:48 +01:00
Kalob Taulien
f227ec0a82 Updated contributors & changelog 2019-08-21 20:01:25 -06:00
Pavel Denisov
d6e4072e26 Remove Unidecode from postgres_search. Fix #5001 (#5514) 2019-08-20 16:12:35 +01:00
kevinhowbrook
31e3dab4ec Allow users to change their first and last name 2019-08-18 17:08:52 +10:00
Mikalai Radchuk
d2d8b2c9e3 Fixes layout for the FileField 2019-08-18 16:55:36 +10:00
Matt Westcott
dc780c5bb1 Fix failing tests due to different HTML escaping in Django 3.0
- Fix password reset tests
- Fix test for invalid-slug message
- Update changelog/release notes
2019-08-18 16:40:37 +10:00
Matt Westcott
34c1b4ccbe Upgrade django-taggit to 1.x
django-taggit 1.x drops Python 2.x support and thus the dependency on django.utils.six; this is a prerequisite for supporting Django 3.0.
The signature of TaggableManager.value_from_object has changed to return a list of Tags (previously it was a QuerySet of TaggedItems) and so search indexing and comparison need to be updated accordingly. There is a corresponding fix to ClusterTaggableManager in django-modelcluster 5.0.
2019-08-18 16:33:02 +10:00
Coen van der Kamp
525cf5922e Update Changelog 2019-08-18 16:12:14 +10:00
Iman Syed
794d40b86b Add ability to create anchor link tab within rich text link
- add tests

- Update changelog & release notes
2019-08-18 15:56:20 +10:00
Jonathan Liuti
2de92f045c Upgrade minimum 6.x release for Elasticsearch to 6.4.0
Fix doc and test on ES6 python client compat

This commit changes the statement that version < 6.3.1 of the
elasticsearch python client should be used to instead state
that 6.4.0 is fine.

It also update the tests to reflect the statement.

Initially the `update_all_types` argument has been used to work
around an issue described in:
https://github.com/wagtail/wagtail/issues/2968

This argument was removed in elasticsearch-py 6.3.1 and making
use of it was raising an error.

With 6.4.0 nothing is raising anymore.
2019-08-18 15:37:11 +10:00
Matt Westcott
eaad013081 Output form media on add/edit/chooser image forms with custom models
* Add tests for custom image on multiple image uploader
* Output form media on image add/edit views
* Output form media for 'add image' form within image chooser modal
Note: this won't work reliably if the media is hosted on a CDN, because script tags inserted as part of a jQuery DOM insertion (as modals are) are loaded asynchronously and not guaranteed to complete loading before inline scripts are run. It's better than not having the includes there at all though...
2019-08-18 15:20:03 +10:00
Samir Shah
0ee07dddff Fix pageurl and slugurl handling of situations where request.site is null (#5501) 2019-08-14 12:07:12 +01:00
Andy Chosak
7c3418f99e Properly check permissions when viewing revisions (#5490)
Currently any user with any page permission can view any page revision.
This commit fixes that, and ensures that the user has publish or edit
permission on the page before showing a page revision. If not, the user
is presented with a 403.

This maintains the current behavior if the user has no page permissions,
which is to redirect to the admin home page.

New tests have been added to cover these changes.

Fixes issue 5426.
2019-08-12 16:22:28 +01:00
Andy Chosak
52b01cda67 Don't use page admin title when editing rich text (#5491)
When editing a rich text field and entering a link to a page whose Page
type overrides get_admin_display_title, the custom admin display title
is used both when browsing to select the page to link to and also when
viewing the rich text editor.

The first behavior is consistent with how custom admin display titles
are used throughout the admin, but the second behavior is not. The
Wagtail user should be able to use the rich text field as a reasonable
preview of what the rendered content will look like for the end user. To
do this, the "real" page title should be used, not the admin one.

This commit alters the data that gets passed to the rich text editor so
that its title is the real page title and not the admin one.

Fixes issue 5131.
2019-08-12 16:10:25 +01:00
Matt Westcott
ada652f19f Release note for #5427 2019-08-08 12:54:37 +01:00
Martey Dodoo
bb4e2fe2df Add labels to snippet bulk edit checkboxes for screen reader users. Fix #5328 (#5463) 2019-08-05 18:12:08 +01:00
Matt Westcott
6bc94ee56d Fill in release date for 2.6.1 2019-08-05 15:18:38 +01:00
Jonny Scholes
c0af26b076 Move and refactor upgrade notification JS 2019-08-04 17:39:55 +10:00
Neal Todd
4a93424654 Prevent exception when attempting to delete a model with a protected 1-to-1 relation
Modeladmin handles notification to the user if a model instance has protected ForeignKey
relationships. However, if the protected relation is a OneToOneField it raises an exception:

  File ".../wagtail/wagtail/contrib/modeladmin/views.py", line 742, in post
    for obj in qs.all():
AttributeError: 'MyRelatedModel' object has no attribute 'all'

because qs in this case is the related instance rather than a queryset of related instances
(as is the case for a ForeignKey).

This commit handles the OneToOneField case as well.
2019-08-04 17:20:41 +10:00
Matt Westcott
cdb13b6490 Add release notes for 2.6.1 2019-08-02 17:34:20 +01:00
Iman Syed
d3f720995a Make image fallback work for images with big/small aspect ratios. Fix #5472 (#5474) 2019-08-01 11:46:34 +01:00
Matt Westcott
29741f57af Fill in release date for 2.6 2019-08-01 10:47:07 +01:00
Matt Westcott
4767557217 Fill in release date for 2.5.2 2019-08-01 10:46:33 +01:00
Matt Westcott
d75754a19b Add release notes for 2.5.2 2019-07-30 14:08:52 +01:00
Thibaud Colas
db9b582912 Delay dirty form check data snapshot to avoid race conditions. Fix #4978 (#5469)
User interaction with the form within the 10s delay also won’t trigger the confirmation message. There will still be race condition issues if form widgets like rich text take 10+ seconds to initialise – but that doesn’t seem likely.
2019-07-30 12:45:11 +01:00
Catherine Farman
f53dd95696 Change StreamField group labels color so labels are visible. Fix #5455 (#5462)
* use lighter grey for streamfield group label for accessible contrast
2019-07-26 16:39:11 -04:00
Rodrigo
1a2bf525f2 Add https support for scribd oembed provider (#739)
Currently scribd defaults to https for their sharing links - http still works but if you copy&paste quickly you may think it's broken
2019-07-25 14:19:07 +01:00
Matt Westcott
1468cab3a1 Release note for #5431 2019-07-25 10:46:41 +01:00
Daniele Procida
72db52371a Updated feature detection notes 2019-07-21 18:03:09 +10:00
Michael van Tellingen
9cd2fc2c82 Add a construct_page_listing_buttons hook
This hook mimics the functiolity provided by `construct_page_action_menu`
in that it constructs the final list of buttons to be shown in the wagtail
admin interface.  This means that within this function button's can be
removed, added or re-ordered.

See #4925
2019-07-21 17:40:26 +10:00
Matt Westcott
772b76ef00 Add 2.7 section to changelog and release notes 2019-07-09 16:51:48 +01:00
Fidel Ramos
baee103024 Optimize admin.navigation.get_explorable_root_page
Testing the queryset in the if clause was causing the whole queryset
to be retrieved and populated from DB, all to check whether it was empty
or not.

The optimization is to rely on the strict behavior of
first_common_ancestor, which raises an exception if the queryset is
empty.
2019-07-09 11:57:40 +01:00
Andrew Miller
b9816d194a Don't make assumptions about the username field
The USERNAME_FIELD exists to allow customisation. Therefore we should make an assumption that `.username` exists on the model. Instead, we need to pull the required value from the USERNAME_FIELD and add in a fallback default.
2019-07-08 20:11:14 +01:00
William Blackie
3754d34caa Search query normalisation no longer removes punctuation #5416 2019-07-04 16:53:27 +01:00
Michael Hearn
10bbfec93c Also add change event to timepicker and datepicker 2019-07-03 16:10:41 +01:00