diff --git a/cms/templates/certificate_page.html b/cms/templates/certificate_page.html old mode 100755 new mode 100644 index 1f6fd6943e..14e2317289 --- a/cms/templates/certificate_page.html +++ b/cms/templates/certificate_page.html @@ -21,39 +21,39 @@ {% block content %}
- {% if certificate_user == user %} -
-
- -
-
+ {% if certificate_user == user %} +
+
+ +
+
{% endif %}
@@ -125,8 +125,8 @@

Congratulations, {{ learner_name }}!

{% block scripts %} {{ block.super }} - {% if certificate_user == user %} - + {% if certificate_user == user %} + {% endif %} {% endblock %} diff --git a/cms/templatetags/wagtail_image_lazy_load.py b/cms/templatetags/wagtail_image_lazy_load.py index b6039e5844..b0bb524f4b 100644 --- a/cms/templatetags/wagtail_image_lazy_load.py +++ b/cms/templatetags/wagtail_image_lazy_load.py @@ -11,7 +11,7 @@ register = template.Library() -class LazyImageNodeCustom(LazyImageNode): +class CustomLazyImageNode(LazyImageNode): """ An extention to Wagtail-lazyimages library's wagtail_lazyimages.templatetags.lazyimages_tags.LazyImageNode class for customizations @@ -22,7 +22,8 @@ def render(self, context): This method overrides LazyImageNode's render method to add file-hashes to image urls for better caching Returns: - str or None: An image tag with required src and data-src attribute values + str or None: An image tag with required src (having tiny blurry placeholder image) and + data-src (having full-scale image) attribute values """ img = self.image_expr.resolve(context) if not img: @@ -41,23 +42,23 @@ def render(self, context): @register.tag(name="wagtail_image_lazy_load") def wagtail_image_lazy_load(img, filter_spec): """ - Generates a lazy loadable image tag using Wagtail-lazyimages library and appends a version to the path to enable effective caching + Generates an image tag using Wagtail-lazyimages library and appends a version to the path to enable effective caching This method is inspired by wagtail_lazyimages.templatetags.lazyimages_tags.lazy_image of Wagtail-lazyimages library Args: - img (wagtail.images.models.Image): The image the a URL will be generated for + img (wagtail.images.models.Image): The image for which an image template tag will be generated filter_spec (str): A filter specification for the image (see Wagtail docs) Returns: - LazyImageNodeCustom object or None/empty str: A complete lazy loading image tag + CustomLazyImageNode object or None/empty str: A complete lazy loading image tag """ if not img: return "" node = image(img, filter_spec) - return LazyImageNodeCustom( + return CustomLazyImageNode( node.image_expr, node.filter_spec, attrs=node.attrs,