+ }\r
+\r
+class AnswerToCommentAction(ActionProxy):\r
+ verb = _("converted")\r
+\r
+ def process_data(self, new_parent=None):\r
+ self.node.parent = new_parent\r
+ self.node.node_type = "comment"\r
+\r
+ for comment in self.node.comments.all():\r
+ comment.parent = new_parent\r
+ comment.save()\r
+\r
+ self.node.last_edited = self\r
+ self.node.update_last_activity(self.user, save=True)\r
+ try:\r
+ self.node.abs_parent.reset_answer_count_cache()\r
+ except AttributeError:\r
+ pass\r
+\r
+ def describe(self, viewer=None):\r
+ return _("%(user)s converted an answer to %(question)s into a comment") % {\r
+ 'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)),\r
+ 'question': self.describe_node(viewer, self.node.abs_parent),\r
+ }\r
+\r
+class WikifyAction(ActionProxy):\r
+ verb = _("wikified")\r
+\r
+ def process_action(self):\r
+ self.node.nstate.wiki = self\r
+ self.node.last_edited = self\r
+ self.node.update_last_activity(self.user, save=True)\r
+\r
+ def cancel_action(self):\r
+ self.node.nstate.wiki = None\r
+ self.node.update_last_activity(self.user, save=True)\r
+\r
+ def describe(self, viewer=None):\r
+ return _("%(user)s marked %(node)s as community wiki.") % {\r
+ 'user': self.hyperlink(self.user.get_profile_url(), self.friendly_username(viewer, self.user)),\r
+ 'node': self.describe_node(viewer, self.node),\r
+ }\r
+\r