##// END OF EJS Templates
Added ability to rollover thread
neko259 -
r2108:ed3f943b default
parent child Browse files
Show More
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -91,3 +91,7 b' msgstr "\xd0\x98\xd0\xb7\xd0\xbc\xd0\xb5\xd0\xbd\xd0\xb8\xd1\x82\xd1\x8c \xd1\x82\xd0\xb5\xd0\xbc\xd1\x83"'
91
91
92 msgid "Hide/show"
92 msgid "Hide/show"
93 msgstr "Скрыть/показать"
93 msgstr "Скрыть/показать"
94
95 msgid "Rollover thread"
96 msgstr "Перекатить тред"
97
1 NO CONTENT: modified file, binary diff hidden
NO CONTENT: modified file, binary diff hidden
@@ -91,3 +91,7 b' msgstr "\xd0\x97\xd0\xbc\xd1\x96\xd0\xbd\xd0\xb8\xd1\x82\xd0\xb8 \xd0\xbd\xd0\xb8\xd1\x82\xd0\xba\xd1\x83"'
91
91
92 msgid "Hide/show"
92 msgid "Hide/show"
93 msgstr "Приховати/відобразити"
93 msgstr "Приховати/відобразити"
94
95 msgid "Rollover thread"
96 msgstr "Перекотити нитку"
97
@@ -328,6 +328,15 b' function addContextMenu() {'
328 }
328 }
329 },
329 },
330 visible: hasIp && canDeletePost
330 visible: hasIp && canDeletePost
331 },
332 rollover: {
333 name: gettext('Rollover thread'),
334 callback: function(key, opt) {
335 if (confirm(gettext('Are you sure?'))) {
336 window.location = '/all/?t_from_id=' + postId + '#form';
337 }
338 },
339 visible: isOpening
331 }
340 }
332 }
341 }
333 };
342 };
@@ -57,9 +57,24 b' class AllThreadsView(BaseBoardView, Pagi'
57 SETTING_SUBSCRIBE_BY_DEFAULT, False)
57 SETTING_SUBSCRIBE_BY_DEFAULT, False)
58
58
59 if not form:
59 if not form:
60 form = ThreadForm(error_class=PlainErrorList,
60 t_from_id = request.GET.get('t_from_id')
61 initial={FORM_TAGS: self.tag_name,
61 if t_from_id:
62 'subscribe': subscribe_by_default})
62 source_op = Post.objects.get(id=int(t_from_id))
63 tags_str = ' '.join([tag.get_name() for tag in source_op.get_thread().get_tags()])
64 post_link = '[post]{}[/post]'.format(source_op.id) #FIXME To constants
65 new_title = source_op.get_title() + ' NEW' # TODO More intelligent name change
66
67 form = ThreadForm(error_class=PlainErrorList,
68 initial={
69 FORM_TAGS: tags_str,
70 'subscribe': subscribe_by_default,
71 FORM_TEXT: post_link,
72 FORM_TITLE: new_title,
73 })
74 else:
75 form = ThreadForm(error_class=PlainErrorList,
76 initial={FORM_TAGS: self.tag_name,
77 'subscribe': subscribe_by_default})
63
78
64 self.settings_manager = get_settings_manager(request)
79 self.settings_manager = get_settings_manager(request)
65
80
General Comments 0
You need to be logged in to leave comments. Login now