]> git.openstreetmap.org Git - osqa.git/commitdiff
merging cacheimp -> trunk
authorhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 5 Apr 2011 15:47:25 +0000 (15:47 +0000)
committerhernani <hernani@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Tue, 5 Apr 2011 15:47:25 +0000 (15:47 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@932 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/actions/meta.py
forum/models/user.py
forum/skins/default/media/js/osqa.main.js
forum/skins/default/media/style/style.css
forum/skins/default/templates/node/comments.html
forum_modules/exporter/exporter.py

index e966e55034598831da35914c4c50410c11750309..a964ef1db289ca0ec9171441046434c2d8f75c98 100644 (file)
@@ -182,10 +182,6 @@ class DeleteAction(ActionProxy):
         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
index d3b2c6f0042cf70206929b25cd2597cad20a787a..699c7bc5ed015531bf77630f6381d01be8580a6d 100644 (file)
@@ -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
index 0cf354ff19df9bf0142047a11260dc439466753c..49fedda89dd8f9a23ac449b9353cb3f0f1d0a893 100644 (file)
@@ -100,12 +100,12 @@ var response_commands = {
     },\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
index 66da39083fe0955a530e826589f7ddaee4139d1c..deab17b9d6391fddead7b5639be57d1c5bd7b5a4 100644 (file)
@@ -149,6 +149,11 @@ blockquote {
     max-width: 650px;
 }
 
+blockquote blockquote {
+    margin: 0;
+    padding: 0;
+}
+
 #wrapper, #announcement {
     margin: auto;
     padding: 0;
index 044a1a37d423ce34b280ae0ab4d855b7af7b123f..f466cbf516463f597733fad8bad4613d31f8c9b1 100644 (file)
@@ -69,8 +69,9 @@
                         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
index 2db3ca232a71e3cc2c641b015dbffaaf7c1fb439..8907112bd0fdf72eb6d2f43488d147f0aba0ebda 100644 (file)
@@ -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 "")