From e9d192e6b658afb9f7140126cf9cae0adc015cfb Mon Sep 17 00:00:00 2001 From: =?utf8?q?Rapha=C3=ABl=20Gertz?= Date: Fri, 10 Nov 2023 13:18:18 +0100 Subject: [PATCH] Add article and keyword view templates --- Resources/views/article/view.html.twig | 22 +++++++++++++++ Resources/views/keyword/view.html.twig | 37 ++++++++++++++++++++++++++ 2 files changed, 59 insertions(+) create mode 100644 Resources/views/article/view.html.twig create mode 100644 Resources/views/keyword/view.html.twig diff --git a/Resources/views/article/view.html.twig b/Resources/views/article/view.html.twig new file mode 100644 index 0000000..36a87a2 --- /dev/null +++ b/Resources/views/article/view.html.twig @@ -0,0 +1,22 @@ +{% extends '@RapsysBlog/_base.html.twig' %} +{% block title %}{% endblock %} +{% block content %} +
+
+

{{ title }}

+

{% trans with {'%date%': article.created|format_datetime('full', 'short')} %}Published the %date%{% endtrans %}{% if article.created != article.updated %}{% trans with {'%date%': article.updated|format_datetime('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %}

+
+
+ {{ article.body|markdown_to_html }} +
+
+ {% if article.keywords is defined and article.keywords %} + + {% endif %} +
+
+{% endblock %} diff --git a/Resources/views/keyword/view.html.twig b/Resources/views/keyword/view.html.twig new file mode 100644 index 0000000..97c6c94 --- /dev/null +++ b/Resources/views/keyword/view.html.twig @@ -0,0 +1,37 @@ +{% extends '@RapsysBlog/_base.html.twig' %} +{% block title %}{% endblock %} +{% block content %} +
+
+

{{ title }}

+

{% trans with {'%date%': keyword.created|format_datetime('full', 'short')} %}Published the %date%{% endtrans %}{% if keyword.created != keyword.updated %}{% trans with {'%date%': keyword.updated|format_datetime('short', 'short')} %}, edited the %date%{% endtrans %}{% endif %}

+

{{ keyword.description }}

+
+ {% if keyword.articles is defined and keyword.articles %} +
+ {% for article in keyword.articles %} + + {% endfor %} +
+ {% endif %} +
+{% endblock %} -- 2.41.0