diff options
Diffstat (limited to 'static/website/templates')
-rw-r--r-- | static/website/templates/base.html | 5 | ||||
-rw-r--r-- | static/website/templates/get-question.html | 6 | ||||
-rw-r--r-- | static/website/templates/index.html | 178 | ||||
-rw-r--r-- | static/website/templates/notify.html | 12 |
4 files changed, 181 insertions, 20 deletions
diff --git a/static/website/templates/base.html b/static/website/templates/base.html index 97b9194..172c901 100644 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -5,6 +5,7 @@ <title>Spoken-Tutorial Forums</title> {% compress css %} <link rel="stylesheet" href="{% static 'website/css/bootstrap.min.css' %}" type="text/css" media="screen" charset="utf-8" /> + <link rel="stylesheet" href="{% static 'website/slick/slick.css' %}" type="text/css" media="screen" charset="utf-8" /> <link rel="stylesheet" href="{% static 'website/css/main.css' %}" type="text/css" media="screen" charset="utf-8" /> {% endcompress %} </head> @@ -27,7 +28,7 @@ Spoken Tutorial Forums </a> </div> <!-- /.navbar-header --> - + <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> <ul class="nav navbar-nav navbar-right"> @@ -109,7 +110,7 @@ {% compress js %} <script src="{% static 'website/js/jquery.min.js' %}"></script> <script src="{% static 'website/js/bootstrap.min.js' %}"></script> - + <script src="{% static 'website/slick/slick.min.js' %}"></script> {% block javascript %} <!-- overide with custom javascript --> {% endblock %} diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html index 48aa427..2b0371e 100644 --- a/static/website/templates/get-question.html +++ b/static/website/templates/get-question.html @@ -120,7 +120,7 @@ <div class="comments col-lg-11 pull-right"> <!-- displaying comments --> {% for comment in answer.answercomment_set.all %} - <div class="comment"> + <div class="comment" id="comment{{ comment.id }}"> <div class="body" id="cbody{{ comment.id }}"> {{ comment.body|safe }} </div> @@ -128,12 +128,12 @@ <span class="meta"> <small> <i> - {{ question.date_created|date:"d-m-y" }}, {{ question.date_created|time }} + {{ comment.date_created|date:"d-m-y" }}, {{ question.date_created|time }} </i> </small> <span class="user"> - {{ question.user }} + {{ comment.user }} </span> </span> {% if user|can_edit:comment %} diff --git a/static/website/templates/index.html b/static/website/templates/index.html index 6e7af78..a5e746e 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -1,19 +1,171 @@ {% extends 'website/templates/base.html' %} {% load static %} +{% load count_tags %} + {% block content %} -<div class="row"> - {% for category in categories %} - <div class="col-lg-2 col-md-2 col-sm-2"> - <div class="thumbnail"> - <img src="{% static "website/images/" %}{{ category }}.jpg" height="75px" width="100%"> - <div class="caption"> - <h3>{{ category }}</h3> - <p> - <a class="btn btn-xs btn-default btn-block vs" href="/filter/{{ category }}">View Questions</a> - </p> + <div id="carousel-container"> + <div class="row"> + <div class="col-lg-12"> + <div class="carousel"> + {% for category in categories %} + <div class="item"> + <div class="thumb"> + <img data-lazy="{% static "website/images/" %}{{ category }}.jpg" height="75px" width="99px"> + </div> + <div class="descp"> + <a class="btn btn-block btn-default btn-sm vs" href="{% url 'website:filter' category %}">{{ category }}</a> + </div> + </div> <!-- /.item --> + {% endfor %} + </div> <!-- /.carousel --> + </div> <!-- /.col --> + </div> <!-- /.row --> + </div> + + <div id="filter-container"> + <div class="row"> + <form class ="" id="filter-form" action="" role="form"> + <div class="col-lg-6"> + <h3>Filter questions . . .</h3> + <div class="row"> + <div class="form-group col-lg-10"> + <select id="filter-select" class="form-control"> + <option value="-1">Select a FOSS category</option> + {% for category in categories %} + <option value="{{ category }}">{{ category }}</option> + {% endfor %} + </select> + </div> <!-- /.form-group, .col --> + <div class="form-group col-lg-2"> + <input class="btn btn-primary btn-block" type="submit" value="Go"> + </div> <!-- /.form-group, .col --> + </div> + </div> <!-- /.col --> + </form> + <div class="col-lg-6"> + <div class="row"> + <div class="col-lg-6"> + <h3 align="center"><strong>{% total_question_count %}</strong></h3> + <h3 align="center">Questions</h3> + </div> + <div class="col-lg-6"> + <h3 align="center"><strong>{% total_answer_count %}</strong></h3> + <h3 align="center">Answers</h3> + </div> + </div> </div> + </div> <!-- /.row --> + </div> <!-- /#filter-container --> + + <br> + <div class="panel panel-default"> + <div class="panel-heading"> + Recent Questions </div> - </div> - {% endfor %} -</div> + <div class="panel-body"> + <table class="table table-bordered table-hover"> + <th> FOSS </th> + <th> Tutorial</th> + <th> Min </th> + <th> Sec </th> + <th> Question</th> + <th> Date</th> + <th> Views</th> + <th> Answers</th> + <th> User</th> + {% for question in questions %} + <tr> + <td> + <span href="#" class="category" data-toggle="tooltip" data-placement="top" title="{{ question.category}}"> + {{ question.category|truncatechars:12 }} + </span> + <a class="pull-right" href="{% url 'website:filter' question.category %}?qid={{ question.id }}"> + <span class="glyphicon glyphicon-search"></span> + </a> + </td> + + <td> + <span class="tutorial" data-toggle="tooltip" data-placement="top" title="{{ question.tutorial}}"> + {{ question.tutorial|truncatechars:12 }} + </span> + <a class="pull-right" href="{% url 'website:filter' question.category question.tutorial %}?qid={{ question.id }}"> + <span class="glyphicon glyphicon-search"></span> + </a> + </td> + + <td> + <span> + <a href="{% url 'website:filter' question.category question.tutorial question.minute_range %}?qid={{ question.id }}"> + {{ question.minute_range }} + </a> + </span> + </td> + + <td> + <span> + <a href="{% url 'website:filter' question.category question.tutorial question.minute_range question.second_range%}?qid={{ question.id }}"> + {{ question.second_range }} + </a> + </span> + </td> + + <td> + <span class="title" data-toggle="tooltip" data-placement="top" title="{{ question.title }}"> + <a href="{% url 'website:get_question' question.id %}">{{ question.title|truncatechars:40 }}</a> + </span> + </td> + + <td> + <span> + <i> + {{ question.date_created|date:"d-m-y" }} + </i> + </span> + </td> + + <td> + {{ question.views}} + </td> + + <td> + {{ question.answer_set.count }} + </td> + + <td> + <span class="title" data-toggle="tooltip" data-placement="top" title="{{ question.user }}"> + {{ question.user|truncatechars:10 }} + </span> + </td> + </tr> + {% endfor %} + + </table> + </div> <!-- /.panel-body --> + </div> <!-- /.panel --> +{% endblock %} + +{% block javascript %} +<script> + $(document).ready(function(){ + $('.carousel').slick({ + lazyLoad: 'ondemand', + dots: false, + touchMove: false, + draggable: false, + slidesToShow: 8, + slidesToScroll: 3, + speed: 500, + {# autoplay: true, #} + autoplaySpeed: 1000, + }); + + $("#filter-form").submit(function(e) { + var category = $("#filter-select").val(); + if(category != -1) { + window.location = "/filter/" + category; + } + e.preventDefault(); + }); + }); +</script> {% endblock %} diff --git a/static/website/templates/notify.html b/static/website/templates/notify.html index af93eb5..a98d21a 100644 --- a/static/website/templates/notify.html +++ b/static/website/templates/notify.html @@ -1,6 +1,14 @@ <div class="notification"> - <a href=""><strong>{{ answer.user }}</strong> answers to <strong>{{ question.title }}</strong></a> / - {{ answer.body|safe }} + {% if notification.cid != 0 and notification.aid != 0 %} + <small> + <a href="">New <strong>Comment</strong> on "{{ question.title }}"</a> + </small> + {% elif notification.cid == 0 %} + <a href="">New <strong>Answer</strong> on "{{ question.title }}"</a> + {% endif %} + + + <!-- <a href=""><strong>{{ answer.user }}</strong> answers to <strong>{{ question.title }}</strong></a> --> <a class="remove" data-nid="{{ notification.id }}" href="#"> <span class="glyphicon glyphicon-remove-circle"></span> </a> |