Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wagtail 6.3 updates #503

Merged
merged 12 commits into from
Jan 2, 2025
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["3.9", "3.10", "3.11", "3.12"]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose python 3.13 could be added now.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK thanks I can update this after the holidays.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python 3.13 added here: 9d8bf79


steps:
- uses: actions/checkout@v4
Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
Changelog
=========

Unreleased
==========

- Update the testing environment to test Wagtail 6.3 and Django 5.1
- Add conditional support for Wagtail 6.3 templates

4.0.1 (04.08.2024)
----------

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ wagtailmenus is an extension for Torchbox's `Wagtail CMS <https://github.com/tor
The current version is tested for compatibility with the following:

- Wagtail versions >= 5.2
- Django versions 3.2, 4.2 and >= 5.0
- Python versions 3.8 to 3.12
- Django versions 4.2, 5.0 and >= 5.1
- Python versions 3.9 to 3.12

.. image:: https://raw.githubusercontent.com/jazzband/wagtailmenus/master/docs/source/_static/images/repeating-item.png

Expand Down
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,21 +62,21 @@
"Operating System :: OS Independent",
'Programming Language :: Python',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Framework :: Django',
'Framework :: Django :: 3.2',
'Framework :: Django :: 4.2',
'Framework :: Django :: 5.0',
'Framework :: Django :: 5.1',
'Framework :: Wagtail :: 5',
'Framework :: Wagtail :: 6',
'Topic :: Internet :: WWW/HTTP',
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
],
install_requires=requires,
python_requires='>=3.8',
python_requires='>=3.9',
extras_require={
'testing': testing_extras,
'docs': documentation_extras,
Expand Down
11 changes: 5 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,16 @@ skipsdist = True
usedevelop = True

envlist =
wt52-dj32-py{38,39,310}
wt52-dj42-py{38,39,310,311,312}
wt52-dj42-py{39,310,311,312}
wt52-dj50-py{310,311,312}
wt60-dj42-py{38,39,310,311,312}
wt60-dj42-py{39,310,311,312}
wt60-dj50-py{310,311,312}
wt61-dj{42,50}-py{310,311,312}
wt62-dj{42,50}-py{310,311,312}
wt63-dj{42,50,51}-py{310,311,312}

[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
Expand All @@ -27,11 +26,11 @@ commands = coverage run --source=wagtailmenus runtests.py

deps =
coverage
dj32: Django>=3.2,<4.0
dj41: Django>=4.1,<4.2
dj42: Django>=4.2,<4.3
dj50: Django>=5.0,<5.1
dj51: Django>=5.1,<5.2
wt52: wagtail>=5.2,<5.3
wt60: wagtail>=6.0,<6.1
wt61: wagtail>=6.1,<6.2
wt62: wagtail>=6.2,<6.3
wt63: wagtail>=6.3,<6.4
7 changes: 6 additions & 1 deletion wagtailmenus/menuadmin.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,14 @@ class MainMenuAdmin(SnippetViewSet):
index_view_class = MainMenuIndexView

edit_view_class = MainMenuEditView
edit_template_name = "wagtailmenus/mainmenu_edit.html"
if WAGTAIL_VERSION < (6, 3):
MrCordeiro marked this conversation as resolved.
Show resolved Hide resolved
edit_template_name = "wagtailmenus/mainmenu_edit.html"
else:
edit_template_name = "wagtailmenus/wagtail_63/mainmenu_edit.html"
error_message = _("The menu could not be saved due to errors.")

copy_view_enabled = False

edit_handler = TabbedInterface([
ObjectList(panels.main_menu_content_panels, heading=_("Content")),
ObjectList(panels.menu_settings_panels, heading=_("Settings"),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{% if site_switcher %}
<div class="w-field__wrapper " data-field-wrapper="">
<form method="get" id="settings-site-switch">
<label class="w-field__label" for="{{ site_switcher.site.id_for_label }}" id="{{ site_switcher.site.id_for_label }}-label">
Site: <span class="w-required-mark">*</span>
</label>
<div class="w-field__input" data-field-input="">
{{ site_switcher.site }}
</div>
</form>
</div>
{% endif %}
34 changes: 34 additions & 0 deletions wagtailmenus/templates/wagtailmenus/wagtail_63/mainmenu_edit.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{% extends "wagtailadmin/generic/edit.html" %}
{% load wagtailadmin_tags i18n %}
{% block titletag %}{% blocktrans trimmed with snippet_type_name=model_opts.verbose_name %}Editing {{ snippet_type_name }} - {{ object }}{% endblocktrans %}{% endblock %}
{% block bodyclass %}{% if locked_for_user %}content-locked{% endif %}{% endblock %}

{% block main_content %}
{% include "wagtailmenus/wagtail_63/includes/header_with_site_switcher.html" with title=object icon=header_icon merged=1 %}
{{ block.super }}
{% endblock %}

{% block extra_css %}
{{ block.super }}
{{ media.css }}
{{ view.media.css }}
{% endblock %}
{% block extra_js %}
{{ block.super }}
{% include "wagtailadmin/pages/_editor_js.html" %}
{{ media.js }}
{{ view.media.js }}

<script>
// Set wagtailConfig.ACTIVE_CONTENT_LOCALE if this is a translated page
// This value may be used by JS widgets on the form
{% if locale %}
window.wagtailConfig = window.wagtailConfig || {};
window.wagtailConfig.ACTIVE_CONTENT_LOCALE = '{{ locale.language_code|escapejs }}';
{% endif %}
</script>

{% if workflow_enabled %}
{% include "wagtailadmin/shared/_workflow_init.html" %}
{% endif %}
{% endblock %}
2 changes: 1 addition & 1 deletion wagtailmenus/tests/test_backend.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
form = edit_view.forms[next(reversed(OrderedDict(edit_view.forms)))]
response = form.submit().follow()

assert re.search(r"Main menu [^<>]+ updated", response.content.decode())
assert re.search(r"Main menu .*? updated\.", response.content.decode())
github-advanced-security[bot] marked this conversation as resolved.
Dismissed
Show resolved Hide resolved


class LinkPageCMSTest(TestCase):
Expand Down
Loading