# HG changeset patch # User neko259 # Date 2013-10-28 15:16:15 # Node ID 0647dc8fd6da8229f68ed2200f4141a835aa60c5 # Parent 18a208f8821e1eb806ce2f20d4502313547a3e75 Sort tags alphabetically in metadata diff --git a/boards/models.py b/boards/models.py --- a/boards/models.py +++ b/boards/models.py @@ -311,6 +311,11 @@ class Post(models.Model): return last_replies + def get_tags(self): + """Get a sorted tag list""" + + return self.tags.order_by('name') + class User(models.Model): diff --git a/boards/templates/boards/posting_general.html b/boards/templates/boards/posting_general.html --- a/boards/templates/boards/posting_general.html +++ b/boards/templates/boards/posting_general.html @@ -84,7 +84,7 @@ {{ thread.thread.get_images_count }} {% trans 'images' %}. {% if thread.thread.tags %} - {% for tag in thread.thread.tags.all %} + {% for tag in thread.thread.get_tags %} #{{ tag.name }} diff --git a/boards/templates/boards/thread.html b/boards/templates/boards/thread.html --- a/boards/templates/boards/thread.html +++ b/boards/templates/boards/thread.html @@ -78,7 +78,7 @@ {% if post.id == posts.0.id %}