Skip to content

Commit

Permalink
Merge pull request #123 from lucasgueiros/master
Browse files Browse the repository at this point in the history
Even more compatible with wagtail 6
  • Loading branch information
seb-b authored May 10, 2024
2 parents c87e8ae + 8547ad8 commit 430545a
Show file tree
Hide file tree
Showing 12 changed files with 21 additions and 14 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
CHANGELOG
=========

Unreleased
---
- Changed wagtail.contrib.modeladmin to wagtail_modeladmin
- Removed references to wagtailadmin/shared/field_as_li.html
- Removed "created in" from wagtail admin

5.2
---

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ Same as Wagtail Images, a custom model can be used to replace the built in Video
Video text tracks:
~~~~~~~~~~~~~~~~~~

To enable the uploading and displaying of VTT tracks (e.g. subtitles, captions) you'll need to add ``wagtail.contrib.modeladmin`` to your installed apps.
To enable the uploading and displaying of VTT tracks (e.g. subtitles, captions) you'll need to add ``wagtail_modeladmin`` to your installed apps.
Once added, there will be an new area in the admin for attaching VTT files to videos with associaled metadata.

Future features
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

setup(
name="wagtailvideos",
version="5.2.1",
version="5.2.2",
description="A wagtail module for uploading and displaying videos in various codecs.",
long_description=readme,
author="Neon Jungle",
Expand All @@ -21,6 +21,7 @@
"Django>=3.2",
"django-enumchoicefield>=1.1.0",
"bcp47==0.0.4",
"wagtail-modeladmin>=2.0.0"
],
zip_safe=False,
license="BSD License",
Expand Down
2 changes: 1 addition & 1 deletion tests/app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"wagtail.snippets",
"wagtail.images",
"wagtail.documents",
"wagtail.contrib.modeladmin",
"wagtail_modeladmin",
"django.contrib.admin",
"django.contrib.auth",
"django.contrib.contenttypes",
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def is_modeladmin_installed():
from django.apps import apps
return apps.is_installed('wagtail.contrib.modeladmin')
return apps.is_installed('wagtail_modeladmin')


def get_video_model_string():
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/templates/wagtailvideos/chooser/chooser.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
>
<ul class="fields">
{% for field in filter_form %}
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
<li>{% include "wagtailadmin/shared/field.html" with field=field %}</li>
{% endfor %}
{% if popular_tags %}
<li class="taglist w-label-3">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
{% icon name="media" %}
<a href="{% url 'wagtailvideos:index' %}">
{% blocktrans count counter=total_videos with total_videos|intcomma as total %}
<span>{{ total }}</span> Video <span class="visuallyhidden">created in {{ site_name }}</span>
<span>{{ total }}</span> Video <span class="visuallyhidden" style="display: none;">created in {{ site_name }}</span>
{% plural %}
<span>{{ total }}</span> Videos <span class="visuallyhidden">created in {{ site_name }}</span>
<span>{{ total }}</span> Videos <span class="visuallyhidden" style="display: none;">created in {{ site_name }}</span>
{% endblocktrans %}
</a>
</li>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{% if field.is_hidden %}
{{ field }}
{% else %}
{% include "wagtailadmin/shared/field_as_li.html" %}
<li>{% include "wagtailadmin/shared/field.html" %}</li>
{% endif %}
{% endfor %}
<li>
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/templates/wagtailvideos/videos/add.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
{% if field.is_hidden %}
{{ field }}
{% else %}
{% include "wagtailadmin/shared/field_as_li.html" with field=field %}
<li>{% include "wagtailadmin/shared/field.html" with field=field %}</li>
{% endif %}
{% endfor %}
<li><input class="button" type="submit" value="{% trans 'Save' %}" /></li>
Expand Down
6 changes: 3 additions & 3 deletions wagtailvideos/templates/wagtailvideos/videos/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
{% elif field.is_hidden %}
{{ field }}
{% else %}
{% include "wagtailadmin/shared/field_as_li.html" with li_classes="label-above label-uppercase" %}
<li>{% include "wagtailadmin/shared/field.html" with li_classes="label-above label-uppercase" %}</li>
{% endif %}
{% endfor %}
<li>
Expand Down Expand Up @@ -109,8 +109,8 @@ <h3 class="u-text-transform-uppercase">{% trans "Create transcode" %}</h3>
<form action="{% url 'wagtailvideos:create_transcode' video.id %}" method="POST">
<ul class="fields">
{% csrf_token %}
{% include "wagtailadmin/shared/field_as_li.html" with field=transcode_form.media_format li_classes="label-above label-uppercase" %}
{% include "wagtailadmin/shared/field_as_li.html" with field=transcode_form.quality li_classes="label-above label-uppercase" %}
<li>{% include "wagtailadmin/shared/field.html" with field=transcode_form.media_format li_classes="label-above label-uppercase" %}</li>
<li>{% include "wagtailadmin/shared/field.html" with field=transcode_form.quality li_classes="label-above label-uppercase" %}</li>
<li>
<input class="button" type="submit" value="{% trans 'Start' %}" />
</li>
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/views/videos.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
from wagtail.admin.auth import PermissionPolicyChecker
from wagtail.admin.forms.search import SearchForm
from wagtail.admin.models import popular_tags_for_model
from wagtail.contrib.modeladmin.helpers import AdminURLHelper
from wagtail.models import Collection
from wagtail.search.backends import get_search_backends
from wagtail_modeladmin.helpers import AdminURLHelper

from wagtailvideos import ffmpeg, get_video_model, is_modeladmin_installed
from wagtailvideos.forms import VideoTranscodeAdminForm, get_video_form
Expand Down
2 changes: 1 addition & 1 deletion wagtailvideos/wagtail_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from wagtail.admin.panels import InlinePanel
from wagtail.admin.search import SearchArea
from wagtail.admin.site_summary import SummaryItem
from wagtail.contrib.modeladmin.options import ModelAdmin, modeladmin_register
from wagtail_modeladmin.options import ModelAdmin, modeladmin_register

from wagtailvideos import get_video_model, is_modeladmin_installed, urls
from wagtailvideos.edit_handlers import VideoChooserPanel
Expand Down

0 comments on commit 430545a

Please sign in to comment.