# HG changeset patch # User neko259 # Date 2014-01-12 13:39:45 # Node ID 4f92838730ed9aa1d17651bbcdca19a097fd0c37 # Parent fab5a8599115f98aeee27869f69387c3823674e8 # Parent 866075aa84178ed67ce93c9e39cf728097e4a4df Merged in the 1.6 version diff --git a/boards/locale/ru/LC_MESSAGES/django.mo b/boards/locale/ru/LC_MESSAGES/django.mo index 581fb0b4d5ed3d4e34b2683cdb67ec318cbd4493..a648ed72c3daca71ac2ce4b53160a0d43a9e61db GIT binary patch literal 5983 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 w<#@4rE\n" "Language-Team: LANGUAGE \n" @@ -74,8 +74,7 @@ msgstr "Текст или картинка должны быть введены." msgid "Wait %s seconds after last posting" msgstr "Подождите %s секунд после последнего постинга" -#: forms.py:163 templates/boards/post.html:61 templates/boards/tags.html:6 -#: templates/boards/rss/post.html:10 +#: forms.py:163 templates/boards/tags.html:6 templates/boards/rss/post.html:10 msgid "Tags" msgstr "Теги" @@ -112,6 +111,52 @@ msgstr "Не найдено" msgid "This page does not exist" msgstr "Этой страницы не существует" +#: templates/boards/archive.html:45 templates/boards/posting_general.html:64 +msgid "Previous page" +msgstr "Предыдущая страница" + +#: templates/boards/archive.html:75 +msgid "Open" +msgstr "Открыть" + +#: templates/boards/archive.html:81 templates/boards/post.html:37 +#: templates/boards/posting_general.html:103 templates/boards/thread.html:69 +msgid "Delete" +msgstr "Удалить" + +#: templates/boards/archive.html:85 templates/boards/post.html:40 +#: templates/boards/posting_general.html:107 templates/boards/thread.html:72 +msgid "Ban IP" +msgstr "Заблокировать IP" + +#: templates/boards/archive.html:94 templates/boards/post.html:53 +#: templates/boards/posting_general.html:116 +#: templates/boards/posting_general.html:180 templates/boards/thread.html:81 +msgid "Replies" +msgstr "Ответы" + +#: templates/boards/archive.html:103 templates/boards/posting_general.html:125 +#: templates/boards/thread.html:138 templates/boards/thread_gallery.html:58 +msgid "images" +msgstr "изображений" + +#: templates/boards/archive.html:104 templates/boards/thread.html:137 +#: templates/boards/thread_gallery.html:57 +msgid "replies" +msgstr "ответов" + +#: templates/boards/archive.html:129 templates/boards/posting_general.html:203 +msgid "Next page" +msgstr "Следующая страница" + +#: templates/boards/archive.html:134 templates/boards/posting_general.html:208 +msgid "No threads exist. Create the first one!" +msgstr "Нет тем. Создайте первую!" + +#: templates/boards/archive.html:143 templates/boards/posting_general.html:235 +msgid "Pages:" +msgstr "Страницы: " + #: templates/boards/authors.html:6 templates/boards/authors.html.py:12 msgid "Authors" msgstr "Авторы" @@ -149,12 +194,16 @@ msgstr "Настройки" msgid "Login" msgstr "Вход" -#: templates/boards/base.html:52 +#: templates/boards/base.html:51 +msgid "Archive" +msgstr "Архив" + +#: templates/boards/base.html:53 #, python-format msgid "Speed: %(ppd)s posts per day" msgstr "Скорость: %(ppd)s сообщений в день" -#: templates/boards/base.html:54 +#: templates/boards/base.html:55 msgid "Up" msgstr "Вверх" @@ -166,52 +215,20 @@ msgstr "ID пользователя" msgid "Insert your user id above" msgstr "Вставьте свой ID пользователя выше" -#: templates/boards/post.html:35 templates/boards/posting_general.html:103 -#: templates/boards/thread.html:68 -msgid "Delete" -msgstr "Удалить" - -#: templates/boards/post.html:38 templates/boards/posting_general.html:107 -#: templates/boards/thread.html:71 -msgid "Ban IP" -msgstr "Заблокировать IP" - -#: templates/boards/post.html:51 templates/boards/posting_general.html:116 -#: templates/boards/posting_general.html:180 templates/boards/thread.html:80 -msgid "Replies" -msgstr "Ответы" - -#: templates/boards/posting_general.html:64 -msgid "Previous page" -msgstr "Предыдущая страница" - #: templates/boards/posting_general.html:97 msgid "Reply" msgstr "Ответ" -#: templates/boards/posting_general.html:125 templates/boards/thread.html:130 -#: templates/boards/thread_gallery.html:52 -msgid "images" -msgstr "изображений" - #: templates/boards/posting_general.html:142 #, python-format msgid "Skipped %(count)s replies. Open thread to see all replies." msgstr "Пропущено %(count)s ответов. Откройте тред, чтобы увидеть все ответы." -#: templates/boards/posting_general.html:203 -msgid "Next page" -msgstr "Следующая страница" - -#: templates/boards/posting_general.html:208 -msgid "No threads exist. Create the first one!" -msgstr "Нет тем. Создайте первую!" - #: templates/boards/posting_general.html:214 msgid "Create new thread" msgstr "Создать новую тему" -#: templates/boards/posting_general.html:218 templates/boards/thread.html:112 +#: templates/boards/posting_general.html:218 templates/boards/thread.html:115 msgid "Post" msgstr "Отправить" @@ -220,14 +237,10 @@ msgid "Tags must be delimited by spaces. msgstr "" "Теги должны быть разделены пробелами. Текст или изображение обязательны." -#: templates/boards/posting_general.html:225 templates/boards/thread.html:116 +#: templates/boards/posting_general.html:225 templates/boards/thread.html:119 msgid "Text syntax" msgstr "Синтаксис текста" -#: templates/boards/posting_general.html:235 -msgid "Pages:" -msgstr "Страницы: " - #: templates/boards/settings.html:14 msgid "User:" msgstr "Пользователь:" @@ -260,27 +273,23 @@ msgstr "тем" msgid "No tags found." msgstr "Теги не найдены." -#: templates/boards/thread.html:22 templates/boards/thread_gallery.html:20 +#: templates/boards/thread.html:19 templates/boards/thread_gallery.html:20 msgid "Normal mode" msgstr "Нормальный режим" -#: templates/boards/thread.html:23 templates/boards/thread_gallery.html:21 +#: templates/boards/thread.html:20 templates/boards/thread_gallery.html:21 msgid "Gallery mode" msgstr "Режим галереи" -#: templates/boards/thread.html:31 +#: templates/boards/thread.html:28 msgid "posts to bumplimit" msgstr "сообщений до бамплимита" -#: templates/boards/thread.html:106 +#: templates/boards/thread.html:109 msgid "Reply to thread" msgstr "Ответить в тему" -#: templates/boards/thread.html:129 templates/boards/thread_gallery.html:51 -msgid "replies" -msgstr "ответов" - -#: templates/boards/thread.html:131 templates/boards/thread_gallery.html:53 +#: templates/boards/thread.html:139 templates/boards/thread_gallery.html:59 msgid "Last update: " msgstr "Последнее обновление: " diff --git a/boards/mdx_neboard.py b/boards/mdx_neboard.py --- a/boards/mdx_neboard.py +++ b/boards/mdx_neboard.py @@ -10,7 +10,7 @@ import boards AUTOLINK_PATTERN = r'(https?://\S+)' QUOTE_PATTERN = r'^(?)(>[^>].+)$' REFLINK_PATTERN = r'((>>)(\d+))' -SPOILER_PATTERN = r'%%(.+)%%' +SPOILER_PATTERN = r'%%([^(%%)]+)%%' COMMENT_PATTERN = r'^(//(.+))' STRIKETHROUGH_PATTERN = r'~(.+)~' diff --git a/boards/migrations/0018_auto__add_field_thread_archived.py b/boards/migrations/0018_auto__add_field_thread_archived.py new file mode 100644 --- /dev/null +++ b/boards/migrations/0018_auto__add_field_thread_archived.py @@ -0,0 +1,85 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'Thread.archived' + db.add_column(u'boards_thread', 'archived', + self.gf('django.db.models.fields.BooleanField')(default=0), + keep_default=False) + + + def backwards(self, orm): + # Deleting field 'Thread.archived' + db.delete_column(u'boards_thread', 'archived') + + + models = { + 'boards.ban': { + 'Meta': {'object_name': 'Ban'}, + 'can_read': ('django.db.models.fields.BooleanField', [], {'default': 'True'}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), + 'reason': ('django.db.models.fields.CharField', [], {'default': "'Auto'", 'max_length': '200'}) + }, + 'boards.post': { + 'Meta': {'object_name': 'Post'}, + '_text_rendered': ('django.db.models.fields.TextField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'image': ('boards.thumbs.ImageWithThumbsField', [], {'max_length': '100', 'blank': 'True'}), + 'image_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'image_pre_height': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'image_pre_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'image_width': ('django.db.models.fields.IntegerField', [], {'default': '0'}), + 'last_edit_time': ('django.db.models.fields.DateTimeField', [], {}), + 'poster_ip': ('django.db.models.fields.GenericIPAddressField', [], {'max_length': '39'}), + 'poster_user_agent': ('django.db.models.fields.TextField', [], {}), + 'pub_time': ('django.db.models.fields.DateTimeField', [], {}), + 'referenced_posts': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'rfp+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), + 'text': ('markupfield.fields.MarkupField', [], {'rendered_field': 'True'}), + 'text_markup_type': ('django.db.models.fields.CharField', [], {'default': "'markdown'", 'max_length': '30'}), + 'thread': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['boards.Post']", 'null': 'True'}), + 'thread_new': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['boards.Thread']", 'null': 'True'}), + 'title': ('django.db.models.fields.CharField', [], {'max_length': '50'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'default': 'None', 'to': "orm['boards.User']", 'null': 'True'}) + }, + 'boards.setting': { + 'Meta': {'object_name': 'Setting'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}), + 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['boards.User']"}), + 'value': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'boards.tag': { + 'Meta': {'object_name': 'Tag'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'linked': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['boards.Tag']", 'null': 'True', 'blank': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'tag+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Thread']"}) + }, + 'boards.thread': { + 'Meta': {'object_name': 'Thread'}, + 'archived': ('django.db.models.fields.BooleanField', [], {'default': 'False'}), + 'bump_time': ('django.db.models.fields.DateTimeField', [], {}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'last_edit_time': ('django.db.models.fields.DateTimeField', [], {}), + 'replies': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'tre+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), + 'tags': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['boards.Tag']", 'symmetrical': 'False'}) + }, + 'boards.user': { + 'Meta': {'object_name': 'User'}, + 'fav_tags': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['boards.Tag']", 'null': 'True', 'blank': 'True'}), + 'fav_threads': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'+'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['boards.Post']"}), + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'rank': ('django.db.models.fields.IntegerField', [], {}), + 'registration_time': ('django.db.models.fields.DateTimeField', [], {}), + 'user_id': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + } + } + + complete_apps = ['boards'] \ No newline at end of file diff --git a/boards/models/post.py b/boards/models/post.py --- a/boards/models/post.py +++ b/boards/models/post.py @@ -6,6 +6,7 @@ import time import math import re from django.core.cache import cache +from django.core.paginator import Paginator from django.db import models from django.http import Http404 @@ -15,6 +16,8 @@ from markupfield.fields import MarkupFie from neboard import settings from boards import thumbs +MAX_TITLE_LENGTH = 50 + APP_LABEL_BOARDS = 'boards' CACHE_KEY_PPD = 'ppd' @@ -64,7 +67,8 @@ class PostManager(models.Manager): thread_new=thread, image=image, poster_ip=ip, - poster_user_agent=UNKNOWN_UA, # TODO Get UA at last! + poster_user_agent=UNKNOWN_UA, # TODO Get UA at + # last! last_edit_time=posting_time, user=user) @@ -111,7 +115,7 @@ class PostManager(models.Manager): # TODO Move this method to thread manager def get_threads(self, tag=None, page=ALL_PAGES, - order_by='-bump_time'): + order_by='-bump_time', archived=False): if tag: threads = tag.threads @@ -120,39 +124,21 @@ class PostManager(models.Manager): else: threads = Thread.objects.all() - threads = threads.order_by(order_by) + threads = threads.filter(archived=archived).order_by(order_by) if page != ALL_PAGES: - thread_count = threads.count() - - if page < self._get_page_count(thread_count): - start_thread = page * settings.THREADS_PER_PAGE - end_thread = min(start_thread + settings.THREADS_PER_PAGE, - thread_count) - threads = threads[start_thread:end_thread] + threads = Paginator(threads, settings.THREADS_PER_PAGE).page( + page).object_list return threads # TODO Move this method to thread manager - def get_thread_page_count(self, tag=None): - if tag: - threads = Thread.objects.filter(tags=tag) - else: - threads = Thread.objects.all() - - return self._get_page_count(threads.count()) - - # TODO Move this method to thread manager def _delete_old_threads(self): """ Preserves maximum thread count. If there are too many threads, - delete the old ones. + archive the old ones. """ - # TODO Move old threads to the archive instead of deleting them. - # Maybe make some 'old' field in the model to indicate the thread - # must not be shown and be able for replying. - threads = self.get_threads() thread_count = threads.count() @@ -160,7 +146,10 @@ class PostManager(models.Manager): num_threads_to_delete = thread_count - settings.MAX_THREAD_COUNT old_threads = threads[thread_count - num_threads_to_delete:] - map(Thread.delete_with_posts, old_threads) + for thread in old_threads: + thread.archived = True + thread.last_edit_time = timezone.now() + thread.save() def connect_replies(self, post): """ @@ -176,13 +165,6 @@ class PostManager(models.Manager): referenced_post.last_edit_time = post.pub_time referenced_post.save() - def _get_page_count(self, thread_count): - """ - Get number of pages that will be needed for all threads - """ - - return int(math.ceil(thread_count / float(settings.THREADS_PER_PAGE))) - def get_posts_per_day(self): """ Get average count of posts per day for the last 7 days @@ -270,7 +252,7 @@ class Post(models.Model): def get_title(self): title = self.title if len(title) == 0: - title = self.text.raw[:20] + title = self.text.rendered[:MAX_TITLE_LENGTH] return title @@ -294,6 +276,7 @@ class Thread(models.Model): last_edit_time = models.DateTimeField() replies = models.ManyToManyField('Post', symmetrical=False, null=True, blank=True, related_name='tre+') + archived = models.BooleanField(default=False) def get_tags(self): """ @@ -321,6 +304,9 @@ class Thread(models.Model): Check if the thread can be bumped by replying """ + if self.archived: + return False + post_count = self.get_reply_count() return post_count < settings.MAX_POSTS_PER_THREAD diff --git a/boards/models/tag.py b/boards/models/tag.py --- a/boards/models/tag.py +++ b/boards/models/tag.py @@ -6,7 +6,10 @@ from django.db.models import Count TAG_FONT_MULTIPLIER = 0.1 MAX_TAG_FONT = 10 -OPENING_POST_POPULARITY_WEIGHT = 2 + +OPENING_POST_POPULARITY = 0.5 +ARCHIVE_POPULARITY = 0.01 +REPLY_POPULARITY = 0.1 class TagManager(models.Manager): @@ -43,15 +46,19 @@ class Tag(models.Model): def get_post_count(self): return self.threads.count() - # TODO Reenable this method after migration - # def get_popularity(self): - # posts_with_tag = Thread.objects.get_threads(tag=self) - # reply_count = 0 - # for post in posts_with_tag: - # reply_count += post.get_reply_count() - # reply_count += OPENING_POST_POPULARITY_WEIGHT - # - # return reply_count + def get_popularity(self): + popularity = 0.0 + + for thread in self.threads.all(): + reply_count = thread.get_reply_count() + + if thread.archived: + popularity += ARCHIVE_POPULARITY * reply_count + else: + popularity += REPLY_POPULARITY * reply_count + popularity += OPENING_POST_POPULARITY + + return popularity def get_linked_tags(self): tag_list = [] @@ -75,10 +82,10 @@ class Tag(models.Model): def get_font_value(self): """Get tag font value to differ most popular tags in the list""" - post_count = self.get_post_count() - if post_count > MAX_TAG_FONT: - post_count = MAX_TAG_FONT + popularity = self.get_popularity() + if popularity > MAX_TAG_FONT: + popularity = MAX_TAG_FONT - font_value = str(1 + (post_count - 1) * TAG_FONT_MULTIPLIER) + font_value = str(1 + (popularity - 1) * TAG_FONT_MULTIPLIER) - return font_value \ No newline at end of file + return font_value diff --git a/boards/static/css/md/base_page.css b/boards/static/css/md/base_page.css --- a/boards/static/css/md/base_page.css +++ b/boards/static/css/md/base_page.css @@ -43,7 +43,7 @@ html { color: #fff380; } -.post, .dead_post, #posts-table { +.post, .dead_post, .archive_post, #posts-table { background: #333; margin: 5px; padding: 10px; @@ -191,6 +191,10 @@ blockquote { background-color: #442222; } +.archive_post { + background-color: #000; +} + .mark_btn { border: 1px solid; min-width: 2ex; @@ -381,3 +385,16 @@ code { pre { overflow: auto; } + +.img-full { + background: #222; + border: solid 1px white; +} + +.tag_item { + display: inline-block; + background: #555; + border: 1px solid #ccc; + margin: 0.3ex; + padding: 0.2ex; +} diff --git a/boards/static/css/pg/base_page.css b/boards/static/css/pg/base_page.css --- a/boards/static/css/pg/base_page.css +++ b/boards/static/css/pg/base_page.css @@ -344,4 +344,11 @@ input[type="submit"]:hover { .current_page, .current_mode { border: solid 1px #000; padding: 2px; -} \ No newline at end of file +} + +.tag_item { + display: inline-block; + border: 1px solid #ccc; + margin: 0.3ex; + padding: 0.2ex; +} diff --git a/boards/templates/boards/posting_general.html b/boards/templates/boards/archive.html copy from boards/templates/boards/posting_general.html copy to boards/templates/boards/archive.html --- a/boards/templates/boards/posting_general.html +++ b/boards/templates/boards/archive.html @@ -6,27 +6,23 @@ {% load static %} {% block head %} - {% if tag %} - Neboard - {{ tag.name }} - {% else %} - Neboard - {% endif %} +Neboard - {% trans 'Archive' %} - {% if prev_page %} - {% endif %} - {% if next_page %} + {% if current_page.has_next %} {% endif %} @@ -37,42 +33,17 @@ {% get_current_language as LANGUAGE_CODE %} -{% if tag %} -
-

