diff options
author | Jayaram R Pai | 2014-07-06 23:10:02 +0530 |
---|---|---|
committer | Jayaram R Pai | 2014-07-06 23:10:02 +0530 |
commit | 4c535a956e8a6d5bb9c0b124f4180fcf9d0275e9 (patch) | |
tree | 297c4033affb5f52cb8ff2009dfcc2edc7aef45e /comments/templates | |
parent | 36e7f06608eb339082c2e905133bd7d83d9b36f0 (diff) | |
download | Python-TBC-Interface-4c535a956e8a6d5bb9c0b124f4180fcf9d0275e9.tar.gz Python-TBC-Interface-4c535a956e8a6d5bb9c0b124f4180fcf9d0275e9.tar.bz2 Python-TBC-Interface-4c535a956e8a6d5bb9c0b124f4180fcf9d0275e9.zip |
added comments app
Diffstat (limited to 'comments/templates')
-rw-r--r-- | comments/templates/comments/comment_base.html | 17 | ||||
-rw-r--r-- | comments/templates/comments/get_comments.html | 45 | ||||
-rw-r--r-- | comments/templates/comments/new_comment.html | 17 | ||||
-rw-r--r-- | comments/templates/comments/new_reply.html | 13 |
4 files changed, 92 insertions, 0 deletions
diff --git a/comments/templates/comments/comment_base.html b/comments/templates/comments/comment_base.html new file mode 100644 index 0000000..c3a2a7b --- /dev/null +++ b/comments/templates/comments/comment_base.html @@ -0,0 +1,17 @@ +{% load static %} +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}"> + <link rel="stylesheet" href="{% static 'css/comments.css' %}"> +</head> +<body> + <div id="content-wrapper"> + {% block content %} + {% endblock %} + </div> + <script src="{% static 'js/jquery.js' %}"></script> + <script src="{% static 'js/bootstrap.min.js' %}"></script> +</body> +</html> 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 %} diff --git a/comments/templates/comments/new_comment.html b/comments/templates/comments/new_comment.html new file mode 100644 index 0000000..fa0c333 --- /dev/null +++ b/comments/templates/comments/new_comment.html @@ -0,0 +1,17 @@ +{% extends 'comments/comment_base.html' %} +{% block content %} +<div id="new-comment-form"> + <h5><u>New comment form</u></h5> + <form action="/comments/new/" method="POST" accept-charset="utf-8"> {% csrf_token %} + {{ form.errors }} + {{ form.book }} + {{ form.chapter }} + {{ form.example }} + {{ form.page }} + {{ form.title }}<br> + {{ form.body }} <br> + <input class="btn btn-primary" type="submit" value="Submit"> + <a class="btn btn-default" href="/comments/get/?book={{ book }}&chapter={{ chapter }}&example={{ example }}&page={{ page }}">Cancel</a> + </form> +</div> <!-- /#new-comment-form --> +{% endblock %} diff --git a/comments/templates/comments/new_reply.html b/comments/templates/comments/new_reply.html new file mode 100644 index 0000000..71532c8 --- /dev/null +++ b/comments/templates/comments/new_reply.html @@ -0,0 +1,13 @@ +{% extends 'comments/comment_base.html' %} +{% block content %} +<div id="new-reply-form"> + <h5><u>New reply form</u></h5> + <form action="/comments/new-reply/" method="POST" accept-charset="utf-8"> {% csrf_token %} + {{ form.errors }} + {{ form.comment_id }} + {{ form.body }} <br> + <input class="btn btn-primary" type="submit" value="Submit"> + <a class="btn btn-default" href="/comments/get/?book={{ comment.book }}&chapter={{ comment.chapter }}&example={{ comment.example }}&page={{ comment.page }}">Cancel</a> + </form> +</div> <!-- /#new-comment-form --> +{% endblock %} |