summaryrefslogtreecommitdiff
path: root/comments
diff options
context:
space:
mode:
authorJayaram R Pai2014-07-08 00:11:52 +0530
committerJayaram R Pai2014-07-08 00:11:52 +0530
commit5fa6de089dce1c45a095c286dbd890fea30e9c94 (patch)
tree607f2b454c9bd405f4928233d72ebdacbd614376 /comments
parent4c535a956e8a6d5bb9c0b124f4180fcf9d0275e9 (diff)
downloadPython-TBC-Interface-5fa6de089dce1c45a095c286dbd890fea30e9c94.tar.gz
Python-TBC-Interface-5fa6de089dce1c45a095c286dbd890fea30e9c94.tar.bz2
Python-TBC-Interface-5fa6de089dce1c45a095c286dbd890fea30e9c94.zip
added base template for comments
Diffstat (limited to 'comments')
-rw-r--r--comments/templates/comments/comment_base.html227
-rw-r--r--comments/templates/comments/get_comments.html72
-rw-r--r--comments/templates/comments/new_comment.html1
-rw-r--r--comments/templates/comments/new_reply.html17
-rw-r--r--comments/views.py1
5 files changed, 273 insertions, 45 deletions
diff --git a/comments/templates/comments/comment_base.html b/comments/templates/comments/comment_base.html
index c3a2a7b..bcf8437 100644
--- a/comments/templates/comments/comment_base.html
+++ b/comments/templates/comments/comment_base.html
@@ -1,17 +1,224 @@
-{% load static %}
+{% 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>
+ <head>
+ <title>
+ {% block title %}
+ Python Textbook Companion Project | FOSSEE, IIT Bombay
+ {% endblock %}
+ </title>
+ {% block meta %}
+ <meta charset="utf-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
+ <meta name="description" content="">
+ <meta name="author" content="">
+ {% endblock %}
+
+ <link rel="stylesheet" href="{% static 'css/bootstrap.min.css' %}" type="text/css" />
+ <link rel ="stylesheet" href="{% static 'css/responsive.css' %}" type="text/css"/>
+ <link rel ="stylesheet" href="{% static 'css/comments.css' %}" type="text/css"/>
+ <style>
+ .module-list {
+ float: left;
+ height: 220px;
+ margin-top: 20px;
+ margin-bottom: 20px;
+ margin-left: 50px;
+ padding: 10px;
+ padding-bottom: 25px;
+ position: relative;
+ width: 300px;
+ background: #2c3e50;
+ }
+ .module-list img {
+ height: 220px;
+ }
+ .module-list img:hover{
+ height: 220px;
+ border-radius: 15px;
+ }
+
+ .module-list a{
+ color: #ffffff;
+ }
+ .navbar .container {
+ max-width: 1100px;
+ }
+ #content-wrap{
+ max-width: 1100px;
+ margin: 0 auto;
+ }
+ input[type="text"] {
+ width: 100%;
+ }
+ input[type="password"] {
+ width: 100%;
+ }
+ </style>
+
+ {% block css %}
+ <style type="text/css">
+ body {
+ padding-top: 60px;
+ padding-bottom: 40px;
+ }
+ </style>
+ {% endblock %}
+
+ {% block script %}
+ {% endblock %}
+ </head>
+
<body>
- <div id="content-wrapper">
- {% block content %}
- {% endblock %}
+<div class="navbar navbar navbar-fixed-top">
+ <div class="navbar-inner">
+ <div class="container">
+ <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ <span class="icon-bar"></span>
+ </button>
+ <a class="brand" href="/">Python Textbook Companion</a>
+ <div class="nav-collapse collapse">
+
+ <ul class="nav pull-right">
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">About<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="http://fossee.in" target="_blank">FOSSEE</a></li>
+ <li><a href="http://python.fossee.in" target="_blank">Python Team</a></li>
+ </ul>
+ </li>
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">Textbooks<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'tbc:CompletedBooks' %}">Completed Books</a></li>
+ <li><a href="{% url 'tbc:BooksUnderProgress' %}">Books Under Progress</a></li>
+ </ul>
+ </li>
+ <li><a href="{% url 'tbc:InternshipForms' %}">Internship Forms</a></li>
+
+ {% if user %}
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ user.first_name }}<b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'tbc:SubmitBook' %}">Submit Book</a></li>
+ <li><a href="{% url 'tbc:UpdateBook' %}">Update Submission</a></li>
+ <li><a href="{% url 'tbc:UpdatePassword' %}">Update Password</a></li>
+ <li><a href="{% url 'tbc:UserLogout' %}">Logout</a></li>
+ </ul>
+ </li>
+ {% endif %}
+
+ {% if reviewer %}
+ <li class="dropdown">
+ <a href="#" class="dropdown-toggle" data-toggle="dropdown">{{ reviewer.first_name }} {{ reviewer.last_name }} <b class="caret"></b></a>
+ <ul class="dropdown-menu">
+ <li><a href="{% url 'tbc:BookReview' %}">Review Books</a></li>
+ <li><a href="{% url 'tbc:UserLogout' %}">Logout</a></li>
+ </ul>
+ </li>
+ {% endif %}
+
+ {% if anonymous %}
+ <li><a href="{% url 'tbc:UserLogin' %}">Login</a></li>
+ <li><a href="{% url 'tbc:UserRegister' %}">Sign Up</a></li>
+ {% endif %}
+
+ </ul> <!--/.nav -->
+ </div><!--/.nav-collapse -->
+ </div>
+ </div>
</div>
+ <div class="container" id="comments-container">
+ {% block content %}
+ {% if up %}
+ <center>
+ <div class="alert" style="width:500px;">
+ <a class="close" data-dismiss="alert" href="#">&times;</a>
+ <p>Book has been uploaded successfully !</p>
+ </div>
+ </center>
+ <div class="clearfix"></div>
+ {% endif %}
+ {% if login %}
+ <center>
+ <div class="alert" style="width:150px;height:23px;">
+ <a class="close" data-dismiss="alert" href="#">&times;</a>
+ <p>Login Successful !</p>
+ </div>
+ </center>
+ <div class="clearfix"></div>
+ {% endif %}
+ {% if logout %}
+ <center>
+ <div class="alert" style="width:300px;height:23px;">
+ <a class="close" data-dismiss="alert" href="#">&times;</a>
+ <p>You have logged out successfully !</p>
+ </div>
+ </center>
+ <div class="clearfix"></div>
+ {% endif %}
+ {% if update_book %}
+ <center>
+ <div class="alert" style="width:300px;height:23px;">
+ <a class="close" data-dismiss="alert" href="#">&times;</a>
+ <p>Book has been updated successfully !</p>
+ </div>
+ </center>
+ <div class="clearfix"></div>
+ {% endif %}
+ {% if not_found %}
+ <center>
+ <div class="alert" style="width:650px;height:23px;">
+ <a class="close" data-dismiss="alert" href="#">&times;</a>
+ <p>It seems that currently there is no book that you can update ! Please submit one.</p>
+ </div>
+ </center>
+ <div class="clearfix"></div>
+ {% endif %}
+ <div class="row-fluid">
+ <center><h3>Recent Submissions</h3></center>
+ {% for item in items %}
+ <div class ="module-list">
+ <a href="{% url 'tbc:BookDetails' item.book.id %}"><img src="{% static 'uploads/' %}{{ item.image.image }}"></a>
+ <center><a href="{% url 'tbc:BookDetails' item.book.id %}">{{ item.book.title }}</a></center>
+ </div>
+ {% endfor %}
+ </div>
+ <br>
+ <center>
+ <a class="btn btn-primary" href="{% url 'tbc:BrowseBooks' %}">Browse All Books</a>
+ </center>
+ <br>
+ <!--
+ <input type=text> <input type=submit value=Search>
+ -->
+ {% endblock %}
+ <div class="clearfix"></div>
+ <hr>
+
+ <footer>
+ <center><p>&copy; FOSSEE - IIT Bombay 2013</p></center>
+ <center><img src="{% static 'images/fossee.png' %}" width=100 height=70></center>
+ </footer>
+
+ </div> <!-- /container -->
+
<script src="{% static 'js/jquery.js' %}"></script>
<script src="{% static 'js/bootstrap.min.js' %}"></script>
-</body>
+ <!-- google analytics -->
+ <script>
+ (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
+ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
+ m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
+ })(window,document,'script','//www.google-analytics.com/analytics.js','ga');
+
+ ga('create', 'UA-44697375-2', 'fossee.in');
+ ga('send', 'pageview');
+ </script>
+ <!-- / google analytics -->
+ </body>
</html>
+
+
diff --git a/comments/templates/comments/get_comments.html b/comments/templates/comments/get_comments.html
index 571f815..5dcc84a 100644
--- a/comments/templates/comments/get_comments.html
+++ b/comments/templates/comments/get_comments.html
@@ -1,45 +1,49 @@
{% extends 'comments/comment_base.html' %}
{% block content %}
-{% if comments %}
+<div id="recent-comments-wrapper">
+ {% if comments %}
<h5 class="pull-left"><u>Recent comments</u></h5>
+ <h3></h3>
<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>
+ <p> Showing comments for: Book: <em>{{ book }}</em> / Chapter: <em>{{ chapter }}</em> / Example: <em>{{ example }}<em></p>
+ <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 %}
- <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 %}
+ </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 %}
+ </div> <!-- /#recent-comments-form -->
{% endblock %}
diff --git a/comments/templates/comments/new_comment.html b/comments/templates/comments/new_comment.html
index fa0c333..d16aa15 100644
--- a/comments/templates/comments/new_comment.html
+++ b/comments/templates/comments/new_comment.html
@@ -2,6 +2,7 @@
{% block content %}
<div id="new-comment-form">
<h5><u>New comment form</u></h5>
+ <h4>Book: <em>{{ book }}</em> / Chapter: <em>{{ chapter }}</em> / Example: <em>{{ example }}</em> / Page: <em>{{ page }}</em></h4>
<form action="/comments/new/" method="POST" accept-charset="utf-8"> {% csrf_token %}
{{ form.errors }}
{{ form.book }}
diff --git a/comments/templates/comments/new_reply.html b/comments/templates/comments/new_reply.html
index 71532c8..eac5a06 100644
--- a/comments/templates/comments/new_reply.html
+++ b/comments/templates/comments/new_reply.html
@@ -1,10 +1,27 @@
{% extends 'comments/comment_base.html' %}
{% block content %}
<div id="new-reply-form">
+ <u> Comment: </u> <br><br>
+ <div class="well" style="width: 78%">
+ <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 %}
+ </div>
+ </div>
<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 }}
+ <label>Description:</label>
{{ 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>
diff --git a/comments/views.py b/comments/views.py
index be9d522..a095727 100644
--- a/comments/views.py
+++ b/comments/views.py
@@ -108,4 +108,3 @@ def new_reply(request):
'comment': comment
}
return render(request, 'comments/new_reply.html', context)
-