{% extends "base.html" %} {% macro make_row(title,items) %}
{% for item in items %} {{item|safe}} {% endfor %}
{% endmacro %} {% macro make_tabs(tabs) %}
{% for (label,items) in tabs %} {% set slug = (label|slugify) %}
{{make_row(label,items)}}
{% endfor %}
{% endmacro %} {% macro upcoming(data) %}

Movies

{% for movie in data.calendar.movies %} {% if movie.isAvailable and movie.hasFile %} {% set row_attrs = "bg-success" %} {% elif movie.isAvailable and not movie.hasFile %} {% set row_attrs = "bg-danger" %} {% elif not movie.isAvailable and movie.hasFile %} {% set row_attrs = "bg-primary" %} {% elif not movie.isAvailable and not movie.hasFile %} {% set row_attrs = "bg-info" %} {% endif %} {% if movie.digitalRelease %} {% else %} {% endif %} {% endfor %}
Title Status In Cinemas Digital Release
{{movie.title}} {{movie.status}} {{movie.inCinemas|fromiso|ago_dt_utc_human(rnd=0)}}{{movie.digitalRelease|fromiso|ago_dt_utc_human(rnd=0)}}Unknown

Episodes

{% for entry in data.calendar.episodes %} {% if entry.details %} {% set details = entry.details[0] %} {% endif %} {% if entry.episode.hasAired and entry.episode.hasFile %} {% set row_attrs = {"class":"bg-success"} %} {% elif entry.episode.hasAired and not entry.episode.hasFile and details %} {% set row_attrs = {"style":"background-color: green !important"} %} {% elif entry.episode.hasAired and not entry.episode.hasFile %} {% set row_attrs = {"class":"bg-danger"} %} {% elif not entry.episode.hasAired and entry.episode.hasFile %} {% set row_attrs = {"class":"bg-primary"} %} {% elif not entry.episode.hasAired and not entry.episode.hasFile %} {% set row_attrs = {"class":"bg-info"} %} {% endif %} {% endfor %}
Season | Episode Number Show Title Status Air Date
{{entry.episode.seasonNumber}} | {{entry.episode.episodeNumber}} {{entry.series.title}} {{entry.episode.title}} {% if details %} {% set details = entry.details[0] %} {% set dl_prc =((details.size-details.sizeleft)/details.size)*100|round(2) %} {{details.status}} ({{dl_prc|round(2)}} %) {% elif row_attrs.class=="bg-success" %} downloaded {% elif row_attrs.class=="bg-danger" %} not downloaded {% elif row_attrs.class=="bg-primary" %} leaked? {% elif row_attrs.class=="bg-info" %} not aired {% endif %} {{entry.episode.airDateUtc|fromiso|ago_dt_utc_human(rnd=0)}}
{% endmacro %} {% block app_content %} {% if data is none %}

No Data available!

{% else %} {% set tabs = [] %} {% do tabs.append(("Schedule",[upcoming(data)])) %} {% for row in data.images %} {% if row[0] is string %} {% set title=row[0] %} {% set row=row[1:] %} {% do tabs.append((title,row)) %} {% endif %} {% endfor %} {{make_tabs(tabs)}} {% endif %} {% endblock %}