Improve influence comment handling.
[matthijs/projects/xerxes.git] / templates / influences / influence_detail_block.html
index e9e33d0aa7376378fb39dd05975e5c474d35d6e8..d60ac14c1a4a80eaac2c0393eded37dfa213134b 100644 (file)
@@ -10,7 +10,7 @@
 {% endif %}
 </table>
 <p>{{ object.description }}</p>
-<script>
+<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');
 <h2>{% trans "Comments" %}</h2>
 {% if comments %}
     {% for comment in comments %}
-        <div style="margin-left: {{ comment.depth }}em;" class="comment">
+        <div style="margin-left: {{ comment.depth }}em;" class="comment{% if not comment.is_public %} private{% endif %}">
             {{ comment.user }} said:<br/>
             {% auto_transform_markup comment %}
-                       <p style="display:none;" id="replyLink{{comment.id}}"><a href="javascript:showReply('{{comment.id}}');">Reply to this comment</a></p>
+                       <p style="display:none;" id="replyLink{{comment.id}}">
+                               <a href="javascript:showReply('{{comment.id}}');">{% trans "Reply to this comment" %}</a>
+                       </p>
                        <div id="replyForm{{comment.id}}" class="commentReplyForm">
-                               <script>hideReply('{{comment.id}}');</script>
-                               <form method="POST" action="{% get_comment_url object comment %}">
-                                       <p><a href="javascript:hideReply('{{comment.id}}');">Cancel reply</a></p>
-                                       <ul>
-                                               <table>
-                                               {{ comment.get_reply_form.as_table }}
-                                               </table>
-                                               <input type="submit" value="{% trans "Reply to this comment" %}" /></li>
-                                       </ul>
+                               <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>
                                </form>
                        </div>
         </div>
 
 <p style="display:none;" id="replyLink"><a href="javascript:showReply('')">Add comment</a></p>
 <div id="replyForm">
-<script>hideReply('')</script>
-<h3>{% trans "Add comment" %}<h3>
-<form method="POST" action="{% get_comment_url object %}">
+<script type="text/javascript">hideReply('')</script>
+<h3>{% trans "Add comment" %}</h3>
+<form method="post" action="{% url influences_influence_comment object.id %}">
        <p><a href="javascript:hideReply('')">Cancel comment</a></p>
-    <ul>
-        <table>
-        {{ comment_form.as_table }}
-        </table>
-        <input type="submit" value="{% trans "Add comment" %}" /></li>
-        {# <input type="submit" name="preview" value="{% trans "Preview comment" %}" /></li> #}
-    </ul>
+    <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> #}
 </form>
 </div>