Show More
@@ -191,7 +191,6 b'' | |||||
191 | {% endfor %} |
|
191 | {% endfor %} | |
192 | {% endwith %} |
|
192 | {% endwith %} | |
193 | ] |
|
193 | ] | |
194 | [<a href="rss/">RSS</a>] |
|
|||
195 | </span> |
|
194 | </span> | |
196 |
|
195 | |||
197 | {% endblock %} |
|
196 | {% endblock %} |
@@ -68,6 +68,9 b'' | |||||
68 |
|
68 | |||
69 | <div class="navigation_panel footer"> |
|
69 | <div class="navigation_panel footer"> | |
70 | {% block metapanel %}{% endblock %} |
|
70 | {% block metapanel %}{% endblock %} | |
|
71 | {% if rss_url %} | |||
|
72 | [<a href="{{ rss_url }}">RSS</a>] | |||
|
73 | {% endif %} | |||
71 | [<a href="{% url 'admin:index' %}">{% trans 'Admin' %}</a>] |
|
74 | [<a href="{% url 'admin:index' %}">{% trans 'Admin' %}</a>] | |
72 | [<a href="{% url 'index' %}?order=pub">{% trans 'New threads' %}</a>] |
|
75 | [<a href="{% url 'index' %}?order=pub">{% trans 'New threads' %}</a>] | |
73 | {% with ppd=posts_per_day|floatformat:2 %} |
|
76 | {% with ppd=posts_per_day|floatformat:2 %} |
@@ -38,7 +38,6 b'' | |||||
38 | <span id="image-count">{{ images_count }}</span> <span id="image-count-text">{% blocktrans count count=images_count %}image{% plural %}images{% endblocktrans %}</span>. |
|
38 | <span id="image-count">{{ images_count }}</span> <span id="image-count-text">{% blocktrans count count=images_count %}image{% plural %}images{% endblocktrans %}</span>. | |
39 | {% endwith %} |
|
39 | {% endwith %} | |
40 |
|
|
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>] |
|
|||
42 | </span> |
|
41 | </span> | |
43 |
|
42 | |||
44 | {% endblock %} |
|
43 | {% endblock %} |
@@ -32,6 +32,7 b" PARAMETER_THREADS = 'threads'" | |||||
32 | PARAMETER_BANNERS = 'banners' |
|
32 | PARAMETER_BANNERS = 'banners' | |
33 | PARAMETER_ADDITIONAL = 'additional_params' |
|
33 | PARAMETER_ADDITIONAL = 'additional_params' | |
34 | PARAMETER_MAX_FILE_SIZE = 'max_file_size' |
|
34 | PARAMETER_MAX_FILE_SIZE = 'max_file_size' | |
|
35 | PARAMETER_RSS_URL = 'rss_url' | |||
35 |
|
36 | |||
36 | PARAMETER_PREV_LINK = 'prev_page_link' |
|
37 | PARAMETER_PREV_LINK = 'prev_page_link' | |
37 | PARAMETER_NEXT_LINK = 'next_page_link' |
|
38 | PARAMETER_NEXT_LINK = 'next_page_link' | |
@@ -77,6 +78,7 b' class AllThreadsView(PostMixin, FileUplo' | |||||
77 | params[CONTEXT_FORM] = form |
|
78 | params[CONTEXT_FORM] = form | |
78 | params[PARAMETER_BANNERS] = Banner.objects.order_by('-id').all() |
|
79 | params[PARAMETER_BANNERS] = Banner.objects.order_by('-id').all() | |
79 | params[PARAMETER_MAX_FILE_SIZE] = self.get_max_upload_size() |
|
80 | params[PARAMETER_MAX_FILE_SIZE] = self.get_max_upload_size() | |
|
81 | params[PARAMETER_RSS_URL] = self.get_rss_url() | |||
80 |
|
82 | |||
81 | paginator.set_url(self.get_reverse_url(), request.GET.dict()) |
|
83 | paginator.set_url(self.get_reverse_url(), request.GET.dict()) | |
82 | self.get_page_context(paginator, params, page) |
|
84 | self.get_page_context(paginator, params, page) | |
@@ -158,3 +160,6 b' class AllThreadsView(PostMixin, FileUplo' | |||||
158 |
|
160 | |||
159 | return Thread.objects\ |
|
161 | return Thread.objects\ | |
160 | .exclude(tags__in=self.settings_manager.get_hidden_tags()) |
|
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 | from django.contrib.auth.decorators import permission_required |
|
1 | from django.contrib.auth.decorators import permission_required | |
2 |
|
2 | |||
3 | from django.core.exceptions import ObjectDoesNotExist |
|
3 | from django.core.exceptions import ObjectDoesNotExist | |
|
4 | from django.core.urlresolvers import reverse | |||
4 | from django.http import Http404 |
|
5 | from django.http import Http404 | |
5 | from django.shortcuts import get_object_or_404, render, redirect |
|
6 | from django.shortcuts import get_object_or_404, render, redirect | |
6 | from django.views.generic.edit import FormMixin |
|
7 | from django.views.generic.edit import FormMixin | |
@@ -28,6 +29,7 b" CONTEXT_WS_TIME = 'ws_token_time'" | |||||
28 | CONTEXT_MODE = 'mode' |
|
29 | CONTEXT_MODE = 'mode' | |
29 | CONTEXT_OP = 'opening_post' |
|
30 | CONTEXT_OP = 'opening_post' | |
30 | CONTEXT_FAVORITE = 'is_favorite' |
|
31 | CONTEXT_FAVORITE = 'is_favorite' | |
|
32 | CONTEXT_RSS_URL = 'rss_url' | |||
31 |
|
33 | |||
32 | FORM_TITLE = 'title' |
|
34 | FORM_TITLE = 'title' | |
33 | FORM_TEXT = 'text' |
|
35 | FORM_TEXT = 'text' | |
@@ -67,6 +69,7 b' class ThreadView(BaseBoardView, PostMixi' | |||||
67 | params[CONTEXT_MODE] = self.get_mode() |
|
69 | params[CONTEXT_MODE] = self.get_mode() | |
68 | params[CONTEXT_OP] = opening_post |
|
70 | params[CONTEXT_OP] = opening_post | |
69 | params[CONTEXT_FAVORITE] = favorite |
|
71 | params[CONTEXT_FAVORITE] = favorite | |
|
72 | params[CONTEXT_RSS_URL] = self.get_rss_url(post_id) | |||
70 |
|
73 | |||
71 | if settings.get_bool('External', 'WebsocketsEnabled'): |
|
74 | if settings.get_bool('External', 'WebsocketsEnabled'): | |
72 | token_time = format(timezone.now(), u'U') |
|
75 | token_time = format(timezone.now(), u'U') | |
@@ -171,3 +174,6 b' class ThreadView(BaseBoardView, PostMixi' | |||||
171 | post = get_object_or_404(Post, id=post_id) |
|
174 | post = get_object_or_404(Post, id=post_id) | |
172 | post.set_hidden(not post.is_hidden()) |
|
175 | post.set_hidden(not post.is_hidden()) | |
173 | post.save(update_fields=['hidden']) |
|
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