- {% if tag in user.fav_tags.all %} - - {% else %} - - {% endif %} - #{{ tag.name }} -

-
-{% endif %} - {% if threads %} - {% if prev_page %} + {% if current_page.has_previous %} {% endif %} {% for thread in threads %} {% cache 600 thread_short thread.id thread.thread.last_edit_time moderator LANGUAGE_CODE %}
- {% if thread.bumpable %} -
- {% else %} -
- {% endif %} +
{% if thread.op.image %}
{{ thread.op.title }} ({{ thread.op.id }}) - [{{ thread.op.pub_time }}] + [{{ thread.op.pub_time }}] — [{{ thread.thread.last_edit_time }}] + [{% trans "Reply" %}] + {% url 'thread' thread.op.id %}">{% trans "Open" %}] {% if moderator %} @@ -122,7 +93,8 @@ {% endif %}
- {% if thread.last_replies.exists %} - {% if thread.skipped_replies %} - - {% endif %} -
- {% for post in thread.last_replies %} - {% if thread.bumpable %} -
- {% else %} -
- {% endif %} - {% if post.image %} -
- {{ post.id }} - -
- {% endif %} -
- - {% autoescape off %} - {{ post.text.rendered|truncatewords_html:50 }} - {% endautoescape %} -
- {% if post.is_referenced %} -
- {% trans "Replies" %}: - {% for ref_post in post.get_sorted_referenced_posts %} - >>{{ ref_post.id }}{% if not forloop.last %},{% endif %} - {% endfor %} -
- {% endif %} -
- {% endfor %} -
- {% endif %}
{% endcache %} {% endfor %} - {% if next_page %} + {% if current_page.has_next %} {% endif %} {% else %} @@ -208,42 +121,20 @@ {% trans 'No threads exist. Create the first one!' %}
{% endif %} -
- -
-
{% trans "Create new thread" %}
-
{% csrf_token %} - {{ form.as_div }} -
- -
-
-
- {% trans 'Tags must be delimited by spaces. Text or image is required.' %} -
- -
-
- {% endblock %} {% block metapanel %} - Neboard 1.5 Aker + Neboard 1.6 Amon {% trans "Pages:" %}[ - {% for page in pages %} + {% for page in paginator.page_range %} {{ page }} {% if not forloop.last %},{% endif %} {% endfor %} diff --git a/boards/templates/boards/base.html b/boards/templates/boards/base.html --- a/boards/templates/boards/base.html +++ b/boards/templates/boards/base.html @@ -48,6 +48,7 @@