summaryrefslogtreecommitdiff
path: root/static/website/templates
diff options
context:
space:
mode:
authorJayaram Pai2014-04-20 16:29:29 +0530
committerJayaram Pai2014-04-20 16:29:29 +0530
commita89a21f56fcc46bbf1049190959d343c3f9b1ce1 (patch)
treee94a1379b830d20e7aecec09315707795d533a2f /static/website/templates
parent4614a1fa876a5ee2b089879a5bc46d1ab0ae7294 (diff)
downloadspoken-tutorial-forums-a89a21f56fcc46bbf1049190959d343c3f9b1ce1.tar.gz
spoken-tutorial-forums-a89a21f56fcc46bbf1049190959d343c3f9b1ce1.tar.bz2
spoken-tutorial-forums-a89a21f56fcc46bbf1049190959d343c3f9b1ce1.zip
added questions page, other minor fixes, nicedit configs
Diffstat (limited to 'static/website/templates')
-rw-r--r--static/website/templates/index.html7
-rw-r--r--static/website/templates/new-question.html2
-rw-r--r--static/website/templates/questions.html117
-rw-r--r--static/website/templates/recent-questions.html156
4 files changed, 202 insertions, 80 deletions
diff --git a/static/website/templates/index.html b/static/website/templates/index.html
index 4162e42..39afa9f 100644
--- a/static/website/templates/index.html
+++ b/static/website/templates/index.html
@@ -60,7 +60,12 @@
<br>
<div class="panel panel-default">
<div class="panel-heading">
- Recent Questions
+ Recent questions
+ <a class="pull-right" href="{% url 'website:questions' %}">
+ <small>
+ View all questions
+ </small>
+ </a>
</div>
<div class="panel-body">
<table class="table table-bordered table-hover">
diff --git a/static/website/templates/new-question.html b/static/website/templates/new-question.html
index 63ae19a..d9576bb 100644
--- a/static/website/templates/new-question.html
+++ b/static/website/templates/new-question.html
@@ -74,7 +74,7 @@
bkLib.onDomLoaded(function() {
new nicEditor({
iconsPath: "{% static 'website/js/nicEditorIcons.gif' %}",
- buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image', 'link']
+ buttonList : ['fontSize','bold','italic','underline','strikeThrough','subscript','superscript','html','image', 'link', 'forecolor', 'bgcolor']
}).panelInstance('id_body');
});
</script>
diff --git a/static/website/templates/questions.html b/static/website/templates/questions.html
new file mode 100644
index 0000000..c6c77e3
--- /dev/null
+++ b/static/website/templates/questions.html
@@ -0,0 +1,117 @@
+{% extends 'website/templates/base.html' %}
+{% load static %}
+{% load count_tags %}
+
+{% block content %}
+ <h4>
+ <h5>
+ Showing {{ questions.start_index }} - {{ questions.end_index }} of {{ questions.paginator.count }} questions.
+ </h5>
+ </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>
+
+ <ul class="pagination pull-right">
+ {% if questions.has_previous %}
+ <li><a href="?page={{ questions.previous_page_number }}">&laquo; <small>Prev</small></a></li>
+ {% else %}
+ <li class="disabled"><a href="#">&laquo;</a></li>
+ {% endif %}
+
+ {% for num in questions.paginator.page_range %}
+ {% ifequal num questions.number %}
+ <li class="active"><a href="#">{{ num }}<span class="sr-only">(current)</span></a></li>
+ {% else %}
+ <li><a href="?page={{ num }}">{{ num }}</a></li>
+ {% endifequal %}
+ {% endfor %}
+
+ {% if questions.has_next %}
+ <li><a href="?page={{ questions.next_page_number }}"><small>Next</small>&raquo;</a></li>
+ {% else %}
+ <li class="disabled"><a href="#">&raquo;</a></li>
+ {% endif %}
+ <ul>
+
+{% endblock %}
+
+{% block javascript %}
+<script>
+ $('span').tooltip();
+</script>
+{% endblock %}
diff --git a/static/website/templates/recent-questions.html b/static/website/templates/recent-questions.html
index e5661c1..3461908 100644
--- a/static/website/templates/recent-questions.html
+++ b/static/website/templates/recent-questions.html
@@ -1,91 +1,91 @@
-{% 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 }}
+{% block content %}
+ <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>
- </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 }}
+ </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>
- </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 %}
+ </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 %}
+ </table>
+ {% if total > 10 %}
<ul class="pagination pull-right">
{% for i in total|get_range:"0,10" %}
<li>
- <a href="{% url 'website:home' %}?marker={{ i }}">
+ <a href="{% url 'website:all_questions' %}?marker={{ i }}">
{% if i == marker %}
<strong>{{ i|div:"10"|inc }}</strong>
{% else %}