From a95200caf9a4b60d102e7d749937e5bf7ce2c5f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Mon, 30 Jun 2025 16:55:44 +0300 Subject: [PATCH] move some templates into one macro --- app/templates/base.html | 2 +- app/templates/common/infobox.html | 10 ---------- app/templates/common/{pager.html => macros.html} | 11 +++++++++++ app/templates/topics/topic.html | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) delete mode 100644 app/templates/common/infobox.html rename app/templates/common/{pager.html => macros.html} (79%) diff --git a/app/templates/base.html b/app/templates/base.html index e86a806..0e95ef9 100644 --- a/app/templates/base.html +++ b/app/templates/base.html @@ -1,4 +1,4 @@ -{% from 'common/infobox.html' import infobox with context %} +{% from 'common/macros.html' import infobox with context %} diff --git a/app/templates/common/infobox.html b/app/templates/common/infobox.html deleted file mode 100644 index 1b55236..0000000 --- a/app/templates/common/infobox.html +++ /dev/null @@ -1,10 +0,0 @@ -{% macro infobox(message, kind=InfoboxKind.INFO) %} -
- -
- -
- {{ message }} -
-
-{% endmacro %} diff --git a/app/templates/common/pager.html b/app/templates/common/macros.html similarity index 79% rename from app/templates/common/pager.html rename to app/templates/common/macros.html index c3a1b4a..fba810c 100644 --- a/app/templates/common/pager.html +++ b/app/templates/common/macros.html @@ -27,3 +27,14 @@ {% endif %} {% endmacro %} + +{% macro infobox(message, kind=InfoboxKind.INFO) %} +
+ +
+ +
+ {{ message }} +
+
+{% endmacro %} diff --git a/app/templates/topics/topic.html b/app/templates/topics/topic.html index f508ec8..70bf947 100644 --- a/app/templates/topics/topic.html +++ b/app/templates/topics/topic.html @@ -1,4 +1,4 @@ -{% from 'common/pager.html' import pager %} +{% from 'common/macros.html' import pager %} {% extends "base.html" %} {% block title %}browsing topic {{ topic['name'] }}{% endblock %} {% block content %}