From: hernani Date: Tue, 5 Apr 2011 15:47:25 +0000 (+0000) Subject: merging cacheimp -> trunk X-Git-Tag: live~378 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/b00a18907b95d74b040d7950bd18d2b2a7709cb1 merging cacheimp -> trunk git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@932 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/actions/meta.py b/forum/actions/meta.py index e966e55..a964ef1 100644 --- a/forum/actions/meta.py +++ b/forum/actions/meta.py @@ -182,10 +182,6 @@ class DeleteAction(ActionProxy): if self.node.node_type == "answer": self.node.question.reset_answer_count_cache() - # We should notify the current user that the node has been successfully deleted - message = _("The %s has been sucessfully deleted") % (self.node.get_absolute_url(), self.node.node_type) - self.user.message_set.create(message=message) - def cancel_action(self): self.node.mark_deleted(None) diff --git a/forum/models/user.py b/forum/models/user.py index d3b2c6f..699c7bc 100644 --- a/forum/models/user.py +++ b/forum/models/user.py @@ -282,9 +282,9 @@ class User(BaseModel, DjangoUser): def can_delete_comment(self, comment): return self == comment.author or self.reputation >= int(settings.REP_TO_DELETE_COMMENTS) - @true_if_is_super_or_staff def can_convert_comment_to_answer(self, comment): - return self == comment.author or self.reputation >= int(settings.REP_TO_CONVERT_COMMENTS_TO_ANSWERS) + return (comment.parent.node_type in ('question', 'answer')) and (self.is_superuser or self.is_staff or ( + self == comment.author) or (self.reputation >= int(settings.REP_TO_CONVERT_COMMENTS_TO_ANSWERS))) def can_convert_to_comment(self, answer): return (not answer.marked) and (self.is_superuser or self.is_staff or answer.author == self or self.reputation >= int diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index 0cf354f..49fedda 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -100,12 +100,12 @@ var response_commands = { }, mark_deleted: function(post_type, post_id) { - if (post_type == 'answer') { - var $answer = $('#answer-container-' + post_id); - $answer.addClass('deleted'); - } else { + if (post_type == 'question') { var $container = $('#question-table'); $container.addClass('deleted'); + } else { + var $el = $('#' + post_type + '-container-' + post_id); + $el.addClass('deleted'); } }, diff --git a/forum/skins/default/media/style/style.css b/forum/skins/default/media/style/style.css index 66da390..deab17b 100644 --- a/forum/skins/default/media/style/style.css +++ b/forum/skins/default/media/style/style.css @@ -149,6 +149,11 @@ blockquote { max-width: 650px; } +blockquote blockquote { + margin: 0; + padding: 0; +} + #wrapper, #announcement { margin: auto; padding: 0; diff --git a/forum/skins/default/templates/node/comments.html b/forum/skins/default/templates/node/comments.html index 044a1a3..f466cbf 100644 --- a/forum/skins/default/templates/node/comments.html +++ b/forum/skins/default/templates/node/comments.html @@ -69,8 +69,9 @@ class="comment-edit" rel="nofollow"> + {% comment %} + class="ajax-command comment-convert confirm" rel="nofollow"> {% endcomment %} ({% trans "just now" %}) %USERNAME% diff --git a/forum_modules/exporter/exporter.py b/forum_modules/exporter/exporter.py index 2db3ca2..8907112 100644 --- a/forum_modules/exporter/exporter.py +++ b/forum_modules/exporter/exporter.py @@ -94,9 +94,9 @@ def ET_Element_add_tag(el, tag_name, content = None, **attrs): try: tag.text = unicode(content) except Exception, e: - logging.error('error converting unicode characters') - import traceback - logging.error(traceback.print_exc()) + #logging.error('error converting unicode characters') + #import traceback + #logging.error(traceback.print_exc()) import string tag.text = unicode("".join([c for c in content if c in string.printable])) @@ -415,7 +415,7 @@ def export_nodes(n, el, anon_data): el.add('author', n.author.id) el.add('date', make_date(n.added_at)) el.add('parent', n.parent and n.parent.id or "") - el.add('absparent', n.abs_parent and n.abs_parent or "") + el.add('absparent', n.abs_parent and n.abs_parent.id or "") act = el.add('lastactivity') act.add('by', n.last_activity_by and n.last_activity_by.id or "") @@ -451,6 +451,7 @@ def export_nodes(n, el, anon_data): rev.add('tags', ", ".join(r.tagname_list())) el.add('marked', n.marked and 'true' or 'false') + el.add('wiki', n.nis.wiki and 'true' or 'false') el.add('extraRef', n.extra_ref and n.extra_ref.id or "") make_extra(el.add('extraData'), n.extra) el.add('extraCount', n.extra_count and n.extra_count or "")