# HG changeset patch # User neko259 # Date 2015-02-05 14:25:01 # Node ID 70eb45583521b385b4cdfaccd7f22bea015312ad # Parent 3fbf1166666b05337cd338080ce8ef8c1b638bd4 Show thread number in the post number if post has many threads diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -443,3 +443,9 @@ class Post(models.Model, Viewable): def get_raw_text(self) -> str: return self.text + + def get_absolute_id(self) -> str: + if self.get_threads().count() > 1: + return '{}/{}'.format(self.get_thread().get_opening_post_id(), self.id) + else: + return str(self.id) diff --git a/boards/templates/boards/post.html b/boards/templates/boards/post.html --- a/boards/templates/boards/post.html +++ b/boards/templates/boards/post.html @@ -16,7 +16,7 @@ ({{ post.id }}) + title="{% trans 'Quote' %}" {% endif %}>({{ post.get_absolute_id }}) {{ post.title }} {{ post.pub_time }} {% comment %}