]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/skins/default/templates/node/comments.html
make {% comments %} template tag decoratable and add ability to attach additional...
[osqa.git] / forum / skins / default / templates / node / comments.html
index e91db87709a08db23742ab22130f31e9552347ba..a84ef89d5583d46b518aa6a61ee647e75434f683 100644 (file)
@@ -1,82 +1,56 @@
 {% load extra_tags %}\r
 {% load i18n %}\r
 \r
+{% if show_latest_comments_first %}{% include "node/comment_skeleton.html" %}{% endif %}\r
+\r
 <div class="comments-container" id="comments-container-{{ post.id }}">\r
     {% for comment in comments %}\r
-        <table class="comment{% if not comment.top_scorer %} not_top_scorer{% endif %}" id="comment-{{comment.id}}">\r
-            <tr>\r
-                <td rowspan="2" class="comment-score" id="comment-{{ comment.id }}-score">\r
-                    {% if comment.score %}{{ comment.score }}{% endif %}\r
-                </td>\r
-                <td class="comment-text" id="comment-{{comment.id}}-text">\r
-                    {{ comment.body }}\r
-                </td>\r
-            </tr>\r
-            <tr>\r
-                <td class="comment-info" id="comment-{{comment.id}}-info">\r
-                    <a class="comment-user userinfo" href="{{comment.user.get_profile_url}}">{{comment.user}}</a>\r
-                    <span class="comment-age">({% diff_date comment.added_at %})</span>\r
-                    {% if comment.can_like %}\r
-                        <a id="comment-{{ comment.id }}-like" 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="#" 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" rel="nofollow"> </a>\r
-                    {% endif %}\r
-                </td>\r
-            </tr>\r
-        </table>\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
+                {% if comment.additional_controls %}\r
+                    {{ comment.additional_controls }}\r
+                {% endif %}\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
-    <img src="/m/default/media/images/gray-up-arrow-h18px.png" />\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
+        <a href="#" class="show-all-comments-link">{% blocktrans %}show {{ more_comments_count }} more comments{% endblocktrans %}</a>\r
     {% endifnotequal %}\r
     {% if can_comment %}\r
         <a href="#" class="add-comment-link">{% trans "add new comment" %}</a>\r
     {% endif %}\r
 </div>\r
-{% if can_comment %}\r
-<div id="comment-{{ post.id }}-form-container" class="comment-form-container">\r
-    <form id="comment-{{ post.id }}-form" method="post" action="{% url comment id=post.id %}">\r
-        <div class="comment-form-widgets-container">\r
-            <textarea name="comment"></textarea>\r
-            <input type="submit" value="{% trans " add comment" %}" />\r
-        </div>\r
-        <span id="comment-{{ post.id }}-chars-left" class="comment-chars-left">\r
-            {% blocktrans %}\r
-                have <span class="comments-char-left-count">{{ max_length }}</span> characters left\r
-            {% endblocktrans %}\r
-        </span>\r
-        <script type="text/html" class="new-comment-skeleton" id="new-comment-skeleton-{{ post.id }}">\r
-            <table class="comment" id="comment-%ID%" style="display: none">\r
-                <tr>\r
-                    <td rowspan="2" class="comment-score" id="comment-%ID%-score"></td>\r
-                    <td class="comment-text" id="comment-%ID%-text">%COMMENT%</td>\r
-                </tr>\r
-                <tr>\r
-                    <td class="comment-info" id="comment-%ID%-info">\r
-                        <a class="comment-user" href="%PROFILE_URL%">%USERNAME%</a>\r
-                        <span class="comment-age">({% trans "just now" %})</span>\r
-                        <a id="comment-%ID%-edit" href="#"\r
-                            class="comment-edit" rel="nofollow"> </a>\r
-                        <a id="comment-%ID%-delete" href="%DELETE_URL%"\r
-                            class="ajax-command comment-delete" rel="nofollow"> </a>\r
-                    </td>\r
-                </tr>\r
-            </table>\r
-        </script>\r
-    </form>\r
-</div>\r
-{% endif %}\r
-    
\ No newline at end of file
+\r
+{% if not show_latest_comments_first %}{% include "node/comment_skeleton.html" %}{% endif %}\r