Skip to content

Commit

Permalink
#109 wagtail_srcset no longer needed
Browse files Browse the repository at this point in the history
  • Loading branch information
ephes committed Nov 25, 2023
1 parent aeaad85 commit f47e6ca
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 22 deletions.
1 change: 0 additions & 1 deletion cast/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
"wagtail.search",
"wagtail.admin",
"wagtail",
"wagtail_srcset",
"cast",
]

Expand Down
1 change: 0 additions & 1 deletion cast/templates/cast/bootstrap4/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load wagtail_srcset_tags %}

{% if page.comments_enabled %}
{% load comments %}
Expand Down
44 changes: 29 additions & 15 deletions cast/templates/cast/gallery.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
{% load wagtail_srcset_tags %}

<div class="cast-gallery-container">
{% for image in value %}
<a
Expand All @@ -9,23 +7,39 @@
data-target="#galleryModal-{{ block.id }}"
data-full="{{ image.file.url }}"
>
{% srcset_image image max-120x80 as thumbnail %}
<img
id="img-{{image.pk}}"
class="cast-gallery-thumbnail"
src="{{ thumbnail.url }}"
width="{{ thumbnail.width }}"
height="{{ thumbnail.height }}"
srcset="{{ thumbnail.srcset }}"
data-prev="{{ image.prev }}"
data-next="{{ image.next }}"
loading="lazy"
/>
<picture>
<source
srcset="{{ image.thumbnail.srcset.avif }}"
type="image/avif"
sizes="{{ image.thumbnail.sizes }}"
data-modal-src="{{ image.modal.src.avif }}"
data-modal-srcset="{{ image.modal.srcset.avif }}"
data-modal-sizes="{{ image.modal.sizes }}"
>
<img
id="img-{{image.pk}}"
class="cast-gallery-thumbnail"
alt="{{ image.default_alt_text }}"
src="{{ image.thumbnail.src.jpeg }}"
srcset="{{ image.thumbnail.srcset.jpeg }}"
sizes="{{ image.thumbnail.sizes }}"
width="{{ image.thumbnail.width }}"
height="{{ image.thumbnail.height }}"
data-modal-src="{{ image.modal.src.jpeg }}"
data-modal-srcset="{{ image.modal.srcset.jpeg }}"
data-modal-sizes="{{ image.modal.sizes }}"
data-modal-width="{{ image.modal.width }}"
data-modal-height="{{ image.modal.height }}"
data-prev="{{ image.prev }}"
data-next="{{ image.next }}"
loading="lazy"
/>
</picture>
</a>
{% endfor %}
<!-- Modal -->
<div class="modal fade" id="galleryModal-{{ block.id }}" tabindex="-1" role="dialog"
aria-labelledby="galleryModalLabel" aria-hidden="true">
aria-labelledby="galleryModalLabel" aria-hidden="true">
<div class="modal-dialog modal-lg cast-gallery-lg" role="document">
<div class="modal-content cast-gallery-content">
<div class="modal-header cast-gallery-header">
Expand Down
1 change: 0 additions & 1 deletion cast/templates/cast/home_page.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load wagtail_srcset_tags %}

{% block body_class %}template-homepage{% endblock %}

Expand Down
1 change: 0 additions & 1 deletion cast/templates/cast/plain/post.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

{% load wagtailcore_tags %}
{% load wagtailimages_tags %}
{% load wagtail_srcset_tags %}

{% if page.comments_enabled %}
{% load comments %}
Expand Down
1 change: 0 additions & 1 deletion docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ Add following third party apps to your INSTALLED_APPS setting:
"wagtail.search",
"wagtail.admin",
"wagtail",
"wagtail_srcset",
"modelcluster",
"taggit",
)
Expand Down
1 change: 0 additions & 1 deletion example/example_site/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"wagtail.search",
"wagtail.admin",
"wagtail",
"wagtail_srcset",
"modelcluster",
"taggit",
]
Expand Down
1 change: 0 additions & 1 deletion tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
"wagtail.search",
"wagtail.admin",
"wagtail",
"wagtail_srcset",
"cast.apps.CastConfig",
]

Expand Down

0 comments on commit f47e6ca

Please sign in to comment.