d60ac14c1a4a80eaac2c0393eded37dfa213134b
[matthijs/projects/xerxes.git] / templates / influences / influence_detail_block.html
1 {% load i18n %}
2 {% load threadedcommentstags %}
3
4 <h1>{{ object.summary }}</h1>
5 <table>
6 <tr><td>{% trans "Contact" %}:</td><td>{{ object.contact }}</td></tr>
7 <tr><td>{% trans "Character" %}:</td><td><a href="{% url influences_character_detail object.character.id %}">{{ object.character }}</a></td></tr>
8 {% if object.longterm %}
9 <tr><td>{% trans "Long term" %}:</td><td>{{ object.longterm|yesno|capfirst }}</td></tr>
10 {% endif %}
11 </table>
12 <p>{{ object.description }}</p>
13 <script type="text/javascript">
14         function showReply(comment_id) {
15                 YAHOO.util.Dom.setStyle('replyForm' + comment_id, 'display', 'block');
16                 YAHOO.util.Dom.setStyle('replyLink' + comment_id, 'display', 'none');
17         }
18
19         function hideReply(comment_id) {
20                 YAHOO.util.Dom.setStyle('replyForm' + comment_id, 'display', 'none');
21                 YAHOO.util.Dom.setStyle('replyLink' + comment_id, 'display', 'block');
22         }
23 </script>
24                 
25 <h2>{% trans "Comments" %}</h2>
26 {% if comments %}
27     {% for comment in comments %}
28         <div style="margin-left: {{ comment.depth }}em;" class="comment{% if not comment.is_public %} private{% endif %}">
29             {{ comment.user }} said:<br/>
30             {% auto_transform_markup comment %}
31                         <p style="display:none;" id="replyLink{{comment.id}}">
32                                 <a href="javascript:showReply('{{comment.id}}');">{% trans "Reply to this comment" %}</a>
33                         </p>
34                         <div id="replyForm{{comment.id}}" class="commentReplyForm">
35                                 <script type="text/javascript">hideReply('{{comment.id}}');</script>
36                                 <form method="post" action="{% url influences_influence_comment_parent object.id,comment.id %}">
37                                         <p><a href="javascript:hideReply('{{comment.id}}');">{% trans "Cancel reply" %}</a></p>
38                                         <table>
39                                         {{ comment.reply_form.as_table }}
40                                         </table>
41                                         <div><input type="submit" value="{% trans "Reply to this comment" %}" /></div>
42                                 </form>
43                         </div>
44         </div>
45     {% endfor %}
46 {% else %}
47     {% trans "No comments were added yet" %}
48 {% endif %}
49
50 <p style="display:none;" id="replyLink"><a href="javascript:showReply('')">Add comment</a></p>
51 <div id="replyForm">
52 <script type="text/javascript">hideReply('')</script>
53 <h3>{% trans "Add comment" %}</h3>
54 <form method="post" action="{% url influences_influence_comment object.id %}">
55         <p><a href="javascript:hideReply('')">Cancel comment</a></p>
56     <table>
57     {{ comment_form.as_table }}
58     </table>
59     <div><input type="submit" value="{% trans "Add comment" %}" /></div>
60     {# <input type="submit" name="preview" value="{% trans "Preview comment" %}" /></li> #}
61 </form>
62 </div>