Loic Teixeira
5c1c2c8f53
Enforce the use of a single string formatting mechanism for translation source strings
...
Close #9377
2022-11-26 11:00:05 +01:00
Matt Westcott
7eefd98dc2
Revert chooser button labels to "Choose another X"
...
Fixes #9113
2022-09-14 07:40:38 +10:00
Thibaud Colas
21b5ad5ce9
Update chooser styles across all types
2022-08-10 15:08:57 +10:00
Matt Westcott
0077183682
Add a base class for Telepath adapters for chooser widgets
2022-08-10 14:53:41 +10:00
Matt Westcott
172b133568
Eliminate the custom response name 'snippetChosen'
...
This makes the snippet chooser modal code a completely vanilla implementation of ChooserModalOnloadHandlerFactory, so we don't need snippet-chooser-modal.js at all.
2022-06-29 13:42:04 +10:00
Matt Westcott
be5b8c41c7
Deprecate createSnippetChooser
2022-06-29 13:42:04 +10:00
Matt Westcott
65cf8488b8
Refactor chooser views into separate urlconfs per model
2022-06-29 13:34:30 +10:00
Matt Westcott
08d06d623e
Move remaining common context variables into BaseChooser
2022-05-25 16:32:07 +10:00
Matt Westcott
80bcc1b3dd
Simplify title handling
2022-05-25 16:32:07 +10:00
Matt Westcott
39f7886a6f
Split out common logic from get_value_data
2022-05-25 16:32:07 +10:00
Matt Westcott
5f890f0acc
Extract common template_name / get_context / render_html methods
2022-05-25 16:32:07 +10:00
Matt Westcott
acc20f866f
Split out template_name and get_context from chooser subclasses
2022-05-25 16:32:07 +10:00
Matt Westcott
e1386b629d
rename BaseChooser.render_html to render_hidden_input
2022-05-25 16:32:07 +10:00
Matt Westcott
3c18ab3652
Add a new BaseChooser class and deprecate AdminChooser
...
This will allow us to make backwards-incompatible changes without breaking third-party packages that subclass AdminChooser
2022-05-25 16:32:07 +10:00
Matt Westcott
7b88c3ce02
Use AdminURLFinder for chooser widget edit buttons
2022-05-25 16:32:07 +10:00
Matt Westcott
e1ea42b3d6
Establish a consistent 'model' attribute for page/doc/image/snippet chooser widgets
2022-05-25 16:32:07 +10:00
Matt Westcott
386799af79
Move data-chooser-url attribute from template override to a context variable
2022-05-25 16:32:07 +10:00
Matt Westcott
7bcf452f8d
Move chooser widget icon and classname from template overrides into context variables
2022-05-25 16:32:07 +10:00
sage
9d1110d349
Wrap snippet views in SnippetViewSet ( #8422 )
2022-04-26 16:08:26 +01:00
Karl Hobley
75cc7da38a
Move wagtail.core to wagtail
2022-03-17 17:19:59 +00:00
Dan Braghis
d10f15e558
Reformat with black
2022-02-15 13:06:17 +00:00
Matt Westcott
22d4665b17
remove the model_string parameter to createSnippetChooser that we no longer need
2021-08-02 17:05:14 +01:00
Matt Westcott
74a8cfd862
Pass the complete snippet chooser URL as a data attribute, rather than tacking on the model parameter in JS.
...
I think that's a throwback to when the chooser URL was being passed to the page as a constant in window.chooserUrls...
2021-08-02 17:05:14 +01:00
Matt Westcott
3ac3ffd005
Eliminate top-level uses of versioned_static. Fixes #6801
2021-03-17 23:32:55 +00:00
Matt Westcott
d4dc02ad0f
Rewrite wagtail.core.telepath to recursively pack constructor args
...
js_args and get_media methods no longer receive the context object, since they are not responsible for packing their own arguments.
2021-03-17 23:32:23 +00:00
Matt Westcott
ac0c5d7ef5
Add telepath adapter for snippet chooser
2021-03-17 23:32:23 +00:00
Matt Westcott
47d68c7632
Make snippet chooser data available via get_value_data
2021-01-07 15:03:56 +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
Karl Hobley
9ad14ea439
Add hooks for snippet listing buttons
2020-08-07 15:47:27 +01:00
Mohamed Feddad
bb2e460c0b
Replace deprecated ugettext, ungettext with gettext and ngettext. ( #5907 )
2020-04-02 17:15:26 +01:00
Matt Westcott
ffdbe3e26c
Avoid calling versioned_static from static form media definitions ( #5644 )
...
* Avoid calling versioned_static from static form media definitions
Fixes #5632
Defining media definitions with `class Media:` means that those lines are evaluated on application startup; this means that they cannot contain calls to the Django static file finder, because ManifestStaticFilesStorage doesn't work until collectstatic has completed. Fix this by making those definitions into `def media(self):` methods.
* Add test to confirm that inheritance still works with dynamic form media definitions
2019-10-23 11:52:56 +02:00
Matt Westcott
8711050e49
Add cache-busting parameter to admin static files
...
Fixes #5493
2019-10-09 12:16:56 +01:00
Matt Westcott
074d9ce3f4
Convert the snippet chooser to use static onload handlers
2018-06-20 15:35:40 +01:00
Matt Westcott
994e793773
Move chooser widget JS from insert_editor_js hook into widget media
2018-06-04 15:03:09 +01:00
Mads Jensen
db6d36845f
Use Python 3 super() syntax
2017-11-27 18:05:25 +00:00
Mads Jensen
8b420b9abc
Removed __future__ imports
...
Also delete add_imports directive from isort configuration
2017-11-27 02:18:30 +00:00
Karl Hobley
1ecf48fb3f
Rename wagtail.wagtailsnippets to wagtail.snippets
...
Conflicts:
docs/advanced_topics/settings.rst
docs/getting_started/integrating_into_django.rst
docs/topics/pages.rst
docs/topics/snippets.rst
gulpfile.js/config.js
wagtail/contrib/wagtailstyleguide/views.py
wagtail/project_template/project_name/settings/base.py
wagtail/snippets/tests.py
wagtail/snippets/views/chooser.py
wagtail/snippets/views/snippets.py
wagtail/snippets/wagtail_hooks.py
wagtail/tests/settings.py
wagtail/tests/snippets/models.py
wagtail/tests/testapp/models.py
2017-11-26 22:43:47 +00:00