diff --git a/boards/models.py b/boards/models.py --- a/boards/models.py +++ b/boards/models.py @@ -116,6 +116,10 @@ class Tag(models.Model): def __unicode__(self): return self.name + def is_empty(self): + posts_with_tag = Post.objects.get_threads(tag=self) + return len(posts_with_tag) == 0 + class Post(models.Model): """A post is a message.""" diff --git a/boards/static/css/base_page.css b/boards/static/css/base_page.css --- a/boards/static/css/base_page.css +++ b/boards/static/css/base_page.css @@ -71,7 +71,6 @@ html { } .metadata { - float: left; padding: 2px; margin-top: 10px; border: solid 1px #666; diff --git a/templates/posting_general.html b/templates/posting_general.html --- a/templates/posting_general.html +++ b/templates/posting_general.html @@ -22,6 +22,7 @@ >{% trans "View" %}]
{{ thread.get_parsed_text|linebreaksbr|truncatechars:300 }}
+
{{ thread.get_reply_count }} {% trans 'replies' %}, {{ thread.get_images_count }} {% trans 'images' %}, @@ -37,7 +38,6 @@ {% endif %}
- {% endfor %} {% else %} No threads found. diff --git a/templates/thread.html b/templates/thread.html --- a/templates/thread.html +++ b/templates/thread.html @@ -21,17 +21,17 @@ (#{{ post.id }}) [{{ post.pub_time }}]
{{ post.get_parsed_text|linebreaksbr }}
- {% if post.tags.all %} -
- {% trans 'Tags' %}: - {% for tag in post.tags.all %} - - {{ tag.name }} - {% endfor %} - -
- {% endif %} + {% if post.tags.all %} +
+ {% trans 'Tags' %}: + {% for tag in post.tags.all %} + + {{ tag.name }} + {% endfor %} + +
+ {% endif %} {% endfor %} {% else %}