From: jordan Date: Mon, 24 Oct 2011 21:29:48 +0000 (+0000) Subject: change the order in which comments are ordered X-Git-Tag: live~125 X-Git-Url: https://git.openstreetmap.org./osqa.git/commitdiff_plain/493f5c31bcaf9f89774a9ab5489581ca4729d4a6 change the order in which comments are ordered git-svn-id: http://svn.osqa.net/svnroot/osqa/trunk@1192 0cfe37f9-358a-4d5e-be75-b63607b5c754 --- diff --git a/forum/skins/default/media/js/osqa.main.js b/forum/skins/default/media/js/osqa.main.js index 8fb4d63..17de794 100644 --- a/forum/skins/default/media/js/osqa.main.js +++ b/forum/skins/default/media/js/osqa.main.js @@ -116,7 +116,7 @@ var response_commands = { .replace(new RegExp('%EDIT_URL%', 'g'), edit_url) .replace(new RegExp('%CONVERT_URL%', 'g'), convert_url); - $container.append(skeleton); + $container.prepend(skeleton); // Show the convert comment to answer tool only if the current comment can be converted if (can_convert == true) { diff --git a/forum/skins/default/media/style/style.css b/forum/skins/default/media/style/style.css index d08be72..58bc23a 100644 --- a/forum/skins/default/media/style/style.css +++ b/forum/skins/default/media/style/style.css @@ -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; diff --git a/forum/skins/default/templates/node/comments.html b/forum/skins/default/templates/node/comments.html index 41a97aa..68ebde2 100644 --- a/forum/skins/default/templates/node/comments.html +++ b/forum/skins/default/templates/node/comments.html @@ -1,52 +1,7 @@ {% load extra_tags %} {% load i18n %} -
- {% for comment in comments %} - -
-
{% if comment.score %}{{ comment.score }}{% endif %}
-
{{ comment.comment }}
-
- {% if comment.can_like %} - - {% endif %} - {% if comment.can_edit %} - - {% endif %} - {% if comment.can_delete %} - - {% endif %} - {% if comment.can_convert %} - - - {% endif %} - - - ({% diff_date comment.added_at %}) - {{comment.user.decorated_name}} - {% if show_gravatar %}{% gravatar comment.user 18 %}{% endif %} -
-
- {% endfor %} -
-
- {% ifnotequal showing total %} - - {% blocktrans %}showing {{ showing }} of {{ total }}{% endblocktrans %} - - {% trans "show all" %} - {% endifnotequal %} - {% if can_comment %} - {% trans "add new comment" %} - {% endif %} -
+
{% if can_comment %}
@@ -101,4 +56,51 @@
{% endif %}
- +
+ +
+ {% for comment in comments %} + +
+
{% if comment.score %}{{ comment.score }}{% endif %}
+
{{ comment.comment }}
+
+ {% if comment.can_like %} + + {% endif %} + {% if comment.can_edit %} + + {% endif %} + {% if comment.can_delete %} + + {% endif %} + {% if comment.can_convert %} + + + {% endif %} + + + ({% diff_date comment.added_at %}) + {{comment.user.decorated_name}} + {% if show_gravatar %}{% gravatar comment.user 18 %}{% endif %} +
+
+ {% endfor %} +
+
+ {% ifnotequal showing total %} + + {% blocktrans %}showing {{ showing }} of {{ total }}{% endblocktrans %} + + {% trans "show all" %} + {% endifnotequal %} + {% if can_comment %} + {% trans "add new comment" %} + {% endif %} +
diff --git a/forum/templatetags/node_tags.py b/forum/templatetags/node_tags.py index c2091f2..6fc19ce 100644 --- a/forum/templatetags/node_tags.py +++ b/forum/templatetags/node_tags.py @@ -182,7 +182,7 @@ def post_controls(post, user): @register.inclusion_tag('node/comments.html') def comments(post, user): - all_comments = post.comments.filter_state(deleted=False).order_by('added_at') + all_comments = post.comments.filter_state(deleted=False).order_by('-added_at') if len(all_comments) <= 5: top_scorers = all_comments