diff options
author | osmarks <osmarks> | 2021-06-14 18:06:48 +0000 |
---|---|---|
committer | osmarks <osmarks> | 2021-06-14 18:06:48 +0000 |
commit | 1f447eda8ed0fb1ba7c4ff6da8d40fe56aaddabf (patch) | |
tree | f33666313dd1f356923115dda97c474c5cb0f9ea /apioforum/templates | |
parent | 5d394e581b108eaf1470d5d00b1699d6ade25b4c (diff) |
Implement search (SQLite FTS5)
Diffstat (limited to 'apioforum/templates')
-rw-r--r-- | apioforum/templates/common.html | 2 | ||||
-rw-r--r-- | apioforum/templates/search_results.html | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/apioforum/templates/common.html b/apioforum/templates/common.html index 2206ac3..fc41410 100644 --- a/apioforum/templates/common.html +++ b/apioforum/templates/common.html @@ -14,7 +14,7 @@ <a class="actionbutton" href="{{url_for('thread.delete_post',post_id=post.id)}}">delete</a> {% endif %} - <a class="post-anchor-link" href="#post_{{post.id}}">#{{post.id}}</a> + <a class="post-anchor-link" href="{{url_for('thread.view_thread', thread_id=post.thread)}}}#post_{{post.id}}">#{{post.id}}</a> </span> </div> <div class="post-content"> diff --git a/apioforum/templates/search_results.html b/apioforum/templates/search_results.html new file mode 100644 index 0000000..7035e8f --- /dev/null +++ b/apioforum/templates/search_results.html @@ -0,0 +1,18 @@ +{% from 'common.html' import disp_post %} +{% extends 'base.html' %} +{% block header %} +<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> + {% endif %} + {% call disp_post(result, True) %} + {{ rendered_posts[loop.index0] | safe}} + {% endcall %} + {% endfor %} +</div> +{% endblock %} |