From: Michael Tremer Date: Sat, 1 Sep 2018 15:28:26 +0000 (+0100) Subject: blog: Show useful message when no posts with a certain tag exist X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0dc2fc192e54b581fb50d3d8653e407166371ac;p=ipfire.org.git blog: Show useful message when no posts with a certain tag exist Signed-off-by: Michael Tremer --- diff --git a/src/templates/blog/tag.html b/src/templates/blog/tag.html index c9561113..749c6aa5 100644 --- a/src/templates/blog/tag.html +++ b/src/templates/blog/tag.html @@ -5,7 +5,13 @@ {% block main %}
- {% module BlogPosts(posts) %} + {% if posts %} + {% module BlogPosts(posts) %} + {% else %} +

+ {{ _("There are no posts tagged with '%s'") % tag }} +

+ {% end %}
{% end block %} diff --git a/src/web/blog.py b/src/web/blog.py index ca76a5a2..8c24f3e5 100644 --- a/src/web/blog.py +++ b/src/web/blog.py @@ -85,7 +85,7 @@ class TagHandler(base.BaseHandler): if not posts: raise tornado.web.HTTPError(404, "There are no posts with tag: %s" % tag) - self.render("blog/tag.html", posts=posts, tag=tag) + self.render("blog/tag.html", posts=list(posts), tag=tag) class YearHandler(base.BaseHandler):