aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorubq323 <ubq323>2021-06-14 18:46:09 +0000
committerubq323 <ubq323>2021-06-14 18:46:09 +0000
commit854b1a93b65b39583e2bf845867ade9a58cb22c2 (patch)
tree9c4da9533c23828f09516b2830820831eaa9a76f
parentf9c6526cdfabdea7352dfd499e041b8ad4de0f01 (diff)
fix search results styling and template logic slightly
-rw-r--r--apioforum/templates/search_results.html18
1 files changed, 15 insertions, 3 deletions
diff --git a/apioforum/templates/search_results.html b/apioforum/templates/search_results.html
index 7035e8f..4d0be2f 100644
--- a/apioforum/templates/search_results.html
+++ b/apioforum/templates/search_results.html
@@ -1,18 +1,30 @@
{% from 'common.html' import disp_post %}
{% extends 'base.html' %}
{% block header %}
-<h1>{%block title %}Results for {{query}}{% endblock %}</h1>
+<h1>{%block title %}results for {{query}}{% endblock %}</h1>
{% endblock %}
{%block content%}
<div class="results">
{% for result in results %}
{% if display_thread_id[loop.index0] %}
- <h3><a href="{{url_for('thread.view_thread', thread_id=result.thread)}}">{{ result.thread_title }}</a></h3>
+ {% if loop.index0 != 0 %}
+ </div>
+ {% endif %}
+ <h3><a href="{{url_for('thread.view_thread', thread_id=result.thread)}}">
+ {{result.thread_title}}
+ </a></h3>
+ <div class="posts">
{% endif %}
- {% call disp_post(result, True) %}
+ {% call disp_post(result, False) %}
{{ rendered_posts[loop.index0] | safe}}
{% endcall %}
{% endfor %}
+
+ {% if results|length > 0 %}
+ </div>
+ {% else %}
+ <p>no results were found for '{{query}}'.</p>
+ {% endif %}
</div>
{% endblock %}