summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2023-03-16 22:19:54 +0100
committerTor Andersson <tor@ccxvii.net>2023-04-18 10:06:13 +0200
commit8f95aa8d593c284a153a20e01ef3050343118c05 (patch)
tree484dccb3a66624a9413a9b75ba9da2b3f9b60525 /views
parent44b2fed796f846bafd48b74c7a7d363d33b29258 (diff)
downloadserver-8f95aa8d593c284a153a20e01ef3050343118c05.tar.gz
Forum search using FTS5.
Diffstat (limited to 'views')
-rw-r--r--views/forum_search.pug28
-rw-r--r--views/forum_view.pug7
-rw-r--r--views/head.pug2
3 files changed, 35 insertions, 2 deletions
diff --git a/views/forum_search.pug b/views/forum_search.pug
new file mode 100644
index 0000000..1301b76
--- /dev/null
+++ b/views/forum_search.pug
@@ -0,0 +1,28 @@
+//- vim:ts=4:sw=4:
+doctype html
+html
+ head
+ include head
+ title Forum Search Results
+ body
+ include header
+ article
+ h1 Forum Search Results
+
+ table
+ thead
+ tr
+ th Author
+ th Thread
+ th Snippet
+ tobdy
+ each row in results
+ tr
+ td: a(href="/user/"+row.author)= row.author
+ td: a(href="/forum/thread/"+row.thread_id+"#"+row.post_id)= row.subject
+ td= row.snippet
+
+ if user
+ p
+ form(method="get" action="/forum/search")
+ input(type="text" name="q" size=40 maxlength=80 placeholder="Search..." required)
diff --git a/views/forum_view.pug b/views/forum_view.pug
index 46c1b1e..33be0ad 100644
--- a/views/forum_view.pug
+++ b/views/forum_view.pug
@@ -43,4 +43,9 @@ html
| #[a(href="/forum/page/"+(current_page+1)) &#x2192;]
if user
- p: a(href="/forum/post") New thread
+ p
+ form(method="get" action="/forum/search")
+ input(type="text" name="q" size=40 maxlength=80 placeholder="Search..." required)
+ if user
+ p
+ a(href="/forum/post") New thread
diff --git a/views/head.pug b/views/head.pug
index 3d2285a..e90ce6b 100644
--- a/views/head.pug
+++ b/views/head.pug
@@ -19,7 +19,7 @@ mixin gamecover(title_id)
img(src=`/${title_id}/cover.1x.jpg` srcset=`/${title_id}/cover.2x.jpg 2x`)
mixin forumpost(row,show_buttons)
- .post
+ .post(id=row.post_id)
.head
.from: a(href="/user/"+row.author_name)= row.author_name
.time= row.ctime