summaryrefslogtreecommitdiff
path: root/comments/templates/comments/get_comments.html
diff options
context:
space:
mode:
Diffstat (limited to 'comments/templates/comments/get_comments.html')
-rw-r--r--comments/templates/comments/get_comments.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/comments/templates/comments/get_comments.html b/comments/templates/comments/get_comments.html
new file mode 100644
index 0000000..571f815
--- /dev/null
+++ b/comments/templates/comments/get_comments.html
@@ -0,0 +1,45 @@
+{% extends 'comments/comment_base.html' %}
+{% block content %}
+
+{% if comments %}
+ <h5 class="pull-left"><u>Recent comments</u></h5>
+ <a class="btn btn-primary btn-small pull-right" href="/comments/new/?book={{ book }}&chapter={{ chapter }}&example={{ example }}&page={{ page }}">
+ + New comment
+ </a>
+ <div class="clearfix"></div>
+ <div class="accordion" id="accordion2">
+ {% for comment in comments %}
+ <div class="accordion-group">
+ <div class="accordion-heading">
+ <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion2" href="#collapse{{ forloop.counter }}">
+ #{{ forloop.counter }} <em>{{ comment.title }}</em>
+ </a>
+ </div>
+ <div id="collapse{{ forloop.counter }}" class="accordion-body collapse">
+ <div class="accordion-inner">
+ <blockquote>
+ {{ comment.body }}
+ </blockquote>
+ <div class="replies">
+ {% if comment.reply_set.all %}
+ <h6><u>Recent replies</u></h6>
+ {% endif %}
+ {% for reply in comment.reply_set.all %}
+ <div class="reply">
+ <p>{{ reply.body }}</p>
+ </div>
+ {% endfor %}
+ <a class="btn btn-success btn-small" href="/comments/new-reply/?comment_id={{ comment.id }}">+ Reply</a>
+ </div>
+ </div>
+ </div>
+ </div> <!-- /.accordion-group -->
+ {% endfor %}
+ </div> <!-- /.accordion -->
+{% else %}
+ <center>
+ <p> No comments for this example... </p>
+ <a class="btn btn-primary" href="/comments/new/?book={{ book }}&chapter={{ chapter }}&example={{ example }}&page={{ page }}">Create a new comment</a>
+ </center>
+{% endif %}
+{% endblock %}