Skip to content

Commit

Permalink
Upgrade to Wagtail 2.16.3 (#1669)
Browse files Browse the repository at this point in the history
  • Loading branch information
istride authored Mar 13, 2024
1 parent 211d2c5 commit c6f1601
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 36 deletions.
5 changes: 0 additions & 5 deletions home/templatetags/generic_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,6 @@ def language_picker_style():
f"{theme_settings.language_picker_background_color}"


@register.simple_tag
def site_version():
return settings.SITE_VERSION


@register.simple_tag(takes_context=True)
def google_analytics(context, tracking_code=None, debug=False):
if not tracking_code:
Expand Down
41 changes: 32 additions & 9 deletions home/wagtail_hooks.py
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
from urllib.parse import urlparse

from django.conf import settings
from django.contrib.admin import SimpleListFilter
from django.core.exceptions import PermissionDenied
from django.db.models import Q
from django.templatetags.static import static
from django.urls import resolve
from django.utils.html import format_html
from django.utils.translation import gettext_lazy as _
from translation_manager.models import TranslationEntry
from wagtail import __version__
from wagtail.admin import widgets as wagtailadmin_widgets
from wagtail.admin.menu import MenuItem, SubmenuMenuItem
from wagtail.contrib.modeladmin.menus import SubMenu
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from django.templatetags.static import static
from django.utils.html import format_html
from wagtail.core import hooks
from wagtail.core.models import Page
from wagtail.core.models import PageViewRestriction
from wagtail.admin import widgets as wagtailadmin_widgets
from wagtail.core.models import Page, PageViewRestriction


from home.models import FooterIndexPage, BannerIndexPage, Section, \
SectionIndexPage, LocaleDetail
from home.models import (BannerIndexPage, FooterIndexPage, LocaleDetail,
Section, SectionIndexPage)
from home.translatable_strings import translatable_strings
from translation_manager.models import TranslationEntry


@hooks.register('before_serve_page', order=-1)
Expand Down Expand Up @@ -103,6 +105,27 @@ def page_listing_buttons(page, page_perms, is_parent=False, next_url=None):
)


@hooks.register("register_admin_menu_item")
def about():
items = [
MenuItem(
label=f"IoGT {settings.SITE_VERSION}",
url=f"http://github.com/unicef/iogt/releases/tag/{settings.SITE_VERSION}",
),
MenuItem(
label=f"Wagtail {__version__}",
url=f"http://github.com/wagtail/wagtail/releases/tag/v{__version__}"
)
]

return SubmenuMenuItem(
label="About",
menu=SubMenu(items),
icon_name="info-circle",
order=999999,
)


class LimitedTranslatableStringsFilter(SimpleListFilter):
title = _('limited translatable strings')
parameter_name = 'limited'
Expand Down
2 changes: 1 addition & 1 deletion iogt/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
},
}

SITE_VERSION = '2.7.2'
SITE_VERSION = '2.8.0-rc.2'

try:
from .local import *
Expand Down

This file was deleted.

12 changes: 6 additions & 6 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -452,9 +452,9 @@ django-sass-processor==1.0.1 \
--hash=sha256:1f043180c47754018e803a77da003377f5ea6558de57cd6946eb27a32e9c16a2 \
--hash=sha256:dcaad47c591a2d52689c1bd209259e922e902d886293f0d5c9e0d1a4eb85eda2
# via -r requirements.txt
django-taggit==1.5.1 \
--hash=sha256:dfe9e9c10b5929132041de0c00093ef0072c73c2a97d0f74a818ae50fa77149a \
--hash=sha256:e5bb62891f458d55332e36a32e19c08d20142c43f74bc5656c803f8af25c084a
django-taggit==2.1.0 \
--hash=sha256:61547a23fc99967c9304107414a09e662b459f4163dbbae32e60b8ba40c34d05 \
--hash=sha256:a9f41e4ad58efe4b28d86f274728ee87eb98eeae90c9eb4b4efad39e5068184e
# via
# -r requirements.txt
# wagtail
Expand Down Expand Up @@ -1093,9 +1093,9 @@ vine==5.1.0 \
# amqp
# celery
# kombu
wagtail==2.15.6 \
--hash=sha256:7334197ff04f9bfe1eeae2038365ea957a691644cd3464ab07b117c81bc83a1e \
--hash=sha256:bf334b5aa521beca230b3d426f5abc19e7f8df88492b07c1e2ca90e267c6e28f
wagtail==2.16.3 \
--hash=sha256:3b52f0e1a4bcad66e57eaa341025e90a6dcd40170f7adb132e9e9df9efa978c9 \
--hash=sha256:a1f04513f06c760208698578367f03b3af5400f05d36b94e4a8ce07ee30d42fc
# via
# -r requirements.txt
# wagtail-cache
Expand Down
2 changes: 1 addition & 1 deletion requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ tqdm==4.62.*
wagtail-cache~=1.2.1
wagtail-localize==1.3.3
wagtail-markdown==0.7.0
wagtail==2.15.*
wagtail~=2.16.3
wagtailmedia==0.10.*
wagtailmenus==3.1.3
wagtailsvg==0.0.14
Expand Down
12 changes: 6 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -354,9 +354,9 @@ django-sass-processor==1.0.1 \
--hash=sha256:1f043180c47754018e803a77da003377f5ea6558de57cd6946eb27a32e9c16a2 \
--hash=sha256:dcaad47c591a2d52689c1bd209259e922e902d886293f0d5c9e0d1a4eb85eda2
# via -r requirements.in
django-taggit==1.5.1 \
--hash=sha256:dfe9e9c10b5929132041de0c00093ef0072c73c2a97d0f74a818ae50fa77149a \
--hash=sha256:e5bb62891f458d55332e36a32e19c08d20142c43f74bc5656c803f8af25c084a
django-taggit==2.1.0 \
--hash=sha256:61547a23fc99967c9304107414a09e662b459f4163dbbae32e60b8ba40c34d05 \
--hash=sha256:a9f41e4ad58efe4b28d86f274728ee87eb98eeae90c9eb4b4efad39e5068184e
# via wagtail
django-translation-manager==1.3.0 \
--hash=sha256:1e3143f48f9ba4d5452d72f55195142c434ea63786546251ae694508df4eb7b1 \
Expand Down Expand Up @@ -850,9 +850,9 @@ vine==5.1.0 \
# amqp
# celery
# kombu
wagtail==2.15.6 \
--hash=sha256:7334197ff04f9bfe1eeae2038365ea957a691644cd3464ab07b117c81bc83a1e \
--hash=sha256:bf334b5aa521beca230b3d426f5abc19e7f8df88492b07c1e2ca90e267c6e28f
wagtail==2.16.3 \
--hash=sha256:3b52f0e1a4bcad66e57eaa341025e90a6dcd40170f7adb132e9e9df9efa978c9 \
--hash=sha256:a1f04513f06c760208698578367f03b3af5400f05d36b94e4a8ce07ee30d42fc
# via
# -r requirements.in
# wagtail-cache
Expand Down

0 comments on commit c6f1601

Please sign in to comment.