diff --git a/server/templates/collection_element.htm b/server/templates/collection_element.htm
index e9bfb64..c75571e 100644
--- a/server/templates/collection_element.htm
+++ b/server/templates/collection_element.htm
@@ -29,14 +29,7 @@
Next Episode:
{% set link = collection.next_episode %}
{% if link %}
- {{ macros.media_element_buttons(link.element) }}
- {{ link.element.title }}
- {%- if link.season != 0 -%}
- , Season {{ link.season }}
- {% endif %}
- {%- if link.episode != 0 -%}
- , Episode {{ link.episode }}
- {% endif %}
+ {{ macros.link_entry_content(link) }}
{% else %}
no next episode
{% endif %}
@@ -48,17 +41,7 @@
Episodes
{% for link in media_links %}
- -
- {{ macros.media_element_buttons(link.element) }}
- {{ link.element.release_date.strftime("%d.%m.%Y") }}
- {{ link.element.title }}
- {%- if link.season != 0 -%}
- , Season {{ link.season }}
- {% endif %}
- {%- if link.episode != 0 -%}
- , Episode {{ link.episode }}
- {% endif %}
-
+ {{ macros.link_entry(link) }}
{% endfor %}
Links
diff --git a/server/templates/macros.htm b/server/templates/macros.htm
index 3937a59..d03e373 100644
--- a/server/templates/macros.htm
+++ b/server/templates/macros.htm
@@ -52,3 +52,31 @@
{{ 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 %}