{#- chirp-ui: Video Thumbnail component Image with play overlay, duration badge, progress bar (watched). Usage: from "chirpui/video_thumbnail.html" import video_thumbnail video_thumbnail(href="/watch/1", src="/thumb.jpg", alt="Video title", duration="4:32") video_thumbnail(src="/thumb.jpg", duration="4:32", watched_pct=75) -#} {% def video_thumbnail(href=none, src="", alt="", duration=none, watched_pct=none, cls="") %} {% set tag = "a" if href else "figure" %} {% if href %} {% else %}
{% end %} {{ alt }} {% if duration %} {{ duration }} {% end %} {% if watched_pct is not none and watched_pct > 0 %} {% end %} {% if href %} {% else %}
{% end %} {% end %}