{% macro shared_style() %} {% endmacro %} {% macro post_form(uri, key, val, text, fragment="") %}
{% endmacro %} {% macro media_element_buttons(element) %} {% set api_uri = "/api/media/" + element.id|string %} {% set fragment = "media_element_" + element.id|string %} {{ element.uri | as_play_link }} {% if element.watched %} {{ post_form(api_uri, "watched", "false", "Unmark as Watched", fragment) }} {% elif element.ignored %} {{ post_form(api_uri, "ignored", "false", "Unmark as Ignored", fragment) }} {% else %} {{ post_form(api_uri, "watched", "true", "Watched", fragment) }} {{ post_form(api_uri, "ignored", "true", "Ignore", fragment) }} {% endif %} {% endmacro %} {% macro media_entry_content(element) %} {{ media_element_buttons(element) }} {{ element.release_date.strftime("%d.%m.%Y") }} {{ element.title }} {%- endmacro %} {% macro link_entry_content(link) %} {{ media_entry_content(link.element) -}} {%- if link.season != 0 -%} , Season {{ link.season }} {%- endif -%} {%- if link.episode != 0 -%} , Episode {{ link.episode }} {%- endif -%} {%- endmacro %} {% macro media_entry(element) %}
  • {{ media_entry_content(element) }}
  • {%- endmacro %} {% macro link_entry(link) %}
  • {{ link_entry_content(link) }}
  • {%- endmacro %}