8

Compare commits

...

6 Commits

Author SHA1 Message Date
dependabot[bot]
7cb81d4c50 Bump is-my-json-valid from 2.16.0 to 2.20.6
Bumps [is-my-json-valid](https://github.com/mafintosh/is-my-json-valid) from 2.16.0 to 2.20.6.
- [Release notes](https://github.com/mafintosh/is-my-json-valid/releases)
- [Commits](https://github.com/mafintosh/is-my-json-valid/compare/v2.16.0...v2.20.6)

---
updated-dependencies:
- dependency-name: is-my-json-valid
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-02-04 15:17:41 +00:00
Alex Bridge
dd4530203f Bump version: 0.15.2 → 0.15.3 2022-02-04 15:12:42 +00:00
Alex Bridge
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
Boris Besemer
a81c5b3560 Bump version: 0.15.1 → 0.15.2 2021-09-24 10:30:22 +02:00
Mike Dingjan
53880228e4 Merge pull request #226 from mikedingjan/feature/remove-staticfiles-tag
Replace staticfiles with static tag (django removed the staticfiles)
2021-08-12 14:20:16 +02:00
Mike Dingjan
2bee66d0ae Replace staticfiles with static tag (django removed the staticfiles) 2021-08-12 10:44:02 +02:00
9 changed files with 67 additions and 21 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.1'
version = '0.15.3'
# The full version, including alpha/beta/rc tags.
release = '0.15.1'
release = '0.15.3'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.15.1
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.1',
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

@@ -1,5 +1,5 @@
{% extends "modeladmin/index.html" %}
{% load i18n l10n staticfiles modeladmin_tags %}
{% load i18n l10n static modeladmin_tags %}
{% block titletag %}{{ view.get_meta_title }}{% endblock %}

View File

@@ -1,5 +1,5 @@
{% extends "modeladmin/wagtail_personalisation/segment/base.html" %}
{% load i18n l10n staticfiles modeladmin_tags wagtail_personalisation_filters %}
{% load i18n l10n static modeladmin_tags wagtail_personalisation_filters %}
{% block toggle_view %}to List {% endblock%}

View File

@@ -1,5 +1,4 @@
{% extends "modeladmin/wagtail_personalisation/segment/base.html" %}
{% load i18n l10n staticfiles modeladmin_tags wagtail_personalisation_filters %}
{% load i18n l10n static modeladmin_tags wagtail_personalisation_filters %}
{% block toggle_view %}to Dashboard {% endblock%}

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")

View File

@@ -3420,12 +3420,16 @@ gaze@^1.0.0:
globule "^1.0.0"
generate-function@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.0.0.tgz#6858fe7c0969b7d4e9093337647ac79f60dfbe74"
version "2.3.1"
resolved "https://registry.yarnpkg.com/generate-function/-/generate-function-2.3.1.tgz#f069617690c10c868e73b8465746764f97c3479f"
integrity sha512-eeB5GfMNeevm/GRYq20ShmsaGcmI81kIX2K9XQx5miC8KdHaC6Jm0qQ8ZNeGOi7wYB8OsdxKs+Y2oVuTFuVwKQ==
dependencies:
is-property "^1.0.2"
generate-object-property@^1.1.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/generate-object-property/-/generate-object-property-1.2.0.tgz#9c0e1c40308ce804f4783618b937fa88f99d50d0"
integrity sha1-nA4cQDCM6AT0eDYYuTf6iPmdUNA=
dependencies:
is-property "^1.0.0"
@@ -4317,13 +4321,20 @@ is-jpg@^1.0.0:
resolved "https://registry.yarnpkg.com/is-jpg/-/is-jpg-1.0.1.tgz#296d57fdd99ce010434a7283e346ab9a1035e975"
integrity sha1-KW1X/dmc4BBDSnKD40armhA16XU=
is-my-ip-valid@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/is-my-ip-valid/-/is-my-ip-valid-1.0.0.tgz#7b351b8e8edd4d3995d4d066680e664d94696824"
integrity sha512-gmh/eWXROncUzRnIa1Ubrt5b8ep/MGSnfAUI3aRp+sqTCs1tv1Isl8d8F6JmkN3dXKc3ehZMrtiPN9eL03NuaQ==
is-my-json-valid@^2.10.0:
version "2.16.0"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.16.0.tgz#f079dd9bfdae65ee2038aae8acbc86ab109e3693"
version "2.20.6"
resolved "https://registry.yarnpkg.com/is-my-json-valid/-/is-my-json-valid-2.20.6.tgz#a9d89e56a36493c77bda1440d69ae0dc46a08387"
integrity sha512-1JQwulVNjx8UqkPE/bqDaxtH4PXCe/2VRh/y3p99heOV87HG4Id5/VfDswd+YiAfHcRTfDlWgISycnHuhZq1aw==
dependencies:
generate-function "^2.0.0"
generate-object-property "^1.1.0"
jsonpointer "^4.0.0"
is-my-ip-valid "^1.0.0"
jsonpointer "^5.0.0"
xtend "^4.0.0"
is-natural-number@^2.0.0:
@@ -4408,9 +4419,10 @@ is-primitive@^2.0.0:
resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU=
is-property@^1.0.0:
is-property@^1.0.0, is-property@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-property/-/is-property-1.0.2.tgz#57fe1c4e48474edd65b09911f26b1cd4095dda84"
integrity sha1-V/4cTkhHTt1lsJkR8msc1Ald2oQ=
is-redirect@^1.0.0:
version "1.0.0"
@@ -4666,9 +4678,10 @@ jsonify@~0.0.0:
resolved "https://registry.yarnpkg.com/jsonify/-/jsonify-0.0.0.tgz#2c74b6ee41d93ca51b7b5aaee8f503631d252a73"
integrity sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=
jsonpointer@^4.0.0:
version "4.0.1"
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-4.0.1.tgz#4fd92cb34e0e9db3c89c8622ecf51f9b978c6cb9"
jsonpointer@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/jsonpointer/-/jsonpointer-5.0.0.tgz#f802669a524ec4805fa7389eadbc9921d5dc8072"
integrity sha512-PNYZIdMjVIvVgDSYKTT63Y+KZ6IZvGRNNWcxwD+GNnUz1MKPfv30J8ueCjdwcN0nDx2SlshgyB7Oy0epAzVRRg==
jsprim@^1.2.2:
version "1.4.1"