]> git.openstreetmap.org Git - osqa.git/commitdiff
change the order in which comments are ordered
authorjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 24 Oct 2011 21:29:48 +0000 (21:29 +0000)
committerjordan <jordan@0cfe37f9-358a-4d5e-be75-b63607b5c754>
Mon, 24 Oct 2011 21:29:48 +0000 (21:29 +0000)
git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1192 0cfe37f9-358a-4d5e-be75-b63607b5c754

forum/skins/default/media/js/osqa.main.js
forum/skins/default/media/style/style.css
forum/skins/default/templates/node/comments.html
forum/templatetags/node_tags.py

index 8fb4d6369347b49a0e36b60f4eb9e17d15eeb259..17de7942e67d666488cf075db457c3dda5135154 100644 (file)
@@ -116,7 +116,7 @@ var response_commands = {
                 .replace(new RegExp('%EDIT_URL%', 'g'), edit_url)\r
                 .replace(new RegExp('%CONVERT_URL%', 'g'), convert_url);\r
 \r
-        $container.append(skeleton);\r
+        $container.prepend(skeleton);\r
 \r
         // Show the convert comment to answer tool only if the current comment can be converted\r
         if (can_convert == true) {\r
index d08be7202890bb9376e57026e948ff72c60f8132..58bc23aa3374bf51a740db1db03fda7cd70c5e8c 100644 (file)
@@ -1600,6 +1600,7 @@ img.subscription-remove {
 .comment-form-container {
     display: none;
     padding-top: 12px;
+    margin-bottom: 8px;
 }
 
 .comment-form-widgets-container input {
@@ -1623,6 +1624,15 @@ div.comment-tools {
     text-align: right;
 }
 
+div.comment-tools span.comment-tools-separator {
+    float: left;
+    display: block;
+    line-height: 17px;
+    color: #ccc;
+    font-size: 15px;
+    margin-left: 1px;
+}
+
 div.comment-tools .comments-showing {
     color: #777777;
     font-size: 11px;
index 41a97aa822e77d88d1296ede2eb213e4467ced8c..68ebde25aa8251f99f0303e17940bc1f26aa096a 100644 (file)
@@ -1,52 +1,7 @@
 {% load extra_tags %}\r
 {% load i18n %}\r
 \r
-<div class="comments-container" id="comments-container-{{ post.id }}">\r
-    {% for comment in comments %}\r
-        <a name="{{ comment.id }}"></a>\r
-        <div class="comment{% if not comment.top_scorer %} not_top_scorer{% endif %}" id="comment-{{comment.id}}">\r
-            <div id="post-{{ comment.id }}-score" class="comment-score">{% if comment.score %}{{ comment.score }}{% endif %}</div>\r
-            <div class="comment-text">{{ comment.comment }}</div>\r
-            <div class="comment-info" id="comment-{{comment.id}}-info">\r
-                {% if comment.can_like %}\r
-                    <a id="post-{{ comment.id }}-upvote" href="{% url like_comment id=comment.id %}"\r
-                     title="{% trans "I like this comment (click again to cancel)" %}" class="ajax-command comment-like{% if comment.likes %} on{% endif %}"\r
-                    rel="nofollow"> </a>\r
-                {% endif %}\r
-                {% if comment.can_edit %}\r
-                    <a id="comment-{{ comment.id }}-edit" href="{% url node_markdown id=comment.id %}" title="{% trans "Edit comment" %}"\r
-                        class="comment-edit" rel="nofollow"> </a>\r
-                {% endif %}\r
-                {% if comment.can_delete %}\r
-                    <a id="comment-{{ comment.id }}-delete" href="{% url delete_comment id=comment.id %}" title="{% trans "Delete comment" %}"\r
-                        class="ajax-command comment-delete confirm" rel="nofollow"> </a>\r
-                {% endif %}\r
-                {% if comment.can_convert %}\r
-                    <a rel="nofollow" id="comment-{{ comment.id }}-convert" href="{% url convert_comment id=comment.id %}" title="{% trans "Convert comment to answer" %}"\r
-                        class="ajax-command comment-convert confirm" rel="nofollow"> </a>\r
-                    <a rel="nofollow" id="comment-{{ comment.id }}-convert-to-question" href="{% url convert_to_question id=comment.id %}?node_type=comment" title="{% trans "Convert comment to question" %}"\r
-                        class="comment-convert-to-question" rel="nofollow"> </a>\r
-                {% endif %}\r
-                    \r
-\r
-                <span class="comment-age">({% diff_date comment.added_at %})</span>\r
-                <a class="comment-user userinfo" href="{{comment.user.get_profile_url}}">{{comment.user.decorated_name}}</a>\r
-                {% if show_gravatar %}{% gravatar comment.user 18 %}{% endif %}\r
-            </div>\r
-        </div>\r
-    {% endfor %}\r
-</div>\r
-<div id="comment-tools-{{ post.id }}" class="comment-tools">\r
-    {% ifnotequal showing total %}\r
-        <span class="comments-showing">\r
-            {% blocktrans %}showing {{ showing }} of {{ total }}{% endblocktrans %}\r
-        </span>\r
-        <a href="#" class="show-all-comments-link">{% trans "show all" %}</a>\r
-    {% endifnotequal %}\r
-    {% if can_comment %}\r
-        <a href="#" class="add-comment-link">{% trans "add new comment" %}</a>\r
-    {% endif %}\r
-</div>\r
+<div class="clear"></div>\r
 <div id="comment-{{ post.id }}-form-container" class="comment-form-container">\r
     {% if can_comment %}\r
     <form id="comment-{{ post.id }}-form" method="post" action="{% url comment id=post.id %}" accept-charset="utf-8">\r
     </form>\r
     {% endif %}\r
 </div>\r
-    \r
+<div class="clear"></div>\r
+\r
+<div class="comments-container" id="comments-container-{{ post.id }}">\r
+    {% for comment in comments %}\r
+        <a name="{{ comment.id }}"></a>\r
+        <div class="comment{% if not comment.top_scorer %} not_top_scorer{% endif %}" id="comment-{{comment.id}}">\r
+            <div id="post-{{ comment.id }}-score" class="comment-score">{% if comment.score %}{{ comment.score }}{% endif %}</div>\r
+            <div class="comment-text">{{ comment.comment }}</div>\r
+            <div class="comment-info" id="comment-{{comment.id}}-info">\r
+                {% if comment.can_like %}\r
+                    <a id="post-{{ comment.id }}-upvote" href="{% url like_comment id=comment.id %}"\r
+                     title="{% trans "I like this comment (click again to cancel)" %}" class="ajax-command comment-like{% if comment.likes %} on{% endif %}"\r
+                    rel="nofollow"> </a>\r
+                {% endif %}\r
+                {% if comment.can_edit %}\r
+                    <a id="comment-{{ comment.id }}-edit" href="{% url node_markdown id=comment.id %}" title="{% trans "Edit comment" %}"\r
+                        class="comment-edit" rel="nofollow"> </a>\r
+                {% endif %}\r
+                {% if comment.can_delete %}\r
+                    <a id="comment-{{ comment.id }}-delete" href="{% url delete_comment id=comment.id %}" title="{% trans "Delete comment" %}"\r
+                        class="ajax-command comment-delete confirm" rel="nofollow"> </a>\r
+                {% endif %}\r
+                {% if comment.can_convert %}\r
+                    <a rel="nofollow" id="comment-{{ comment.id }}-convert" href="{% url convert_comment id=comment.id %}" title="{% trans "Convert comment to answer" %}"\r
+                        class="ajax-command comment-convert confirm" rel="nofollow"> </a>\r
+                    <a rel="nofollow" id="comment-{{ comment.id }}-convert-to-question" href="{% url convert_to_question id=comment.id %}?node_type=comment" title="{% trans "Convert comment to question" %}"\r
+                        class="comment-convert-to-question" rel="nofollow"> </a>\r
+                {% endif %}\r
+                    \r
+\r
+                <span class="comment-age">({% diff_date comment.added_at %})</span>\r
+                <a class="comment-user userinfo" href="{{comment.user.get_profile_url}}">{{comment.user.decorated_name}}</a>\r
+                {% if show_gravatar %}{% gravatar comment.user 18 %}{% endif %}\r
+            </div>\r
+        </div>\r
+    {% endfor %}\r
+</div>\r
+<div id="comment-tools-{{ post.id }}" class="comment-tools">\r
+    {% ifnotequal showing total %}\r
+        <span class="comments-showing">\r
+            {% blocktrans %}showing {{ showing }} of {{ total }}{% endblocktrans %}\r
+        </span>\r
+        <a href="#" class="show-all-comments-link">{% trans "show all" %}</a>\r
+    {% endifnotequal %}\r
+    {% if can_comment %}\r
+        <a href="#" class="add-comment-link">{% trans "add new comment" %}</a>\r
+    {% endif %}\r
+</div>\r
index c2091f2b0815b328ae895ab084f92ecae5687186..6fc19cec56dd036d2740a4d60d4d83ca2fdd0f95 100644 (file)
@@ -182,7 +182,7 @@ def post_controls(post, user):
 \r
 @register.inclusion_tag('node/comments.html')\r
 def comments(post, user):\r
-    all_comments = post.comments.filter_state(deleted=False).order_by('added_at')\r
+    all_comments = post.comments.filter_state(deleted=False).order_by('-added_at')\r
 \r
     if len(all_comments) <= 5:\r
         top_scorers = all_comments\r