From 2a1d026ea79e93c1f616d7c09bf7ddaf94bebcb1 Mon Sep 17 00:00:00 2001
From: Tom Teichler <tom.teichler@teckids.org>
Date: Fri, 21 Feb 2020 21:08:47 +0100
Subject: [PATCH] Add some more templates

---
 templates/author.html       |  6 ++++
 templates/page_default.html | 70 +++++++++++++++++++++++++++++++++++++
 templates/translations.html |  8 +++++
 3 files changed, 84 insertions(+)
 create mode 100644 templates/author.html
 create mode 100644 templates/page_default.html
 create mode 100644 templates/translations.html

diff --git a/templates/author.html b/templates/author.html
new file mode 100644
index 0000000..f792cee
--- /dev/null
+++ b/templates/author.html
@@ -0,0 +1,6 @@
+{% extends "page_default.html" %}
+
+{% block title %}{{ SITENAME }} — Articles by {{ author }}{% endblock %}
+{% block content_title %}
+<h2>Articles by {{ author }}</h2>
+{% endblock %}
diff --git a/templates/page_default.html b/templates/page_default.html
new file mode 100644
index 0000000..02fbf88
--- /dev/null
+++ b/templates/page_default.html
@@ -0,0 +1,70 @@
+{% extends "base.html" %}
+{% block title %}{{ SITENAME }} — News{%endblock%}
+
+{% block head %}
+{{ super() }}
+<meta itemprop='url' content='{{ SITEURL }}' />
+<meta itemprop='name' content='{{ SITENAME }} — News' />
+<meta itemprop='image' content='{{ SITELOGO }}' />
+
+<meta property='og:url' content='{{ SITEURL }}' />
+<meta property='og:title' content='{{ SITENAME }} — News' />
+<meta property='og:image' content='{{ SITELOGO }}' />
+
+{% endblock head %}
+
+{% block content %}
+
+    <div class="container title">
+        <div class="row clearfix">
+            <div class="column full">
+                {% block content_title %}
+                    <h1>Recent News</h1>
+                    <div class='feed-text'><a href="https://teckids.edugit.io/feeds/all.atom.xml">Feed <i class='fa fa-rss'></i></a></div>
+                {% endblock %}
+            </div>
+        </div>
+    </div>
+
+    <section id="articles">
+        <div class="container">
+            {% for article in articles_page.object_list %}
+                <div class='row clearfix'>
+
+                    <div class="column full">
+                        <h3 class="entry-title">
+                            <a href="/{{ article.url }}" rel="bookmark" title="Permalink to {{ article.title|striptags }}">
+                                {{ article.title }}
+                            </a>
+                        </h3>
+
+                        <div class='post-info'>
+                            <abbr class="published" title="{{ article.date.isoformat() }}"> {{ article.locale_date }} </abbr>
+
+                            <address class="vcard author">by
+                                {% for author in article.authors %}
+                                    <a class="url fn" href="/{{ author.url }}">{{ author }}</a>
+                                {% endfor %}
+                            </address>
+
+                        </div>
+
+                        <div class='entry-content'>
+                            {% if article.summary %}
+                            {{ article.summary }}
+                            {% else %}
+                            {{ article.content|truncate() }}
+                            {% endif %}
+                        </div>
+                    </div>
+
+                </div>
+                <hr />
+            {% endfor %}
+            {% if articles_page.has_other_pages() %}
+                {% include 'pagination.html' %}
+            {% endif %}
+        </div>
+    </section><!-- /#content -->
+
+{% endblock content %}
diff --git a/templates/translations.html b/templates/translations.html
new file mode 100644
index 0000000..335165d
--- /dev/null
+++ b/templates/translations.html
@@ -0,0 +1,8 @@
+{% macro translations_for(article) %}
+{% if article.translations %}
+Translations:
+{% for translation in article.translations %}
+<a href="/{{ translation.url }}">{{ translation.lang }}</a>
+{% endfor %}
+{% endif %}
+{% endmacro %}
-- 
GitLab