summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--static/website/templates/ajax-keyword-search.html49
-rw-r--r--static/website/templates/filter.html4
-rw-r--r--website/views.py8
3 files changed, 19 insertions, 42 deletions
diff --git a/static/website/templates/ajax-keyword-search.html b/static/website/templates/ajax-keyword-search.html
index 6200d95..a8e98aa 100644
--- a/static/website/templates/ajax-keyword-search.html
+++ b/static/website/templates/ajax-keyword-search.html
@@ -8,7 +8,7 @@
<br>
<table class="table table-striped table-bordered table-hover">
<th> FOSS </th>
- <th> Question</th>
+ <th> Question<span class="glyphicon glyphicon-link"></span></th>
<th> Date</th>
<th> Views</th>
<th> Answers</th>
@@ -17,45 +17,18 @@
{% 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>
+ <span class="category" data-toggle="tooltip" data-placement="top" title="{{ question.category }}">
+ <a class="pull-left" href="{% url 'website:filter' question.category %}?qid={{ question.id }}">
+ {{ question.category|truncatechars:12 }} </a>
+ </span>
+ </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 class="question" data-toggle="tooltip" data-placement="top" title="{{ question.title }}">
+ <a href="{% url 'website:get_question' question.id %}{% prettify question.title %}">{{ question.title|truncatechars:40 }}</a>
+ </span>
+ </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 %}{% prettify question.title %}">{{ question.title|truncatechars:40 }}</a>
- </span>
- </td>
<td>
<span>
diff --git a/static/website/templates/filter.html b/static/website/templates/filter.html
index d0c57f0..f04f226 100644
--- a/static/website/templates/filter.html
+++ b/static/website/templates/filter.html
@@ -27,7 +27,7 @@
<table class="table table-bordered">
<th> FOSS </th>
- <th> Question</th>
+ <th> Question <span class="glyphicon glyphicon-link"></span></th>
<th> Date</th>
<th> Views</th>
<th> Answers</th>
@@ -35,7 +35,7 @@
{% for question in questions %}
<tr {% if question.id == qid %}class="parent-filter"{% endif %}>
<td>
- <span class="category" data-toggle="tooltip" data-placement="top" title="{{ question.category}}">
+ <span class="category" data-toggle="tooltip" data-placement="top" title="{{ question.category }}">
<a class="pull-left" href="{% url 'website:filter' question.category %}?qid={{ question.id }}">
{{ question.category|truncatechars:12 }} </a>
</span>
diff --git a/website/views.py b/website/views.py
index 516c7d4..603a4c7 100644
--- a/website/views.py
+++ b/website/views.py
@@ -21,7 +21,7 @@ from django.db.models import Count
admins = (
- 9, 4376, 4915, 14595, 12329, 22467, 5518, 30705
+ 9, 4376, 4915, 14595, 12329, 22467, 5518, 30705
)
categories = FossCategory.objects.order_by('name')
@@ -497,10 +497,14 @@ def ajax_notification_remove(request):
def ajax_keyword_search(request):
if request.method == "POST":
key = request.POST['key']
- questions = Question.objects.filter(title__icontains=key)
+
+ questions = Question.objects.filter(title__contains=key)
+
context = {
'questions': questions
}
+
+
return render(request, 'website/templates/ajax-keyword-search.html', context)
@csrf_exempt