7

Compare commits

..

4 Commits

Author SHA1 Message Date
af3720f566 Bump node-sass from 4.12.0 to 7.0.0
Bumps [node-sass](https://github.com/sass/node-sass) from 4.12.0 to 7.0.0.
- [Release notes](https://github.com/sass/node-sass/releases)
- [Changelog](https://github.com/sass/node-sass/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sass/node-sass/compare/v4.12.0...v7.0.0)

---
updated-dependencies:
- dependency-name: node-sass
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-10 18:17:11 +00:00
dd4530203f Bump version: 0.15.2 → 0.15.3 2022-02-04 15:12:42 +00:00
48955675be Use get_context_data override instead of get_context for Wagtail >= 2.15 (#230). Fix #228 2022-01-28 11:53:57 +00:00
a81c5b3560 Bump version: 0.15.1 → 0.15.2 2021-09-24 10:30:22 +02:00
7 changed files with 741 additions and 165 deletions

25
CHANGES
View File

@ -1,3 +1,28 @@
0.15.3
=================
- Add wagtail >= 2.15 support with get_context_data override instead of get_context
0.15.2
=================
- Replace staticfiles tag with static
0.15.1
=================
- Remove old versions from test matrix
- Fix button support in wagtail admin for newer wagtail versions
0.15.0
=================
- Fix is_authenticated 'bool' object is not callable error
- Add wagtail <=2.11 support
- Use Github Actions to test package instead of Travis CI
0.14.0
=================
- Fix 'bool' object is not callable error
- Fix deleting descendants with variants when deleting a page
- Add wagtail 2.6 support
0.13.0
=================
- Merged Praekelt fork

View File

@ -62,10 +62,10 @@ author = 'Lab Digital BV'
# built documents.
#
# The short X.Y version.
version = '0.15.2'
version = '0.15.3'
# The full version, including alpha/beta/rc tags.
release = '0.15.2'
release = '0.15.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@ -18,7 +18,7 @@
"imagemin-webpack-plugin": "^1.4.4",
"jshint": "^2.9.4",
"mocha": "^3.4.1",
"node-sass": "^4.5.3",
"node-sass": "^7.0.0",
"postcss-loader": "^2.0.5",
"sass-loader": "^6.0.5",
"style-loader": "^0.18.0",

View File

@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.15.2
current_version = 0.15.3
commit = true
tag = true
tag_name = {new_version}

View File

@ -35,7 +35,7 @@ with open('README.rst') as fh:
setup(
name='wagtail-personalisation',
version='0.15.2',
version='0.15.3',
description='A Wagtail add-on for showing personalized content',
author='Lab Digital BV and others',
author_email='opensource@labdigital.nl',

View File

@ -9,6 +9,7 @@ from django.template.defaultfilters import pluralize
from django.urls import reverse
from django.utils.safestring import mark_safe
from django.utils.translation import ugettext_lazy as _
from wagtail import VERSION as WAGTAIL_VERSION
from wagtail.admin import messages
from wagtail.admin.site_summary import PagesSummaryItem, SummaryItem
@ -192,12 +193,11 @@ def page_listing_more_buttons(page, page_perms, is_parent=False, *args):
class CorrectedPagesSummaryItem(PagesSummaryItem):
def get_context(self):
def get_total_pages(self, context):
# Perform the same check as Wagtail to get the correct count.
# Only correct the count when a root page is available to the user.
# The `PagesSummaryItem` will return a page count of 0 otherwise.
# https://github.com/wagtail/wagtail/blob/5c9ff23e229acabad406c42c4e13cbaea32e6c15/wagtail/admin/site_summary.py#L38
context = super().get_context()
root_page = context.get("root_page", None)
if root_page:
pages = utils.exclude_variants(
@ -208,9 +208,18 @@ class CorrectedPagesSummaryItem(PagesSummaryItem):
if root_page.is_root():
page_count -= 1
context["total_pages"] = page_count
return page_count
return context
if WAGTAIL_VERSION >= (2, 15):
def get_context_data(self, parent_context):
context = super().get_context_data(parent_context)
context["total_pages"] = self.get_total_pages(context)
return context
else:
def get_context(self):
context = super().get_context()
context["total_pages"] = self.get_total_pages(context)
return context
@hooks.register("construct_homepage_summary_items")

854
yarn.lock

File diff suppressed because it is too large Load Diff