if self.node.node_type == "answer":\r
self.node.question.reset_answer_count_cache()\r
\r
- # We should notify the current user that the node has been successfully deleted\r
- message = _("The <a href=\"%s\">%s</a> has been sucessfully deleted") % (self.node.get_absolute_url(), self.node.node_type)\r
- self.user.message_set.create(message=message)\r
-\r
def cancel_action(self):\r
self.node.mark_deleted(None)\r
\r
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
},\r
\r
mark_deleted: function(post_type, post_id) {\r
- if (post_type == 'answer') {\r
- var $answer = $('#answer-container-' + post_id);\r
- $answer.addClass('deleted');\r
- } else {\r
+ if (post_type == 'question') {\r
var $container = $('#question-table');\r
$container.addClass('deleted');\r
+ } else {\r
+ var $el = $('#' + post_type + '-container-' + post_id);\r
+ $el.addClass('deleted');\r
}\r
},\r
\r
max-width: 650px;
}
+blockquote blockquote {
+ margin: 0;
+ padding: 0;
+}
+
#wrapper, #announcement {
margin: auto;
padding: 0;
class="comment-edit" rel="nofollow"> </a>\r
<a id="comment-%ID%-delete" href="%DELETE_URL%"\r
class="ajax-command comment-delete confirm" rel="nofollow"> </a>\r
+ {% comment %}\r
<a rel="nofollow" id="comment-%ID%-convert" href="%CONVERT_URL%" title="{% trans "Convert comment to answer" %}"\r
- class="ajax-command comment-convert confirm" rel="nofollow"> </a>\r
+ class="ajax-command comment-convert confirm" rel="nofollow"> </a>{% endcomment %}\r
\r
<span class="comment-age">({% trans "just now" %})</span>\r
<a class="comment-user" href="%PROFILE_URL%">%USERNAME%</a>\r
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]))
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 "")
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 "")