From 28338bbe5e10610c73b8c4fe7baaa7e66eaab3a3 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 18 Dec 2017 14:54:39 +0000 Subject: [PATCH] factor out preview content --- content/templates/events.html | 21 +------------ content/templates/preview.html | 19 ++++++++++++ content/templates/projects.html | 52 +++++++++++++-------------------- content/templates/related.html | 8 +++++ 4 files changed, 48 insertions(+), 52 deletions(-) create mode 100644 content/templates/preview.html create mode 100644 content/templates/related.html diff --git a/content/templates/events.html b/content/templates/events.html index f7dd712..b595896 100644 --- a/content/templates/events.html +++ b/content/templates/events.html @@ -27,26 +27,7 @@
- {% if events.children.all %} - - {% for child in events.children.all %} - - {% endfor %} - {% endif %} + {% include "related.html" with related=events.children.all %}
diff --git a/content/templates/preview.html b/content/templates/preview.html new file mode 100644 index 0000000..35d18a1 --- /dev/null +++ b/content/templates/preview.html @@ -0,0 +1,19 @@ + diff --git a/content/templates/projects.html b/content/templates/projects.html index bb5a26c..f62ad28 100644 --- a/content/templates/projects.html +++ b/content/templates/projects.html @@ -19,37 +19,25 @@ {% if latest_content_list %}
- {% if projects.children.all %} - - {% for child in projects.children.all %} - - {% endfor %} - {% endif %} - -
- - {% for projects in latest_content_list %} -
-
- -
-
- {{ projects.title }} -

{{projects.formatted_teaser}}

-
-
- {% endfor %} - {% else %} -

No projects.

- {% endif %} -
-
+ {% include "related.html" with related=projects.children.all %} + +
+ + {% for projects in latest_content_list %} +
+
+ +
+
+ {{ projects.title }} +

{{projects.formatted_teaser}}

+
+
+ {% endfor %} + {% else %} +

No projects.

+ {% endif %} +
+
{% endblock %} diff --git a/content/templates/related.html b/content/templates/related.html new file mode 100644 index 0000000..e27e75c --- /dev/null +++ b/content/templates/related.html @@ -0,0 +1,8 @@ +{% if related %} + +{% for content in related %} +{% include "preview.html" %} +{% endfor %} +
+
+{% endif %}