##// END OF EJS Templates
Added ability to show multiple banners. Added "view on site" link for the post...
neko259 -
r1149:ecab0b83 default
parent child Browse files
Show More
@@ -216,9 +216,13 b' class Post(models.Model, Viewable):'
216
216
217 return self.get_thread().get_opening_post_id() == self.id
217 return self.get_thread().get_opening_post_id() == self.id
218
218
219 # TODO Remove this and use get_absolute_url method
219 def get_url(self):
220 def get_url(self):
220 return self.url
221 return self.url
221
222
223 def get_absolute_url(self):
224 return self.url
225
222 def get_thread(self):
226 def get_thread(self):
223 return self.thread
227 return self.thread
224
228
@@ -232,3 +232,6 b' class Thread(models.Model):'
232 WS_NOTIFICATION_TYPE: WS_NOTIFICATION_TYPE_NEW_POST,
232 WS_NOTIFICATION_TYPE: WS_NOTIFICATION_TYPE_NEW_POST,
233 })
233 })
234 client.send()
234 client.send()
235
236 def get_absolute_url(self):
237 return self.get_opening_post().get_absolute_url()
@@ -28,13 +28,13 b''
28 {% get_current_language as LANGUAGE_CODE %}
28 {% get_current_language as LANGUAGE_CODE %}
29 {% get_current_timezone as TIME_ZONE %}
29 {% get_current_timezone as TIME_ZONE %}
30
30
31 {% if banner %}
31 {% for banner in banners %}
32 <div class="post">
32 <div class="post">
33 <div class="title">{{ banner.title }}</div>
33 <div class="title">{{ banner.title }}</div>
34 <div>{{ banner.text }}</div>
34 <div>{{ banner.text }}</div>
35 <div>{% trans 'Related message' %}: <a href="{{ banner.post.get_url }}">>>{{ banner.post.id }}</a></div>
35 <div>{% trans 'Related message' %}: <a href="{{ banner.post.get_url }}">>>{{ banner.post.id }}</a></div>
36 </div>
36 </div>
37 {% endif %}
37 {% endfor %}
38
38
39 {% if tag %}
39 {% if tag %}
40 <div class="tag_info">
40 <div class="tag_info">
@@ -28,7 +28,7 b" TAG_DELIMITER = ' '"
28 PARAMETER_CURRENT_PAGE = 'current_page'
28 PARAMETER_CURRENT_PAGE = 'current_page'
29 PARAMETER_PAGINATOR = 'paginator'
29 PARAMETER_PAGINATOR = 'paginator'
30 PARAMETER_THREADS = 'threads'
30 PARAMETER_THREADS = 'threads'
31 PARAMETER_BANNER = 'banner'
31 PARAMETER_BANNERS = 'banners'
32
32
33 PARAMETER_PREV_LINK = 'prev_page_link'
33 PARAMETER_PREV_LINK = 'prev_page_link'
34 PARAMETER_NEXT_LINK = 'next_page_link'
34 PARAMETER_NEXT_LINK = 'next_page_link'
@@ -61,7 +61,7 b' class AllThreadsView(PostMixin, BaseBoar'
61
61
62 params[PARAMETER_THREADS] = threads
62 params[PARAMETER_THREADS] = threads
63 params[CONTEXT_FORM] = form
63 params[CONTEXT_FORM] = form
64 params[PARAMETER_BANNER] = Banner.objects.last()
64 params[PARAMETER_BANNERS] = Banner.objects.order_by('-id').all()
65
65
66 self.get_page_context(paginator, params, page)
66 self.get_page_context(paginator, params, page)
67
67
General Comments 0
You need to be logged in to leave comments. Login now