8000 ci: Merge develop into release/3.11 (#7350) · django-cms/django-cms@0c9c9aa · GitHub
[go: up one dir, main page]

Skip to content

Commit 0c9c9aa

Browse files
markswebFlorian DelizyvinitkumarSimon Krullfsbraun
authored
ci: Merge develop into release/3.11 (#7350)
* Release 3.10.0 RC1 (#7215) * [3.10.0rc1 release process] Bumped version to 3.10.0rc1 * [3.10.0rc1 release process] compilemessages * [3.10.0rc1 release process] compiling new static files * [3.10.0rc1 release process] updating latest docs * Update release/3.10 from develop (#7219) * Fix script typos (#7201) * [refactor] Typos in release scripts * This was correct. Co-authored-by: Simon Krull <simondotunix@gmail.com> * feat: Added concurrency option to github workflows (#7205) * fix: Disable workflow concurrency to bring stability back to the CI (#7209) * Upgrade Gulp and Nodejs (#7208) * feat: upgrade sass and gulp sass so that it installs on a modern node.js * fix: upgrade some packages and gulp config to 4.x series * fix: add support for icons working as well * Feat: get some tasks to work * fix: port one more tasks even if it is still erroring * wip: still broken config for webpack bundle * fix: let the new tests run * fix: issue with lint task * fix: some more issues with loaders * feat: get some tests passing atleast * fix: the frontend tests pass now * feat: generate new lock file * feat: use gulp 4.x * feat: make build use node16 as well * feat: add .nvmrc for a consistent experience * feat: Run workflows in concurrency groups (#7211) * feat: Added concurrency config using unique workflow groups * Remove whitespace to test cancellation * Remove whitespace to test cancellation 2 Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <simondotunix@gmail.com> * Add toolbar fix for broken CMS in the release 3.10.x (#7233) * Fix script typos (#7201) * [refactor] Typos in release scripts * This was correct. Co-authored-by: Simon Krull <simondotunix@gmail.com> * feat: Added concurrency option to github workflows (#7205) * fix: Disable workflow concurrency to bring stability back to the CI (#7209) * Upgrade Gulp and Nodejs (#7208) * feat: upgrade sass and gulp sass so that it installs on a modern node.js * fix: upgrade some packages and gulp config to 4.x series * fix: add support for icons working as well * Feat: get some tasks to work * fix: port one more tasks even if it is still erroring * wip: still broken config for webpack bundle * fix: let the new tests run * fix: issue with lint task * fix: some more issues with loaders * feat: get some tests passing atleast * fix: the frontend tests pass now * feat: generate new lock file * feat: use gulp 4.x * feat: make build use node16 as well * feat: add .nvmrc for a consistent experience * feat: Run workflows in concurrency groups (#7211) * feat: Added concurrency config using unique workflow groups * Remove whitespace to test cancellation * Remove whitespace to test cancellation 2 Co-authored-by: Vinit Kumar <mail@vinitkumar.me> * fix: Toolbar bug in 3.10 (#7232) Co-authored-by: fsbraun <fsbraun@gmx.de> Co-authored-by: Mark Walker <theshow@gmail.com> Co-authored-by: Simon Krull <simondotunix@gmail.com> Co-authored-by: fsbraun <fsbraun@gmx.de> * fix: using .nvmrc to target teh right nvm version * Release/3.10.x (#7260) Releasing 3.10.0RC2 * [3.10.0rc2 release process] Bumped version to 3.10.0rc2 * [3.10.0rc2 release process] compilemessages * [3.10.0rc2 release process] compiling new static files * [3.10.0rc2 release process] updating latest docs * Update release script to make it compatible with BSD (macos) compatible * Update release script to make it compatible with BSD (macos) compatible * Release/3.10.x (#7275) * Fixes #7288 by also catching AttributeError, when the current toolbar… (#7289) * Fixes #7288 by also catching AttributeError, when the current toolbar object doesn't define get_draft_url() * #7288: also catch AttributeError when `get_absolute_url()` isn't defined. * Fix for django 2.2 in middleware [#7290] (#7293) * Fix for django 2.2 in middleware [#7290] * Address isort concern * Update release script to make it compatible with BSD (macos) compatible * Update release script to make it compatible with BSD (macos) compatible (#7294) * Fix version number in bump commit * Fix release script version commit. (#7295) * Update release script to make it compatible with BSD (macos) compatible * Fix version number in bump commit * fix: typos in CHANGELOG.rst * ci: Sync release/3.10.x with develop (#7328) * Release 3.10.0 RC1 (#7215) * [3.10.0rc1 release process] Bumped version to 3.10.0rc1 * [3.10.0rc1 release process] compilemessages * [3.10.0rc1 release process] compiling new static files * [3.10.0rc1 release process] updating latest docs * Update release/3.10 from develop (#7219) * Fix script typos (#7201) * [refactor] Typos in release scripts * This was correct. Co-authored-by: Simon Krull <simondotunix@gmail.com> * feat: Added concurrency option to github workflows (#7205) * fix: Disable workflow concurrency to bring stability back to the CI (#7209) * Upgrade Gulp and Nodejs (#7208) * feat: upgrade sass and gulp sass so that it installs on a modern node.js * fix: upgrade some packages and gulp config to 4.x series * fix: add support for icons working as well * Feat: get some tasks to work * fix: port one more tasks even if it is still erroring * wip: still broken config for webpack bundle * fix: let the new tests run * fix: issue with lint task * fix: some more issues with loaders * feat: get some tests passing atleast * fix: the frontend tests pass now * feat: generate new lock file * feat: use gulp 4.x * feat: make build use node16 as well * feat: add .nvmrc for a consistent experience * feat: Run workflows in concurrency groups (#7211) * feat: Added concurrency config using unique workflow groups * Remove whitespace to test cancellation * Remove whitespace to test cancellation 2 Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <simondotunix@gmail.com> * Add toolbar fix for broken CMS in the release 3.10.x (#7233) * Fix script typos (#7201) * [refactor] Typos in release scripts * This was correct. Co-authored-by: Simon Krull <simondotunix@gmail.com> * feat: Added concurrency option to github workflows (#7205) * fix: Disable workflow concurrency to bring stability back to the CI (#7209) * Upgrade Gulp and Nodejs (#7208) * feat: upgrade sass and gulp sass so that it installs on a modern node.js * fix: upgrade some packages and gulp config to 4.x series * fix: add support for icons working as well * Feat: get some tasks to work * fix: port one more tasks even if it is still erroring * wip: still broken config for webpack bundle * fix: let the new tests run * fix: issue with lint task * fix: some more issues with loaders * feat: get some tests passing atleast * fix: the frontend tests pass now * feat: generate new lock file * feat: use gulp 4.x * feat: make build use node16 as well * feat: add .nvmrc for a consistent experience * feat: Run workflows in concurrency groups (#7211) * feat: Added concurrency config using unique workflow groups * Remove whitespace to test cancellation * Remove whitespace to test cancellation 2 Co-authored-by: Vinit Kumar <mail@vinitkumar.me> * fix: Toolbar bug in 3.10 (#7232) Co-authored-by: fsbraun <fsbraun@gmx.de> Co-authored-by: Mark Walker <theshow@gmail.com> Co-authored-by: Simon Krull <simondotunix@gmail.com> Co-authored-by: fsbraun <fsbraun@gmx.de> * fix: using .nvmrc to target teh right nvm version * Release/3.10.x (#7260) Releasing 3.10.0RC2 * [3.10.0rc2 release process] Bumped version to 3.10.0rc2 * [3.10.0rc2 release process] compilemessages * [3.10.0rc2 release process] compiling new static files * [3.10.0rc2 release process] updating latest docs * Update release script to make it compatible with BSD (macos) compatible * Update release script to make it compatible with BSD (macos) compatible * Release/3.10.x (#7275) * Fixes #7288 by also catching AttributeError, when the current toolbar… (#7289) * Fixes #7288 by also catching AttributeError, when the current toolbar object doesn't define get_draft_url() * #7288: also catch AttributeError when `get_absolute_url()` isn't defined. * Fix for django 2.2 in middleware [#7290] (#7293) * Fix for django 2.2 in middleware [#7290] * Address isort concern * Update release script to make it compatible with BSD (macos) compatible (#7294) * Fix release script version commit. (#7295) * Update release script to make it compatible with BSD (macos) compatible * Fix version number in bump commit * fix: typos in CHANGELOG.rst Co-authored-by: Florian Delizy <fdelizy@logitech.com> Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <simondotunix@gmail.com> Co-authored-by: fsbraun <fsbraun@gmx.de> Co-authored-by: Marco Bonetti <mbonetti@gmail.com> * build: release 3.10.1rc1 (#7330) * fix: Use http rather than https in toolbar sites menu (#7331) * fix: Use http rather than https in toolbar sites menu (#7331) * fix: Revert change to the toolbar sites menu to use ``http`` protocol (#7332) * Fix for "Permission denied (publickey)" error (#7333) Using https fixes the issue with running the `git clone` command resulting in the error: >git@github.com: Permission denied (publickey). >fatal: Could not read from remote repository. > >Please make sure you have the correct access rights >and the repository exists. * feat: Configurable dark mode (#7329) * Feat: Dark mode support, including input from @marksweb, bugfix for tooltips * Add: Color scheme configurable * Add: Toolbar toggle (always on) * Add: CMS_COLOR_SCHEME_TOGGLE setting * Add: color scheme toggle test * Fix: Only set color scheme in cms iframes * Add: Basic documentation of new settings * Fix: color scheme switch as css variables * Fix: Cascade settings into iframes of iframes (e.g., cms plugins inside ckeditor) * Fix: no toggle in collapsed toolbar Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <krull@punkt.de> Co-authored-by: Vinit Kumar <vinit.kumar@kidskonnect.nl> * fix: dark mode tweaks and test fixes (requests in context) (#7338) * Fix: toolbar bug 3.10.rc1 * Feat: Dark mode support, including input from @marksweb, bugfix for tooltips * Upstream change to be able to merge * Feat: Dark mode support, including input from @marksweb, bugfix for tooltips * Revert "Fix: toolbar bug 3.10.rc1" This reverts commit 592a2b6. * Fix: Recommit toolbar fix (??) * Fix: After lint failure: Remove spaces added by PyCharm * Fix: Wizzard button color * Fix: Correct toolbar according to cms_path Fix: Avoid unnecessary toolbar loading * TASK: use isort to sort imports * Fix: Remove unused css rule Fix: Add plugin search bar text did not reflect dark mode * Fix: Toolbar tests to include request object for TextPlugin * Fix: Pass a request (None) for the processors test Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <krull@punkt.de> Co-authored-by: Mark Walker <theshow@gmail.com> * fix: remove fixed width for edit plugin popup (=> autowidth) (#7337) * fix: remove fixed width for edit plugin popup (=> autowidth) Same behavior as new popup * fix: revert bundled js * fix: update changelog * fix: remove trailing comma * fix: Except block using list instead of tuple (#7342) * Release 3.10.0 RC1 (#7215) * [3.10.0rc1 release process] Bumped version to 3.10.0rc1 * [3.10.0rc1 release process] compilemessages * [3.10.0rc1 release process] compiling new static files * [3.10.0rc1 release process] updating latest docs * Update release/3.10 from develop (#7219) * Fix script typos (#7201) * [refactor] Typos in release scripts * This was correct. Co-authored-by: Simon Krull <simondotunix@gmail.com> * feat: Added concurrency option to github workflows (#7205) * fix: Disable workflow concurrency to bring stability back to the CI (#7209) * Upgrade Gulp and Nodejs (#7208) * feat: upgrade sass and gulp sass so that it installs on a modern node.js * fix: upgrade some packages and gulp config to 4.x series * fix: add support for icons working as well * Feat: get some tasks to work * fix: port one more tasks even if it is still erroring * wip: still broken config for webpack bundle * fix: let the new tests run * fix: issue with lint task * fix: some more issues with loaders * feat: get some tests passing atleast * fix: the frontend tests pass now * feat: generate new lock file * feat: use gulp 4.x * feat: make build use node16 as well * feat: add .nvmrc for a consistent experience * feat: Run workflows in concurrency groups (#7211) * feat: Added concurrency config using unique workflow groups * Remove whitespace to test cancellation * Remove whitespace to test cancellation 2 Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <simondotunix@gmail.com> * Add toolbar fix for broken CMS in the release 3.10.x (#7233) * Fix script typos (#7201) * [refactor] Typos in release scripts * This was correct. Co-authored-by: Simon Krull <simondotunix@gmail.com> * feat: Added concurrency option to github workflows (#7205) * fix: Disable workflow concurrency to bring stability back to the CI (#7209) * Upgrade Gulp and Nodejs (#7208) * feat: upgrade sass and gulp sass so that it installs on a modern node.js * fix: upgrade some packages and gulp config to 4.x series * fix: add support for icons working as well * Feat: get some tasks to work * fix: port one more tasks even if it is still erroring * wip: still broken config for webpack bundle * fix: let the new tests run * fix: issue with lint task * fix: some more issues with loaders * feat: get some tests passing atleast * fix: the frontend tests pass now * feat: generate new lock file * feat: use gulp 4.x * feat: make build use node16 as well * feat: add .nvmrc for a consistent experience * feat: Run workflows in concurrency groups (#7211) * feat: Added concurrency config using unique workflow groups * Remove whitespace to test cancellation * Remove whitespace to test cancellation 2 Co-authored-by: Vinit Kumar <mail@vinitkumar.me> * fix: Toolbar bug in 3.10 (#7232) Co-authored-by: fsbraun <fsbraun@gmx.de> Co-authored-by: Mark Walker <theshow@gmail.com> Co-authored-by: Simon Krull <simondotunix@gmail.com> Co-authored-by: fsbraun <fsbraun@gmx.de> * fix: using .nvmrc to target teh right nvm version * Release/3.10.x (#7260) Releasing 3.10.0RC2 * [3.10.0rc2 release process] Bumped version to 3.10.0rc2 * [3.10.0rc2 release process] compilemessages * [3.10.0rc2 release process] compiling new static files * [3.10.0rc2 release process] updating latest docs * Update release script to make it compatible with BSD (macos) compatible * Update release script to make it compatible with BSD (macos) compatible * Release/3.10.x (#7275) * Fixes #7288 by also catching AttributeError, when the current toolbar… (#7289) * Fixes #7288 by also catching AttributeError, when the current toolbar object doesn't define get_draft_url() * #7288: also catch AttributeError when `get_absolute_url()` isn't defined. * Fix for django 2.2 in middleware [#7290] (#7293) * Fix for django 2.2 in middleware [#7290] * Address isort concern * Update release script to make it compatible with BSD (macos) compatible (#7294) * Fix release script version commit. (#7295) * Update release script to make it compatible with BSD (macos) compatible * Fix version number in bump commit * fix: typos in CHANGELOG.rst * fix: Change except catch using list to tuple [#7334] * fix: typo in changelog Co-authored-by: Florian Delizy <fdelizy@logitech.com> Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <simondotunix@gmail.com> Co-authored-by: fsbraun <fsbraun@gmx.de> Co-authored-by: Marco Bonetti <mbonetti@gmail.com> * feat: add cache ttl extension point (#7299) Adds the setting `CMS_CACHE_LIMIT_TTL_CLASS` that should have a `limit_page_cache_ttl` method that would be called to limit the cache ttl of a page using business logic. Closes #7296 * fix: Rename changelog title to fix release script * fix: Changelog title for 3.10.1rc1 (#7345) * fix: Request missing from test rendering (#7346) * fix: Changelog titles for 3.10.x (#7347) * build: Release 3.10.1 (#7348) Co-authored-by: Florian Delizy <fdelizy@logitech.com> Co-authored-by: Vinit Kumar <mail@vinitkumar.me> Co-authored-by: Simon Krull <simondotunix@gmail.com> Co-authored-by: fsbraun <fsbraun@gmx.de> Co-authored-by: Marco Bonetti <mbonetti@gmail.com> Co-authored-by: Conrad <grosserconrad@gmail.com> Co-authored-by: jillalberts <81445981+jillalberts@users.noreply.github.com> Co-authored-by: Simon Krull <krull@punkt.de> Co-authored-by: Fabien MICHEL <fabien.michel@hespul.org> Co-authored-by: Ivo Branco <igobranco@gmail.com>
1 parent f892d6e commit 0c9c9aa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+614
-164
lines changed

CHANGELOG.rst

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,40 @@ Highlights:
1010
* Support for django 4
1111
* Dark mode support
1212

13+
* Added dark mode support to css, dark mode settings and toggle button
14+
* Fix publishing of static placeholders outside of CMS pages
15+
* Allow to override the template rendered after a plugin has been saved.
16+
* Revert change to the toolbar sites menu to use ``http`` protocol.
17+
* Fix edit plugin popup width (remove 850px width constraint).
18+
* Fix except block using list instead of tuple. (#7334)
19+
* Added cache ttl extension point.
20+
21+
3.10.1 (2022-06-28)
22+
===================
23+
24+
Bug Fixes:
25+
----------
26+
* Changelog titles for 3.10.x (#7347) (31f399535) -- Mark Walker
27+
* Request missing from test rendering (#7346) (eff54b0fd) -- Mark Walker
28+
* Changelog title for 3.10.1rc1 (#7345) (966a90fd2) -- Mark Walker
29+
* Revert change to the toolbar sites menu to use ``http`` protocol (#7332) (caddfe7f4) -- Mark Walker
30+
* Fixed ``AttributeError`` (#7288) when the current toolbar object doesn't define ``get_draft_url()`` (#7289) -- Marco Bonetti
31+
* Fix for django 2.2 in middleware [#7290] (#7293) -- Mark Walker
32+
* Update release script to start bringing support for macOS (#7294) -- Mark Walker
33+
* Fix release script version commit. (#7295) -- Mark Walker
34+
* Revert change to the toolbar sites menu to use ``http`` protocol. (#7331) -- Mark Walker
35+
36+
Statistics:
37+
-----------
38+
39+
This release includes 12 pull requests, and was created with the help of the following contributors (in alphabetical order):
40+
41+
* Conrad (3 pull requests)
42+
* Florian Delizy (1 pull request)
43+
* Marco Bonetti (1 pull request)
44+
* Mark Walker (7 pull requests)
45+
46+
Thanks to all contributors for their efforts!
1347

1448
Features:
1549
---------
@@ -129,10 +163,6 @@ With the review help of the following contributors:
129163

130164
Thanks to all contributors for their efforts!
131165

132-
* Added dark mode support to css
133-
* Fix publishing of static placeholders outside of CMS pages
134-
* Allow to override the template rendered after a plugin has been saved.
135-
136166
3.9.0 (2021-06-30)
137167
==================
138168

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

@@ -280,7 +310,7 @@ Thanks to all contributors for their efforts!
280310
* Fixed an issue in ``wizards/create.html`` where the error message did not use the plural form
281311
* Improved documentation building
282312
* Updated the content for django CMS’s development community
283-
* Replaced all occurrences of ``force_text`` and ``smart_text`` against
313+
* Replaced all occurences of ``force_text`` and ``smart_text`` against
284314
``force_str``and ``smart_str``.
285315

286316

@@ -818,7 +848,7 @@ Thanks to all contributors for their efforts!
818848
- Substantial improvements to the page tree and significant reduction of reloads
819849
- Update jsTree version to 3.2.1 with slight adaptions to the Pagetree
820850
- Documentation improvements
821-
- Improve the display and usability of the language menu, especially in cases
851+
- Improve the display and useability of the language menu, especially in cases
822852
where there are many languages.
823853
- Fix an issue relating to search fields in plugins
824854
- Fix an issue where the app-resolver would trigger locales into migrations
@@ -1132,7 +1162,7 @@ Thanks to all contributors for their efforts!
11321162
- Improves redirection as a result of changes to page slugs, etc.
11331163
- Improves performance of "watched models"
11341164
- Improves frontend performance relating to resizing the sideframe
1135-
- Corrects an issue where items might not be visible in structure mode menus
1165+
- Corrects an issue where items might not be visible in structue mode menus
11361166
- Limits version of django-mptt used in CMS for 3.0.x
11371167
- Prevent accidental upgrades to Django 1.8, which is not yet supported
11381168

@@ -1189,7 +1219,7 @@ Thanks to all contributors for their efforts!
11891219
==================
11901220

11911221
- Add require_parent option to CMS_PLACEHOLDER_CONF
1192-
- Fix django-mptt version dependency to be PEP440 compatible
1222+
- Fix django-mptt version depenency to be PEP440 compatible
11931223
- Fix some Django 1.4 compatibility issues
11941224
- Add toolbar sanity check
11951225
- Fix behavior with CMSPluginBase.get_render_template()
@@ -1217,7 +1247,7 @@ Thanks to all contributors for their efforts!
12171247
- Fixes PageField to work in Django 1.7 environments
12181248
- Updates to community and project governance documentation
12191249
- Added list of retired core developers
1220-
- Added branch policy documentation
1250+
- Added branch policy documentaion
12211251

12221252

12231253
3.0.6 (2014-10-07)
@@ -1427,7 +1457,7 @@ Please see Install/2.4 release notes *before* attempting to upgrade to version 2
14271457
- CMS_FRONTEND_LANGUAGES limits django languages as well during language selection
14281458
- Wymeditor updated to 1.0.4a
14291459
- icon_url escape fixed
1430-
- Ukrainian translation added
1460+
- Ukranian translation added
14311461
- Fixed wrong language prefix handling for form actions and admin preview
14321462
- Admin icons in django 1.4 fixed
14331463
- Added requirements.txt for pip and testing in test_requirements

cms/admin/settingsadmin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
HttpResponse, HttpResponseBadRequest, HttpResponseRedirect,
1212
)
1313
from django.http.request import QueryDict
14-
from django.urls import re_path
14+
from django.urls import Resolver404, re_path, resolve
1515
from django.utils.translation import override
1616

1717
from cms.admin.forms import RequestToolbarForm
@@ -97,6 +97,10 @@ def get_toolbar(self, request):
9797
request = copy.copy(request)
9898
request.GET = data
9999
request.current_page = current_page
100+
try:
101+
request.resolver_match = resolve(origin_url.path)
102+
except Resolver404:
103+
pass
100104
request.toolbar = CMSToolbar(request, request_path=origin_url.path, _async=True)
101105
request.toolbar.set_object(attached_obj or current_page)
102106
return HttpResponse(request.toolbar.render())

cms/cache/page.py

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11

22
import hashlib
33
from datetime import timedelta
4+
from importlib import import_module
45

56
from django.conf import settings
67
from django.utils.cache import (
@@ -45,30 +46,37 @@ def set_page_cache(response):
4546

4647
placeholders = toolbar.content_renderer.get_rendered_placeholders()
4748
# Checks if there's a plugin using the legacy "cache = False"
48-
placeholder_ttl_list = []
49+
ttl_list = []
4950
vary_cache_on_set = set()
5051
for ph in placeholders:
5152
# get_cache_expiration() always returns:
5253
# EXPIRE_NOW <= int <= MAX_EXPIRATION_IN_SECONDS
5354
ttl = ph.get_cache_expiration(request, timestamp)
5455
vary_cache_on = ph.get_vary_cache_on(request)
5556

56-
placeholder_ttl_list.append(ttl)
57+
ttl_list.append(ttl)
5758
if ttl and vary_cache_on:
5859
# We're only interested in vary headers if they come from
5960
# a cache-able placeholder.
6061
vary_cache_on_set |= set(vary_cache_on)
6162

62-
if EXPIRE_NOW not in placeholder_ttl_list:
63-
if placeholder_ttl_list:
64-
min_placeholder_ttl = min(x for x in placeholder_ttl_list)
65-
else:
66-
# Should only happen when there are no placeholders at all
67-
min_placeholder_ttl = MAX_EXPIRATION_TTL
68-
ttl = min(
69-
get_cms_setting('CACHE_DURATIONS')['content'],
70-
min_placeholder_ttl
71-
)
63+
if EXPIRE_NOW not in ttl_list:
64+
ttl_list.append(get_cms_setting('CACHE_DURATIONS')['content'])
65+
ttl_list.append(MAX_EXPIRATION_TTL)
66+
67+
if hasattr(settings, 'CMS_LIMIT_TTL_CACHE_FUNCTION'):
68+
extension_point = settings.CMS_LIMIT_TTL_CACHE_FUNCTION
69+
70+
module, func_name = extension_point.rsplit('.', 1)
71+
module = import_module(module)
72+
limit_ttl_cache_function = getattr(module, func_name)
73+
limit_ttl = limit_ttl_cache_function(response)
74+
75+
# if the extension point returns an integer as ttl
76+
if isinstance(limit_ttl, int):
77+
ttl_list.append(limit_ttl)
78+
79+
ttl = min(ttl_list)
7280

7381
if ttl > 0:
7482
# Adds expiration, etc. to headers

cms/cms_toolbars.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,22 @@ def add_wizard_button(self):
9494
disabled=disabled,
9595
on_close=REFRESH_PAGE)
9696

97+
@toolbar_pool.register
98+
class AppearanceToolbar(CMSToolbar):
99+
"""
100+
Adds appearance switches, esp. for dark and light mode
101+
"""
102+
color_scheme_toggle = get_cms_setting('COLOR_SCHEME_TOGGLE')
103+
104+
def populate(self):
105+
if self.color_scheme_toggle:
106+
dark_mode_toggle = TemplateItem(
107+
template="cms/toolbar/items/dark_mode_toggle.html",
108+
side=self.toolbar.RIGHT,
109+
)
110+
self.toolbar.add_item(dark_mode_toggle)
111+
112+
97113

98114
@toolbar_pool.register
99115
class BasicToolbar(CMSToolbar):
@@ -129,7 +145,7 @@ def add_admin_menu(self):
129145
sites_menu.add_sideframe_item(_('Admin Sites'), url=admin_reverse('sites_site_changelist'))
130146
sites_menu.add_break(ADMIN_SITES_BREAK)
131147
for site in sites_queryset:
132-
sites_menu.add_link_item(site.name, url='https://%s' % site.domain,
148+
sites_menu.add_link_item(site.name, url='http://%s' % site.domain,
133149
active=site.pk == self.current_site.pk)
134150

135151
# admin

cms/locale/es/LC_MESSAGES/django.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ msgid ""
3737
msgstr ""
3838
"Project-Id-Version: django CMS\n"
3939
"Report-Msgid-Bugs-To: \n"
40-
"POT-Creation-Date: 2022-05-23 23:22+0200\n"
40+
"POT-Creation-Date: 2022-05-31 20:29+0200\n"
4141
"PO-Revision-Date: 2010-11-30 06:47+0000\n"
4242
"Last-Translator: Pier Jose Gotta Perez <piegope@protonmail.com>, 2020\n"
4343
"Language-Team: Spanish (http://www.transifex.com/divio/django-cms/language/es/)\n"
@@ -945,7 +945,7 @@ msgstr "Ver en el sitio"
945945
msgid "Please correct the error below."
946946
msgid_plural "Please correct the errors below."
947947
msgstr[0] "Por favor, corrija el error de abajo."
948-
msgstr[1] ""
948+
msgstr[1] "Por favor, corrija los errores de abajo."
949949
msgstr[2] "Por favor, corrija los errores de abajo."
950950

951951
msgid "All permissions"

cms/locale/es/LC_MESSAGES/djangojs.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ msgid ""
99
msgstr ""
1010
"Project-Id-Version: django CMS\n"
1111
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2022-05-23 23:22+0200\n"
12+
"POT-Creation-Date: 2022-05-31 20:29+0200\n"
1313
"PO-Revision-Date: 2010-11-30 06:49+0000\n"
1414
"Last-Translator: e4db27214f7e7544f2022c647b585925_bb0e321, 2015\n"
1515
"Language-Team: Spanish (http://www.transifex.com/divio/django-cms/language/es/)\n"

cms/locale/fr/LC_MESSAGES/django.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ msgid ""
4242
msgstr ""
4343
"Project-Id-Version: django CMS\n"
4444
"Report-Msgid-Bugs-To: \n"
45-
"POT-Creation-Date: 2022-05-23 23:22+0200\n"
45+
"POT-Creation-Date: 2022-05-31 20:29+0200\n"
4646
"PO-Revision-Date: 2010-11-30 06:47+0000\n"
4747
"Last-Translator: Robin Durner, 2022\n"
4848
"Language-Team: French (http://www.transifex.com/divio/django-cms/language/fr/)\n"

cms/locale/fr/LC_MESSAGES/djangojs.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ msgid ""
1010
msgstr ""
1111
"Project-Id-Version: django CMS\n"
1212
"Report-Msgid-Bugs-To: \n"
13-
"POT-Creation-Date: 2022-05-23 23:22+0200\n"
13+
"POT-Creation-Date: 2022-05-31 20:29+0200\n"
1414
"PO-Revision-Date: 2010-11-30 06:49+0000\n"
1515
"Last-Translator: Frigory33 <chironsylvain@orange.fr>, 2016\n"
1616
"Language-Team: French (http://www.transifex.com/divio/django-cms/language/fr/)\n"

cms/locale/it/LC_MESSAGES/django.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ msgid ""
2727
msgstr ""
2828
"Project-Id-Version: django CMS\n"
2929
"Report-Msgid-Bugs-To: \n"
30-
"POT-Creation-Date: 2022-05-23 23:22+0200\n"
30+
"POT-Creation-Date: 2022-05-31 20:29+0200\n"
3131
"PO-Revision-Date: 2010-11-30 06:47+0000\n"
3232
"Last-Translator: yakky <i.spalletti@nephila.it>, 2013-2016,2019\n"
3333
"Language-Team: Italian (http://www.transifex.com/divio/django-cms/language/it/)\n"

cms/locale/it/LC_MESSAGES/djangojs.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ msgid ""
1313
msgstr ""
1414
"Project-Id-Version: django CMS\n"
1515
"Report-Msgid-Bugs-To: \n"
16-
"POT-Creation-Date: 2022-05-23 23:22+0200\n"
16+
"POT-Creation-Date: 2022-05-31 20:29+0200\n"
1717
"PO-Revision-Date: 2010-11-30 06:49+0000\n"
1818
"Last-Translator: yakky <i.spalletti@nephila.it>, 2015\n"
1919
"Language-Team: Italian (http://www.transifex.com/divio/django-cms/language/it/)\n"

0 commit comments

Comments
 (0)
0