]> git.openstreetmap.org Git - osqa.git/commitdiff
check the setting before deciding whether to append or to prepend
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 24 Oct 2011 22:59:35 +0000 (22:59 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 24 Oct 2011 22:59:35 +0000 (22:59 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1195 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/js/osqa.main.js
forum/views/commands.py

index 17de7942e67d666488cf075db457c3dda5135154..89a59ef83cc45b892494ff4ea21d0cf2b57936c1 100644 (file)
@@ -104,7 +104,7 @@ var response_commands = {
         alert('ok');\r
     },\r
 \r
         alert('ok');\r
     },\r
 \r
-    insert_comment: function(post_id, comment_id, comment, username, profile_url, delete_url, edit_url, convert_url, can_convert) {\r
+    insert_comment: function(post_id, comment_id, comment, username, profile_url, delete_url, edit_url, convert_url, can_convert, show_latest_comments_first) {\r
         var $container = $('#comments-container-' + post_id);\r
         var skeleton = $('#new-comment-skeleton-' + post_id).html().toString();\r
 \r
         var $container = $('#comments-container-' + post_id);\r
         var skeleton = $('#new-comment-skeleton-' + post_id).html().toString();\r
 \r
@@ -115,8 +115,11 @@ var response_commands = {
                 .replace(new RegExp('%DELETE_URL%', 'g'), delete_url)\r
                 .replace(new RegExp('%EDIT_URL%', 'g'), edit_url)\r
                 .replace(new RegExp('%CONVERT_URL%', 'g'), convert_url);\r
                 .replace(new RegExp('%DELETE_URL%', 'g'), delete_url)\r
                 .replace(new RegExp('%EDIT_URL%', 'g'), edit_url)\r
                 .replace(new RegExp('%CONVERT_URL%', 'g'), convert_url);\r
-\r
-        $container.prepend(skeleton);\r
+        if (show_latest_comments_first) {\r
+            $container.prepend(skeleton);\r
+        } else {\r
+            $container.append(skeleton);\r
+        }\r
 \r
         // Show the convert comment to answer tool only if the current comment can be converted\r
         if (can_convert == true) {\r
 \r
         // Show the convert comment to answer tool only if the current comment can be converted\r
         if (can_convert == true) {\r
index 0e33552eeb22d9b663d1d9b6eb3f034ddc3ba46b..e909bdf2b95036baa98fe00390cf69066f3dd0d6 100644 (file)
@@ -284,6 +284,7 @@ def comment(request, id):
                 reverse('node_markdown', kwargs={'id': comment.id}),
                 reverse('convert_comment', kwargs={'id': comment.id}),
                 user.can_convert_comment_to_answer(comment),
                 reverse('node_markdown', kwargs={'id': comment.id}),
                 reverse('convert_comment', kwargs={'id': comment.id}),
                 user.can_convert_comment_to_answer(comment),
+                bool(settings.SHOW_LATEST_COMMENTS_FIRST)
                 ]
         }
         }
                 ]
         }
         }