Skip to content

Commit

Permalink
Make Plugin Confirm Template configurable (#7267)
Browse files Browse the repository at this point in the history
* Make plugin confirm template configurable

* add feature to changelog

Co-authored-by: Jacob Rief <jacob.rief@uibk.ac.at>
  • Loading branch information
jrief and jrief committed Mar 16, 2022
1 parent b2d9a08 commit bab1e6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ unreleased

* Added dark mode support to css
* Fix publishing of static placeholders outside of CMS pages
* Allow to override the template rendered after a plugin has been saved.

3.9.0 (2021-06-30)
==================
Expand Down Expand Up @@ -55,7 +56,7 @@ Bug Fixes:
* Fix styles issues, caused by switching to the ``display: flex`` on the page tree renderer.
* Fixed missing builtin arguments on main ``cms`` management command causing it to crash
* Fixed template label nested translation
* Fixed a bug where the fallback page title whould be returned instead of the one from the current language
* Fixed a bug where the fallback page title would be returned instead of the one from the current language
* Fixed an issue when running migrations on a multi database project
* Fixes #7033: also check for Django 3.2, now that 3.9 supports it. (#7054) (02083f2dc) -- Marco Bonetti

Expand Down
5 changes: 3 additions & 2 deletions cms/plugin_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ class CMSPluginBase(admin.ModelAdmin, metaclass=CMSPluginBaseMetaclass):
module = _("Generic") # To be overridden in child classes

form = None
change_form_template = "admin/cms/page/plugin/change_form.html"
change_form_template = 'admin/cms/page/plugin/change_form.html'
plugin_confirm_template = 'admin/cms/page/plugin/confirm_form.html'
# Should the plugin be rendered in the admin?
admin_preview = False

Expand Down Expand Up @@ -295,7 +296,7 @@ def render_close_frame(self, request, obj, extra_context=None):
if extra_context:
context.update(extra_context)
return render_to_response(
request, 'admin/cms/page/plugin/confirm_form.html', context
request, self.plugin_confirm_template, context
)

def save_model(self, request, obj, form, change):
Expand Down

0 comments on commit bab1e6e

Please sign in to comment.