Restyle comment display and forms.
[matthijs/projects/xerxes.git] / templates / influences / influence_comments_block.html
index 5392d2f2db3938117e11315dc3f2c1353f2762f0..6b0dd51597ca693c5e83293a5b41fd06bc077042 100644 (file)
@@ -1,23 +1,23 @@
 {% load i18n %}
 {% load threadedcommentstags %}
 
-{% if comments %}
-    <script type="text/javascript">
-        function showReply(comment_id) {
-            YAHOO.util.Dom.setStyle('replyForm' + comment_id, 'display', 'block');
-            YAHOO.util.Dom.setStyle('replyLink' + comment_id, 'display', 'none');
-        }
+<script type="text/javascript">
+    function showReply(comment_id) {
+        YAHOO.util.Dom.setStyle('replyForm' + comment_id, 'display', 'block');
+        YAHOO.util.Dom.setStyle('replyLink' + comment_id, 'display', 'none');
+    }
 
-        function hideReply(comment_id) {
-            YAHOO.util.Dom.setStyle('replyForm' + comment_id, 'display', 'none');
-            YAHOO.util.Dom.setStyle('replyLink' + comment_id, 'display', 'block');
-        }
-    </script>
+    function hideReply(comment_id) {
+        YAHOO.util.Dom.setStyle('replyForm' + comment_id, 'display', 'none');
+        YAHOO.util.Dom.setStyle('replyLink' + comment_id, 'display', 'block');
+    }
+</script>
 
+{% if comments %}
     {% for comment in comments %}
         <div style="margin-left: {{ comment.depth }}em;" class="comment{% if not comment.is_public %} private{% endif %}">
-            {{ comment.user }} said:<br/>
-            {% auto_transform_markup comment %}
+            <span class="commenter">{{ comment.user }} said:</span>
+            <div class="comment-body">{% auto_transform_markup comment %}</div>
                        <p style="display:none;" id="replyLink{{comment.id}}">
                                <a href="javascript:showReply('{{comment.id}}');">{% trans "Reply to this comment" %}</a>
                        </p>
                                <script type="text/javascript">hideReply('{{comment.id}}');</script>
                                <form method="post" action="{% url influences_influence_comment_parent object.id,comment.id %}">
                                        <p><a href="javascript:hideReply('{{comment.id}}');">{% trans "Cancel reply" %}</a></p>
-                                       <table>
-                                       {{ comment.reply_form.as_table }}
-                                       </table>
-                                       <div><input type="submit" value="{% trans "Reply to this comment" %}" /></div>
+                    {{ comment.reply_form.comment.label_tag }}
+                    {{ comment.reply_form.comment }}<br/>
+                                       {{ comment.reply_form.is_public }}
+                                       {{ comment.reply_form.is_public.label_tag }}
+                                       <div>
+                    <input type="hidden" name="next" value="{{ request.path }}" />
+                    <input type="submit" value="{% trans "Reply to this comment" %}" />
+                    <input type="submit" name="preview" value="{% trans "Preview" %}" />
+                    </div>
                                </form>
                        </div>
         </div>
 <h3>{% trans "Add comment" %}</h3>
 <form method="post" action="{% url influences_influence_comment object.id %}">
        <p><a href="javascript:hideReply('')">Cancel comment</a></p>
-    <table>
-    {{ comment_form.as_table }}
-    </table>
-    <div><input type="submit" value="{% trans "Add comment" %}" /></div>
-    {# <input type="submit" name="preview" value="{% trans "Preview comment" %}" /></li> #}
+    {{ comment_form.comment.label_tag }}
+    {{ comment_form.comment }}<br/>
+    {{ comment_form.is_public }}
+    {{ comment_form.is_public.label_tag }}
+    <div>
+    <input type="hidden" name="next" value="{{ request.path }}" />
+    <input type="submit" value="{% trans "Add comment" %}" />
+    <input type="submit" name="preview" value="{% trans "Preview" %}" />
+    </div>
 </form>
 </div>