Skip to content

Commit

Permalink
Rename custom wagtail_version to is_wagtail_version_gte
Browse files Browse the repository at this point in the history
  • Loading branch information
katdom13 committed May 28, 2024
1 parent 201ac15 commit 3026425
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% load wagtailadmin_tags media_tags %}

{% wagtail_version 6 1 as wagtail61 %}
{% is_wagtail_version_gte 6 0 as wagtail60 %}

<li class="{% if field.field.required %}required{% endif %} {{ wrapper_classes }} {{ li_classes }} {% if field.errors %}error{% endif %}">
{% if wagtail61 %}
{% if wagtail60 %}
{% include "wagtailmedia/media/_file_field.html" %}
{% else %}
{% include "wagtailmedia/media/_file_field_legacy.html" %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% load wagtailadmin_tags media_tags %}

{% wagtail_version 6 1 as wagtail61 %}
{% is_wagtail_version_gte 6 0 as wagtail60 %}

<li class="{% if field.field.required %}required{% endif %} {{ wrapper_classes }} {{ li_classes }} {% if field.errors %}error{% endif %}">
{% if wagtail61 %}
{% if wagtail60 %}
{% include "wagtailmedia/media/_thumbnail_field.html" %}
{% else %}
{% include "wagtailmedia/media/_thumbnail_field_legacy.html" %}
Expand Down
2 changes: 1 addition & 1 deletion src/wagtailmedia/templates/wagtailmedia/media/edit.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
{% block form_row %}
<div class="row row-flush nice-padding">

{% wagtail_version 6 1 as wagtail61 %}
{% is_wagtail_version_gte 6 1 as wagtail61 %}

<div class="col10 {% if not wagtail61 %}divider-after{% endif %}">
<form action="{% block action %}{% url 'wagtailmedia:edit' media.pk %}{% endblock %}" method="POST" enctype="multipart/form-data" novalidate>
Expand Down
2 changes: 1 addition & 1 deletion src/wagtailmedia/templatetags/media_tags.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@


@register.simple_tag
def wagtail_version(*version):
def is_wagtail_version_gte(*version):
return WAGTAIL_VERSION >= version

0 comments on commit 3026425

Please sign in to comment.