summaryrefslogtreecommitdiff
path: root/static/website/templates
diff options
context:
space:
mode:
Diffstat (limited to 'static/website/templates')
-rw-r--r--static/website/templates/base.html3
-rw-r--r--static/website/templates/filter.html86
-rw-r--r--static/website/templates/get-question.html74
-rw-r--r--static/website/templates/index.html30
-rw-r--r--static/website/templates/new-question.html6
5 files changed, 190 insertions, 9 deletions
diff --git a/static/website/templates/base.html b/static/website/templates/base.html
index f89417f..8d95162 100644
--- a/static/website/templates/base.html
+++ b/static/website/templates/base.html
@@ -24,7 +24,8 @@
<!-- 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">
- <li><a href="#">Home</a></li>
+ <li><a href="{% url 'website:home' %}">Home</a></li>
+ <li><a href="{% url 'website:new_question' %}">Ask Question</a></li>
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">Dropdown <b class="caret"></b></a>
<ul class="dropdown-menu">
diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html
new file mode 100644
index 0000000..5d6fbb3
--- /dev/null
+++ b/static/website/templates/filter.html
@@ -0,0 +1,86 @@
+{% extends 'website/templates/base.html' %}
+{% block content %}
+
+{% if question %}
+ <div class="question">
+ <div class="title">
+ <a href="{% url 'website:get_question' question.id %}">{{ question.title }}</a>
+ </div>
+
+ <span class="category">
+ <small>
+ <a href="{% url 'website:filter' question.category %}?qid={{ question.id }}">
+ {{ question.category }}
+ </a>
+ </small>
+ </span>
+
+ <span class="tutorial">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial %}?qid={{ question.id }}">
+ {{ question.tutorial}}
+ </a>
+ </small>
+ </span>
+
+ <span class="minute_range">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range %}?qid={{ question.id }}">
+ {{ question.minute_range }} min
+ </a>
+ </small>
+ </span>
+
+ <span class="second_range">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range question.second_range%}?qid={{ question.id }}">
+ {{ question.second_range }} sec
+ </a>
+ </small>
+ </span>
+ </div>
+{% endif %}
+
+<h5>You might also want to take a look at:</h5>
+{% if questions %}
+ {% for question in questions %}
+ <div class="question">
+ <div class="title">
+ <a href="{% url 'website:get_question' question.id %}">{{ question.title }}</a>
+ </div>
+
+ <span class="category">
+ <small>
+ <a href="{% url 'website:filter' question.category %}?qid={{ question.id }}">
+ {{ question.category }}
+ </a>
+ </small>
+ </span>
+
+ <span class="tutorial">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial %}?qid={{ question.id }}">
+ {{ question.tutorial}}
+ </a>
+ </small>
+ </span>
+
+ <span class="minute_range">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range %}?qid={{ question.id }}">
+ {{ question.minute_range }} min
+ </a>
+ </small>
+ </span>
+
+ <span class="second_range">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range question.second_range%}?qid={{ question.id }}">
+ {{ question.second_range }} sec
+ </a>
+ </small>
+ </span>
+ </div>
+ {% endfor %}
+{% endif %}
+{% endblock %}
diff --git a/static/website/templates/get-question.html b/static/website/templates/get-question.html
new file mode 100644
index 0000000..b05704f
--- /dev/null
+++ b/static/website/templates/get-question.html
@@ -0,0 +1,74 @@
+{% extends 'website/templates/base.html' %}
+{% load widget_tweaks %}
+{% block content %}
+<div class="question">
+ <div class="title">
+ <a href=""> {{ question.title }} </a>
+ </div>
+
+ <div class="body">
+ {{ question.body }}
+ </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">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range %}">
+ {{ question.minute_range }} min
+ </a>
+ </small>
+ </span>
+
+ <span class="second_range">
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range question.second_range%}">
+ {{ question.second_range }} sec
+ </a>
+ </small>
+ </span>
+
+</div>
+
+{% for reply in replies %}
+ <div class="reply">
+ <span class="body">
+ {{ reply.body }}
+ </span>
+
+ <span class="user">
+ {{ reply.user }}
+ </span>
+ </div>
+{% endfor %}
+
+<form action="{% url 'website:question_reply' %}" 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>
+ {% render_field form.body class+='form-control' %}
+ </div>
+ </div>
+ </div>
+ {% endwith %}
+ <input class="btn btn-info" type="submit" value="Submit Reply">
+</form>
+
+{% endblock %}
diff --git a/static/website/templates/index.html b/static/website/templates/index.html
index c54b637..ddc9078 100644
--- a/static/website/templates/index.html
+++ b/static/website/templates/index.html
@@ -4,24 +4,40 @@
{% for question in questions %}
<div class="question">
<div class="title">
- <a href="">{{ question.title }}</a>
+ <a href="{% url 'website:get_question' question.id %}">{{ question.title }}</a>
</div>
-
+ <br>
<span class="category">
- <small>{{ question.category }}</small>
+ <small>
+ <a href="{% url 'website:filter' question.category %}?qid={{ question.id }}">
+ {{ question.category }}
+ </a>
+ </small>
</span>
<span class="tutorial">
- <small>{{ question.tutorial}}</small>
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial %}?qid={{ question.id }}">
+ {{ question.tutorial}}
+ </a>
+ </small>
</span>
<span class="minute_range">
- <small>{{ question.minute_range }} min</small>
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range %}?qid={{ question.id }}">
+ {{ question.minute_range }} min
+ </a>
+ </small>
</span>
<span class="second_range">
- <small>{{ question.second_range }} sec</small>
+ <small>
+ <a href="{% url 'website:filter' question.category question.tutorial question.minute_range question.second_range%}?qid={{ question.id }}">
+ {{ question.second_range }} sec
+ </a>
+ </small>
</span>
- </div>
+ </div> <!-- /.question -->
{% endfor %}
{% endblock %}
diff --git a/static/website/templates/new-question.html b/static/website/templates/new-question.html
index 5005e13..81da5cf 100644
--- a/static/website/templates/new-question.html
+++ b/static/website/templates/new-question.html
@@ -1,4 +1,5 @@
{% extends 'website/templates/base.html' %}
+{% load static %}
{% load widget_tweaks %}
{% block content %}
<h4>
@@ -9,7 +10,10 @@
<form role="form" action="" method="POST">{% csrf_token %}
{% with WIDGET_ERROR_CLASS='field_error' %}
- <p>Please enter the tutorial details.</p>
+ <p>
+ Please enter the tutorial details.
+ <img id="ajax-loader" src="{% static 'website/images/ajax-loader.gif' %}" style="display:none;">
+ </p>
<div class="row">
<div class="col-lg-3 col-md-4 col-sm-4">
{% render_field form.category class+="form-control"%}