{% macro paginate(pagination) %} {% if pagination %} {% if pagination.pages > 1 %} {% if pagination.current > 1 %} Previous | {% endif %} Page {{ pagination.current }} of {{ pagination.pages }} {% if pagination.current < pagination.pages %} | Next {% endif %} {% endif %} {% endif %} {% endmacro %} {# Extract the createdAt entry of the object and try to display it in a human-friendly manner #} {%- macro date(object) -%} {%- endmacro -%} {% macro videos(videos, domain=None) %} {% for video in videos %} {% if domain == None %}{% set domain = video.account.host %}{% endif %}
{{ video.name }}
{# For video lists, we don't have access to the VideoInfo struct (TODO: why not?), so this is just a quickhack based on peertube date format to extract relevant string out of it for human consumption #} {{ date(video) }} - {{ video.views }} Views
{% if video.channel %} {{ video.channel.displayName }} {% endif %}
{{ video.account.name }}@{{ video.account.host }}
{% endfor %} {% endmacro %}