* Remove preview button, since it doesn't work inline and is ugly.
[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>
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">
29             {{ comment.user }} said:<br/>
30             {% auto_transform_markup comment %}
31                         <p style="display:none;" id="replyLink{{comment.id}}"><a href="javascript:showReply('{{comment.id}}');">Reply to this comment</a></p>
32                         <div id="replyForm{{comment.id}}" class="commentReplyForm">
33                                 <script>hideReply('{{comment.id}}');</script>
34                                 <form method="POST" action="{% get_comment_url object comment %}">
35                                         <p><a href="javascript:hideReply('{{comment.id}}');">Cancel reply</a></p>
36                                         <ul>
37                                                 <table>
38                                                 {{ comment.get_reply_form.as_table }}
39                                                 </table>
40                                                 <input type="submit" value="{% trans "Reply to this comment" %}" /></li>
41                                         </ul>
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>hideReply('')</script>
53 <h3>{% trans "Add comment" %}<h3>
54 <form method="POST" action="{% get_comment_url object %}">
55         <p><a href="javascript:hideReply('')">Cancel comment</a></p>
56     <ul>
57         <table>
58         {{ comment_form.as_table }}
59         </table>
60         <input type="submit" value="{% trans "Add comment" %}" /></li>
61         {# <input type="submit" name="preview" value="{% trans "Preview comment" %}" /></li> #}
62     </ul>
63 </form>
64 </div>