Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

last unread renamed to first unread

  • Loading branch information...
commit 22e427beeb4dcc99cd7e9fc630efbc8ae28c23c9 1 parent 97a4ffb
@GeyseR GeyseR authored
View
BIN  pybb/locale/ru/LC_MESSAGES/django.mo
Binary file not shown
View
7 pybb/locale/ru/LC_MESSAGES/django.po
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: pybbm\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2013-03-26 23:32+0400\n"
+"POT-Creation-Date: 2013-03-27 00:31+0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Pavel Zhukov <gelios@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -499,8 +499,9 @@ msgid "Last post"
msgstr "Последнее сообщение"
#: templates/pybb/topic_list.html:26
-msgid "Go to last unread post"
-msgstr "Перейти к последнему непрочитанному сообщению"
+#, fuzzy
+msgid "Go to first unread post"
+msgstr "Перейти к первому непрочитанному сообщению"
#: templates/pybb/topic_list.html:32
msgid "pages"
View
2  pybb/static/pybb/forum.less
@@ -21,7 +21,7 @@
width: 20%;
}
-.last-unread-post-link, .last-unread-post-link:hover {
+.first-unread-post-link, .first-unread-post-link:hover {
color: @textColor;
text-decoration: none;
}
View
2  pybb/templates/pybb/topic_list.html
@@ -23,7 +23,7 @@
<td class="topic-name{% if topic.unread %} topic-unread{% endif %}">
<div class="state-indicator"></div>
<a href="{{ topic.get_absolute_url }}">{{ topic.name|truncatewords:10 }}</a>
- <a href="{{ topic.get_absolute_url }}?last-unread=1" class="last-unread-post-link" title="{% trans 'Go to last unread post' %}">⇨</a>
+ <a href="{{ topic.get_absolute_url }}?first-unread=1" class="first-unread-post-link" title="{% trans 'Go to first unread post' %}">⇨</a>
{% if topic.sticky %} &nbsp;[{% trans "Sticky" %}] {% endif %}
{% if topic.closed %} &nbsp;[{% trans "Closed" %}] {% endif %}
{% with topic|pybb_topic_inline_pagination as pages %}
View
10 pybb/tests.py
@@ -475,7 +475,7 @@ def test_read_tracker_when_topics_forum_changed(self):
[t.unread for t in pybb_forum_unread([forum_1, forum_2], user_ann)],
[True, False])
- def test_open_last_unread_post(self):
+ def test_open_first_unread_post(self):
forum_1 = self.forum
topic_1 = Topic.objects.create(name='topic_1', forum=forum_1, user=self.user)
topic_2 = Topic.objects.create(name='topic_2', forum=forum_1, user=self.user)
@@ -488,16 +488,16 @@ def test_open_last_unread_post(self):
client_ann = Client()
client_ann.login(username='ann', password='ann')
- response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_1.id }), data={'last-unread': 1},
+ response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_1.id }), data={'first-unread': 1},
follow=True)
self.assertRedirects(response,
'%s?page=%d#post-%d' % (reverse('pybb:topic', kwargs={'pk': topic_1.id}), 1, post_1_1.id))
- response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_1.id }), data={'last-unread': 1},
+ response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_1.id }), data={'first-unread': 1},
follow=True)
self.assertRedirects(response,
'%s?page=%d#post-%d' % (reverse('pybb:topic', kwargs={'pk': topic_1.id}), 1, post_1_2.id))
- response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_2.id }), data={'last-unread': 1},
+ response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_2.id }), data={'first-unread': 1},
follow=True)
self.assertRedirects(response,
'%s?page=%d#post-%d' % (reverse('pybb:topic', kwargs={'pk': topic_2.id}), 1, post_2_1.id))
@@ -505,7 +505,7 @@ def test_open_last_unread_post(self):
post_1_3 = Post.objects.create(topic=topic_1, user=self.user, body='1_3')
post_1_4 = Post.objects.create(topic=topic_1, user=self.user, body='1_4')
- response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_1.id }), data={'last-unread': 1},
+ response = client_ann.get(reverse('pybb:topic', kwargs={'pk': topic_1.id }), data={'first-unread': 1},
follow=True)
self.assertRedirects(response,
'%s?page=%d#post-%d' % (reverse('pybb:topic', kwargs={'pk': topic_1.id}), 1, post_1_3.id))
View
10 pybb/views.py
@@ -149,7 +149,7 @@ def get_login_redirect_url(self):
def dispatch(self, request, *args, **kwargs):
self.topic = get_object_or_404(Topic.objects.select_related('forum'), pk=kwargs['pk'])
- if request.GET.get('last-unread'):
+ if request.GET.get('first-unread'):
if request.user.is_authenticated():
read_dates = []
try:
@@ -164,12 +164,12 @@ def dispatch(self, request, *args, **kwargs):
read_date = read_dates and max(read_dates)
if read_date:
try:
- last_unread_topic = self.topic.posts.filter(created__gt=read_date).order_by('created')[0]
+ first_unread_topic = self.topic.posts.filter(created__gt=read_date).order_by('created')[0]
except IndexError:
- last_unread_topic = self.topic.last_post
+ first_unread_topic = self.topic.last_post
else:
- last_unread_topic = self.topic.head
- return HttpResponseRedirect(reverse('pybb:post', kwargs={'pk': last_unread_topic.id}))
+ first_unread_topic = self.topic.head
+ return HttpResponseRedirect(reverse('pybb:post', kwargs={'pk': first_unread_topic.id}))
return super(TopicView, self).dispatch(request, *args, **kwargs)
Please sign in to comment.
Something went wrong with that request. Please try again.