diff options
Diffstat (limited to 'static/website/templates')
-rw-r--r-- | static/website/templates/ajax-keyword-search.html | 4 | ||||
-rw-r--r-- | static/website/templates/ajax-time-search.html | 4 | ||||
-rw-r--r-- | static/website/templates/base.html | 25 | ||||
-rw-r--r-- | static/website/templates/filter.html | 4 | ||||
-rw-r--r-- | static/website/templates/get-question.html | 286 | ||||
-rw-r--r-- | static/website/templates/index.html | 252 | ||||
-rw-r--r-- | static/website/templates/notify.html | 12 | ||||
-rw-r--r-- | static/website/templates/recent-questions.html | 106 | ||||
-rw-r--r-- | static/website/templates/recent_questions.html | 5 | ||||
-rw-r--r-- | static/website/templates/user-answers.html (renamed from static/website/templates/user-replies.html) | 12 |
10 files changed, 483 insertions, 227 deletions
diff --git a/static/website/templates/ajax-keyword-search.html b/static/website/templates/ajax-keyword-search.html index db9fbc7..b4295c7 100644 --- a/static/website/templates/ajax-keyword-search.html +++ b/static/website/templates/ajax-keyword-search.html @@ -8,7 +8,7 @@ <th> Question</th> <th> Date</th> <th> Views</th> - <th> Replies</th> + <th> Answers</th> <th> User</th> {% for question in questions %} <tr> @@ -65,7 +65,7 @@ </td> <td> - {{ question.reply_set.count }} + {{ question.answer_set.count }} </td> <td> diff --git a/static/website/templates/ajax-time-search.html b/static/website/templates/ajax-time-search.html index 0b1673c..57be751 100644 --- a/static/website/templates/ajax-time-search.html +++ b/static/website/templates/ajax-time-search.html @@ -8,7 +8,7 @@ <th> Question</th> <th> Date</th> <th> Views</th> - <th> Replies</th> + <th> Answers</th> <th> User</th> {% for question in questions %} <tr> @@ -65,7 +65,7 @@ </td> <td> - {{ question.reply_set.count }} + {{ question.answer_set.count }} </td> <td> diff --git a/static/website/templates/base.html b/static/website/templates/base.html index 26e24c4..172c901 100644 --- a/static/website/templates/base.html +++ b/static/website/templates/base.html @@ -1,20 +1,15 @@ +{% load compress %} {% load static %} <html> <head> <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" /> - <link rel="stylesheet" href="{% static 'website/css/nice-bar.css' %}" type="text/css" media="screen" charset="utf-8" /> + {% endcompress %} </head> <body> - <div class="nice-bar"> - <p class="nice-text"> - One day CFD workshop on 22<sup>nd</sup> March 2014. - <a class="nice-button" href="http://cfd.fossee.in/workshop">View more</a> details about the workshop. - <a class="nice-button" href="http://cfdworkshop.doattend.com">Click here</a> for registration. - <span class="nice-close">x</span> - </p> - </div> <div id="page-wrapper"> <div id="header-wrapper"> <div id="header-inner"> @@ -29,11 +24,11 @@ <span class="icon-bar"></span> </button> <a class="navbar-brand" href="{% url 'website:home' %}"> - <img id="logo" src="http://spoken-tutorial.org/sites/all/themes/spoken/images/logo.png"> + <img id="logo" src="{% static 'website/images/logo.png' %}"> 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"> @@ -57,7 +52,7 @@ </a> <ul class="dropdown-menu"> <li><a href="{% url 'website:user_questions' user.id %}">My Questions</a></li> - <li><a href="{% url 'website:user_replies' user.id %}">My Replies</a></li> + <li><a href="{% url 'website:user_answers' user.id %}">My Answers</a></li> <li> <a href="{% url 'website:user_notifications' user.id %}"> Notifications @@ -111,12 +106,14 @@ </div> <!-- /#footer-inner --> </div> <!-- /#footer-wrapper --> </div> <!-- /#page-wrapper --> - + + {% 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 %} + {% endcompress %} </body> </html> diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html index 64eeb5c..dada403 100644 --- a/static/website/templates/filter.html +++ b/static/website/templates/filter.html @@ -80,7 +80,7 @@ <th> Question</th> <th> Date</th> <th> Views</th> - <th> Replies</th> + <th> Answers</th> <th> User</th> {% for question in questions %} <tr> @@ -137,7 +137,7 @@ </td> <td> - {{ question.reply_set.count }} + {{ question.answer_set.count }} </td> <td> diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html index 1a3d96b..af9e4a2 100644 --- a/static/website/templates/get-question.html +++ b/static/website/templates/get-question.html @@ -8,131 +8,191 @@ <span class="saving hideme">saving . . .</span> <span class="saved hideme">saved</span> -<div class="question {% if user|can_edit:question %}editable{% endif %}"> - <div class="title {% if user|can_edit:question %}title-editable{% endif %}"> - {{ question.title }} - </div> - - <div id="title-edit" class="hideme"> - <h5>Title</h5> - <input class="form-control" type="text"> - <h5>Question</h5> - </div> - - <div id="questionNicPanel"></div> - <div id="{% if user|can_edit:question %}questionInstance{% endif %}" class="body"> - {{ question.body|safe }} - </div> - <br> - - <span class="category"> - <small> - <a href="{% url 'website:filter' question.category %}"> - {{ question.category }} - </a> - </small> - </span> - - <span class="tutorial"> - <small> - <a href="{% url 'website:filter' question.category question.tutorial %}"> - {{ question.tutorial}} - </a> - </small> - </span> - - <span class="minute_range {% if question.minute_range == 'None' %}hideme{% endif %}"> - <small> - <a href="{% url 'website:filter' question.category question.tutorial question.minute_range %}"> - {{ question.minute_range }} min - </a> - </small> - </span> - - <span class="second_range {% if question.minute_range == 'None' %}hideme{% endif %}"> - <small> - <a href="{% url 'website:filter' question.category question.tutorial question.minute_range question.second_range%}"> - {{ question.second_range }} sec - </a> - </small> - </span> - - <a id="question-details-edit" data-toggle="modal" data-target="#detailsModal" href="#" class="hideme"> - <span class="glyphicon glyphicon-edit"></span> - </a> - - <span class="modify"> - {% if user|can_edit:question %} - <a class="edit btn btn-xs btn-info" href="#">Edit</a> - <a class="save btn btn-xs btn-success" data-qid="{{ question.id }}" href="#">Save</a> - {% endif %} - </span> - - <span class="meta"> - <small> - <i> - {{ question.date_created|date:"d-m-y" }}, {{ question.date_created|time }} - </i> - </small> - - <span class="user"> - {{ question.user }} - </span> - </span> - </div> <!-- /.question --> - -<h4><u>Answers:</u></h4> - -<div id="replyPanelWrapper" style="display:none;"> - <div id="replyNicPanel" style="display:none;"></div> -</div> - -{% for reply in replies %} - <div class="reply {% if user|can_edit:reply %}editable{% endif %}" id="reply{{reply.id}}"> +<div class="row"> + <div class="col-lg-12 question-wrapper"> + <div class="question {% if user|can_edit:question %}editable{% endif %}"> + <div class="title {% if user|can_edit:question %}title-editable{% endif %}"> + {{ question.title }} + </div> - <div class="body" id="body{{ reply.id }}"> - {{ reply.body|safe }} + <div id="title-edit" class="hideme"> + <h5>Title</h5> + <input class="form-control" type="text"> + <h5>Question</h5> </div> - + + <div id="questionNicPanel"></div> + <div id="{% if user|can_edit:question %}questionInstance{% endif %}" class="body"> + {{ question.body|safe }} + </div> + <br> + + <span class="category"> + <small> + <a href="{% url 'website:filter' question.category %}"> + {{ question.category }} + </a> + </small> + </span> + + <span class="tutorial"> + <small> + <a href="{% url 'website:filter' question.category question.tutorial %}"> + {{ question.tutorial}} + </a> + </small> + </span> + + <span class="minute_range {% if question.minute_range == 'None' %}hideme{% endif %}"> + <small> + <a href="{% url 'website:filter' question.category question.tutorial question.minute_range %}"> + {{ question.minute_range }} min + </a> + </small> + </span> + + <span class="second_range {% if question.minute_range == 'None' %}hideme{% endif %}"> + <small> + <a href="{% url 'website:filter' question.category question.tutorial question.minute_range question.second_range%}"> + {{ question.second_range }} sec + </a> + </small> + </span> + + <a id="question-details-edit" data-toggle="modal" data-target="#detailsModal" href="#" class="hideme"> + <span class="glyphicon glyphicon-edit"></span> + </a> + + <span class="modify"> + {% if user|can_edit:question %} + <a class="edit btn btn-xs btn-info" href="#">Edit</a> + <a class="save btn btn-xs btn-success" data-qid="{{ question.id }}" href="#">Save</a> + {% endif %} + </span> + <span class="meta"> <small> <i> - {{ reply.date_created|date:"d-m-y" }}, {{ reply.date_created|time }} + {{ question.date_created|date:"d-m-y" }}, {{ question.date_created|time }} </i> </small> - + <span class="user"> - {{ reply.user }} + {{ question.user }} </span> </span> + </div> <!-- /.question --> + </div> +</div> <!-- /.row --> - {% if user|can_edit:reply %} - <span class="modify" style="display:block"> - <a class="edit btn btn-xs btn-info vs" href="#body{{ reply.id}}" data-target="body{{ reply.id }}">Edit</a> - <a class="save btn btn-xs btn-success vs" data-target="body{{ reply.id }}" data-rid="{{ reply.id }}" href="#">Save</a> - </span> - {% endif %} - </div> <!-- /.reply --> +<h4><u>Answers:</u></h4> +<div id="answerPanelWrapper" style="display:none;"> + <div id="answerNicPanel" style="display:none;"></div> +</div> + +<div id="commentPanelWrapper" style="display:none;"> + <div id="commentNicPanel" style="display:none;"></div> +</div> + +{% for answer in answers %} +<div class="row"> + <div class="col-lg-12 answer-wrapper"> + <div class="answer {% if user|can_edit:answer %}editable{% endif %}" id="answer{{answer.id}}"> + + <div class="body" id="body{{ answer.id }}"> + {{ answer.body|safe }} + </div> + + <span class="user"> + {{ answer.user }} + </span> + + {% if user|can_edit:answer %} + <span class="modify" style="display:block"> + <a class="edit btn btn-xs btn-info vs" href="#body{{ answer.id}}" data-target="body{{ answer.id }}">Edit</a> + <a class="save btn btn-xs btn-success vs" data-target="body{{ answer.id }}" data-aid="{{ answer.id }}" href="#">Save</a> + </span> + {% endif %} + </div> <!-- /.answer --> + + <div class="row"> + <div class="comments col-lg-11 pull-right"> + <!-- displaying comments --> + {% for comment in answer.answercomment_set.all %} + <div class="comment" id="comment{{ comment.id }}"> + <div class="body" id="cbody{{ comment.id }}"> + {{ comment.body|safe }} + </div> + + <span class="meta"> + <small> + <i> + {{ comment.date_created|date:"d-m-y" }}, {{ question.date_created|time }} + </i> + </small> + + <span class="user"> + {{ comment.user }} + </span> + </span> + {% if user|can_edit:comment %} + <div class="modify-wrapper"> + <span class="modify" style="display:block"> + <a class="edit btn btn-xs btn-info vs" href="#cbody{{ comment.id }}" data-target="cbody{{ comment.id }}">Edit</a> + <a class="save btn btn-xs btn-success vs" data-target="cbody{{ comment.id }}" data-cid="{{ comment.id }}" href="#">Save</a> + </span> + </div> + {% endif %} + </div> <!-- /.comment --> + {% endfor %} + + + <!-- form to add comment --> + {% if user.is_authenticated %} + <form id="form{{ answer.id }}" method="post" action="/answer-comment/"> {% csrf_token %} + <input type="hidden" name="answer_id" value="{{answer.id}}"> + <textarea name="body" class="new-comment form-control" id="comment{{ answer.id }}" rows="2"></textarea> + </form> + <a class="add-comment" href="#" data-target="comment{{ answer.id }}"> + <small>add comment</small> + </a> + <a class="post-comment" href="#" data-target="comment{{ answer.id }}" data-aid="{{ answer.id }}" data-form="form{{ answer.id }}"> + <small>post comment</small> + </a> + <a class="cancel-comment" href="#" data-target="comment{{ answer.id }}"> + <small>cancel comment</small> + </a> + {% else %} + <br> + <a class="btn btn-xs btn-success vs" href="/accounts/login"> + Login to add comment + </a> + {% endif %} + </div> <!-- comments --> + </div> <!-- /.row --> + <br> <hr> + </div> <!-- /.answer-wrapper --> +</div> <!-- /.row --> {% endfor %} {% if user.is_authenticated %} - <form action="{% url 'website:question_reply' %}" method="POST"> {% csrf_token %} + <form action="{% url 'website:question_answer' %}" method="POST"> {% csrf_token %} {% with WIDGET_ERROR_CLASS='field_error' %} <div class="row"> <div class="col-lg-12"> <div class="form-group"> {% render_field form.question value=question.id %} - <label for="id_body">Reply</label> + <label for="id_body">Answer</label> {% render_field form.body class+='form-control' %} </div> </div> </div> {% endwith %} - <input class="btn btn-sm btn-info" type="submit" value="Submit Reply"> + <input class="btn btn-sm btn-info" type="submit" value="Submit Answer"> </form> {% else %} <h4> - <a class="btn btn-xs btn-success" href="{% url 'user_login'%}"><b>Log-in</b></a> to reply to this question. + <a class="btn btn-xs btn-success" href="{% url 'user_login'%}"><b>Log-in</b></a> to answer to this question. </h4> {% endif %} @@ -145,7 +205,7 @@ <h4 class="modal-title" id="myModalLabel">Edit Question Details</h4> </div> <div class="modal-body"> - + <h5>The Current question is under:</h5> {{ question.category }} --> {{ question.tutorial }} @@ -155,7 +215,7 @@ {% if question.second_range != 'None' %} --> {{ question.second_range}} {% endif %} - + <h5>Move the question to:</h5> <div class="row"> <div class="col-lg-4 col-md-4 col-sm-4"> @@ -232,7 +292,6 @@ <a class="btn btn-sm btn-default" data-dismiss="modal" href="#">Close</a> </div> <div class="clearfix"></div> - </div> <!-- /.modal-body --> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> @@ -252,4 +311,29 @@ {% block javascript %} <script src="{% static 'website/js/thread-user.js' %}"></script> <script src="{% static 'website/js/custom.js' %}"></script> + <script> + $(document).ready(function() { + $vote = $(".vote"); + + $vote.click(function() { + if($(this).hasClass("upvote")) { + /* handle upvote click event */ + if($(this).hasClass("voted")) { + $(this).removeClass("voted"); + } else { + $(this).addClass("voted"); + $(this).siblings(".downvote").removeClass("voted"); + } + } else { + /* handle downvote click event */ + if($(this).hasClass("voted")) { + $(this).removeClass("voted"); + } else { + $(this).addClass("voted"); + $(this).siblings(".upvote").removeClass("voted"); + } + } + }); + }); + </script> {% endblock %} diff --git a/static/website/templates/index.html b/static/website/templates/index.html index 5046c13..4162e42 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -1,106 +1,172 @@ {% extends 'website/templates/base.html' %} {% load static %} -{% block content %} {% load count_tags %} -<h4><u>Recent Questions</u></h4> -<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> Replies</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.reply_set.count }} - </td> - - <td> - <span class="title" data-toggle="tooltip" data-placement="top" title="{{ question.user }}"> - {{ question.user|truncatechars:10 }} - </span> - </td> - </tr> - {% endfor %} +{% block content %} + <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> -</table> - {% if total > 25 %} - <ul class="pagination pull-right"> - {% for i in total|get_range:"0,10" %} - <li> - <a href="{% url 'website:home' %}?marker={{ i }}"> - {% if i == marker %} - <strong>{{ i|div:"10"|inc }}</strong> - {% else %} - {{ i|div:"10"|inc }} - {% endif %} - </a> - </li> - {% endfor %} - </ul> - {% endif %} + <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 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> - $('span').tooltip(); + $(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> <script src="{% static 'website/js/nice-bar.js' %}"></script> {% endblock %} diff --git a/static/website/templates/notify.html b/static/website/templates/notify.html index 7251f1b..a98d21a 100644 --- a/static/website/templates/notify.html +++ b/static/website/templates/notify.html @@ -1,6 +1,14 @@ <div class="notification"> - <a href=""><strong>{{ reply.user }}</strong> replies to <strong>{{ question.title }}</strong></a> / - {{ reply.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> diff --git a/static/website/templates/recent-questions.html b/static/website/templates/recent-questions.html new file mode 100644 index 0000000..e5661c1 --- /dev/null +++ b/static/website/templates/recent-questions.html @@ -0,0 +1,106 @@ +{% endblock content %} +{% extends 'website/templates/base.html' %} +{% load static %} +{% block content %} +{% load count_tags %} +<h4><u>Recent Questions</u></h4> +<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> + {% if total > 25 %} + <ul class="pagination pull-right"> + {% for i in total|get_range:"0,10" %} + <li> + <a href="{% url 'website:home' %}?marker={{ i }}"> + {% if i == marker %} + <strong>{{ i|div:"10"|inc }}</strong> + {% else %} + {{ i|div:"10"|inc }} + {% endif %} + </a> + </li> + {% endfor %} + </ul> + {% endif %} + +{% endblock %} + +{% block javascript %} +<script> + $('span').tooltip(); +</script> +{% endblock %} diff --git a/static/website/templates/recent_questions.html b/static/website/templates/recent_questions.html deleted file mode 100644 index 1a4cc44..0000000 --- a/static/website/templates/recent_questions.html +++ /dev/null @@ -1,5 +0,0 @@ -<ul> -{% for question in recent_questions %} - <li>{{question.title}}</li> -{% endfor %} -</ul> diff --git a/static/website/templates/user-replies.html b/static/website/templates/user-answers.html index 8be85fa..34a1c68 100644 --- a/static/website/templates/user-replies.html +++ b/static/website/templates/user-answers.html @@ -1,17 +1,17 @@ {% extends 'website/templates/base.html' %} {% load count_tags %} {% block content %} - <h4>My Replies</h4> - {% for reply in replies%} - <div class="my-reply"> + <h4>My Answers</h4> + {% for answer in answers%} + <div class="my-answer"> <span class="body"> - <a href="{% url 'website:get_question' reply.question.id %}#reply{{ reply.id }}">{{ reply.body|safe }}</a> + <a href="{% url 'website:get_question' answer.question.id %}#answer{{ answer.id }}">{{ answer.body|safe }}</a> </span> <br> <span class="date"> <small> Replied on: - {{ reply.date_created }} + {{ answer.date_created }} </small> </span> </div> @@ -21,7 +21,7 @@ <ul class="pagination pull-right"> {% for i in total|get_range:"0,10" %} <li> - <a href="{% url 'website:user_replies' user.id %}?marker={{ i }}"> + <a href="{% url 'website:user_answers' user.id %}?marker={{ i }}"> {% if i == marker %} <strong>{{ i|div:"10"|inc }}</strong> {% else %} |