From 611b9aa100d1135f04cde572115a5ea1f680ad72 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sun, 14 Jul 2024 15:13:20 +0200 Subject: Add user search. --- views/contacts.pug | 4 ++++ views/search_user.pug | 31 +++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 views/search_user.pug (limited to 'views') diff --git a/views/contacts.pug b/views/contacts.pug index 8b42e73..a3ca8d0 100644 --- a/views/contacts.pug +++ b/views/contacts.pug @@ -51,3 +51,7 @@ html else tr td Nobody + + p + form(method="get" action="/contacts/search") + input(type="text" name="q" size=40 placeholder="Find user..." required) diff --git a/views/search_user.pug b/views/search_user.pug new file mode 100644 index 0000000..bc67cf6 --- /dev/null +++ b/views/search_user.pug @@ -0,0 +1,31 @@ +//- vim:ts=4:sw=4: +doctype html +html + head + include head + title User Search Results + body + include header + article + + h1 User Search Results + + if results && search + if results.length > 0 + table.half.striped + thead + tr + th Name + th Last seen + tbody + each who in results + tr + td + a.black(href="/user/"+who.name)= who.name + td.w= who.atime + else + p.error Nobody found matching "#{search}". + + p + form(method="get" action="/contacts/search") + input(type="text" name="q" size=40 placeholder="Find user..." value=search required) -- cgit v1.2.3