summaryrefslogtreecommitdiff
path: root/static/website/templates
diff options
context:
space:
mode:
Diffstat (limited to 'static/website/templates')
-rw-r--r--static/website/templates/base.html2
-rw-r--r--static/website/templates/get-question.html31
-rw-r--r--static/website/templates/index.html115
-rw-r--r--static/website/templates/recent-questions.html106
4 files changed, 149 insertions, 105 deletions
diff --git a/static/website/templates/base.html b/static/website/templates/base.html
index 286a2ec..97b9194 100644
--- a/static/website/templates/base.html
+++ b/static/website/templates/base.html
@@ -23,7 +23,7 @@
<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 -->
diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html
index 3d2d3f0..48aa427 100644
--- a/static/website/templates/get-question.html
+++ b/static/website/templates/get-question.html
@@ -73,7 +73,7 @@
<span class="meta">
<small>
<i>
- {{ question.date_created|date:"y-d-m" }}, {{ question.date_created|time }}
+ {{ question.date_created|date:"d-m-y" }}, {{ question.date_created|time }}
</i>
</small>
@@ -125,15 +125,31 @@
{{ comment.body|safe }}
</div>
- <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 class="meta">
+ <small>
+ <i>
+ {{ question.date_created|date:"d-m-y" }}, {{ question.date_created|time }}
+ </i>
+ </small>
+
+ <span class="user">
+ {{ question.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>
@@ -147,6 +163,12 @@
<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>
@@ -246,6 +268,7 @@
<option value="Tux-Typing">Tux-Typing</option>
<option value="What-is-Spoken-Tutorial">What-is-Spoken-Tutorial</option>
<option value="Xfig">Xfig</option>
+ <option value="General">General FOSS</option>
</select>
</div>
<div class="col-lg-4 col-md-4 col-sm-4">
diff --git a/static/website/templates/index.html b/static/website/templates/index.html
index af97707..6e7af78 100644
--- a/static/website/templates/index.html
+++ b/static/website/templates/index.html
@@ -1,104 +1,19 @@
{% 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>
+<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>
+ </div>
+ </div>
{% 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>
+</div>
{% endblock %}
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 %}