From: Michael Tremer Date: Tue, 4 Aug 2020 15:42:05 +0000 (+0000) Subject: location: Add latest relevant blog post X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=716ed05fe9697053d4655708dba47ecb8214ee4b;p=ipfire.org.git location: Add latest relevant blog post Signed-off-by: Michael Tremer --- diff --git a/src/templates/location/index.html b/src/templates/location/index.html index 511393b9..01df8c37 100644 --- a/src/templates/location/index.html +++ b/src/templates/location/index.html @@ -134,4 +134,26 @@ + + {% if posts %} +
+
+
+
+

{{ _("Related News from the IPFire Blog") }}

+ +
+
+ {% module BlogPosts(posts) %} +
+
+ + + {{ _("Read More") }} + +
+
+
+
+ {% end %} {% end block %} diff --git a/src/web/location.py b/src/web/location.py index 06d26b40..8e0fb8bf 100644 --- a/src/web/location.py +++ b/src/web/location.py @@ -11,7 +11,11 @@ from . import base class IndexHandler(auth.CacheMixin, base.BaseHandler): def get(self): - self.render("location/index.html", address=self.current_address) + posts = self.backend.blog.get_by_tag("location", limit=1) + + self.render("location/index.html", + address=self.current_address, posts=posts, + ) class LookupHandler(base.BaseHandler):