##// END OF EJS Templates
New RSS url model with proper links (no page attribute)
neko259 -
r1399:d814364f default
parent child Browse files
Show More
@@ -191,7 +191,6 b''
191 191 {% endfor %}
192 192 {% endwith %}
193 193 ]
194 [<a href="rss/">RSS</a>]
195 194 </span>
196 195
197 196 {% endblock %}
@@ -68,6 +68,9 b''
68 68
69 69 <div class="navigation_panel footer">
70 70 {% block metapanel %}{% endblock %}
71 {% if rss_url %}
72 [<a href="{{ rss_url }}">RSS</a>]
73 {% endif %}
71 74 [<a href="{% url 'admin:index' %}">{% trans 'Admin' %}</a>]
72 75 [<a href="{% url 'index' %}?order=pub">{% trans 'New threads' %}</a>]
73 76 {% with ppd=posts_per_day|floatformat:2 %}
@@ -37,8 +37,7 b''
37 37 {% with images_count=thread.get_images_count%}
38 38 <span id="image-count">{{ images_count }}</span> <span id="image-count-text">{% blocktrans count count=images_count %}image{% plural %}images{% endblocktrans %}</span>.
39 39 {% endwith %}
40 {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time }}</time></span>
41 [<a href="rss/">RSS</a>]
40 {% trans 'Last update: ' %}<span id="last-update"><time datetime="{{ thread.last_edit_time|date:'c' }}">{{ thread.last_edit_time }}</time></span>
42 41 </span>
43 42
44 43 {% endblock %}
@@ -32,6 +32,7 b" PARAMETER_THREADS = 'threads'"
32 32 PARAMETER_BANNERS = 'banners'
33 33 PARAMETER_ADDITIONAL = 'additional_params'
34 34 PARAMETER_MAX_FILE_SIZE = 'max_file_size'
35 PARAMETER_RSS_URL = 'rss_url'
35 36
36 37 PARAMETER_PREV_LINK = 'prev_page_link'
37 38 PARAMETER_NEXT_LINK = 'next_page_link'
@@ -77,6 +78,7 b' class AllThreadsView(PostMixin, FileUplo'
77 78 params[CONTEXT_FORM] = form
78 79 params[PARAMETER_BANNERS] = Banner.objects.order_by('-id').all()
79 80 params[PARAMETER_MAX_FILE_SIZE] = self.get_max_upload_size()
81 params[PARAMETER_RSS_URL] = self.get_rss_url()
80 82
81 83 paginator.set_url(self.get_reverse_url(), request.GET.dict())
82 84 self.get_page_context(paginator, params, page)
@@ -158,3 +160,6 b' class AllThreadsView(PostMixin, FileUplo'
158 160
159 161 return Thread.objects\
160 162 .exclude(tags__in=self.settings_manager.get_hidden_tags())
163
164 def get_rss_url(self):
165 return self.get_reverse_url() + 'rss/'
@@ -1,6 +1,7 b''
1 1 from django.contrib.auth.decorators import permission_required
2 2
3 3 from django.core.exceptions import ObjectDoesNotExist
4 from django.core.urlresolvers import reverse
4 5 from django.http import Http404
5 6 from django.shortcuts import get_object_or_404, render, redirect
6 7 from django.views.generic.edit import FormMixin
@@ -28,6 +29,7 b" CONTEXT_WS_TIME = 'ws_token_time'"
28 29 CONTEXT_MODE = 'mode'
29 30 CONTEXT_OP = 'opening_post'
30 31 CONTEXT_FAVORITE = 'is_favorite'
32 CONTEXT_RSS_URL = 'rss_url'
31 33
32 34 FORM_TITLE = 'title'
33 35 FORM_TEXT = 'text'
@@ -67,6 +69,7 b' class ThreadView(BaseBoardView, PostMixi'
67 69 params[CONTEXT_MODE] = self.get_mode()
68 70 params[CONTEXT_OP] = opening_post
69 71 params[CONTEXT_FAVORITE] = favorite
72 params[CONTEXT_RSS_URL] = self.get_rss_url(post_id)
70 73
71 74 if settings.get_bool('External', 'WebsocketsEnabled'):
72 75 token_time = format(timezone.now(), u'U')
@@ -171,3 +174,6 b' class ThreadView(BaseBoardView, PostMixi'
171 174 post = get_object_or_404(Post, id=post_id)
172 175 post.set_hidden(not post.is_hidden())
173 176 post.save(update_fields=['hidden'])
177
178 def get_rss_url(self, opening_id):
179 return reverse('thread', kwargs={'post_id': opening_id}) No newline at end of file
General Comments 0
You need to be logged in to leave comments. Login now