##// END OF EJS Templates
Added "view on site" link for tag
neko259 -
r1150:d53fc814 2.7.0 default
parent child Browse files
Show More
@@ -56,9 +56,13 b' class Tag(models.Model, Viewable):'
56 def get_thread_count(self) -> int:
56 def get_thread_count(self) -> int:
57 return self.get_threads().count()
57 return self.get_threads().count()
58
58
59 # TODO Remove this and use get_absolute_url
59 def get_url(self):
60 def get_url(self):
60 return reverse('tag', kwargs={'tag_name': self.name})
61 return reverse('tag', kwargs={'tag_name': self.name})
61
62
63 def get_absolute_url(self):
64 return self.get_url()
65
62 def get_threads(self):
66 def get_threads(self):
63 return self.thread_set.order_by('-bump_time')
67 return self.thread_set.order_by('-bump_time')
64
68
@@ -67,7 +71,7 b' class Tag(models.Model, Viewable):'
67
71
68 def get_view(self):
72 def get_view(self):
69 link = '<a class="tag" href="{}">{}</a>'.format(
73 link = '<a class="tag" href="{}">{}</a>'.format(
70 self.get_url(), self.name)
74 self.get_absolute_url(), self.name)
71 if self.is_required():
75 if self.is_required():
72 link = '<b>{}</b>'.format(link)
76 link = '<b>{}</b>'.format(link)
73 return link
77 return link
General Comments 0
You need to be logged in to leave comments. Login now