diff options
author | Tor Andersson <tor@ccxvii.net> | 2024-07-14 15:13:20 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2024-07-23 13:47:44 +0200 |
commit | 611b9aa100d1135f04cde572115a5ea1f680ad72 (patch) | |
tree | 26259360ebc5066b697470e760c8b5284fca9b63 /views | |
parent | 4ef9dd7d665248e308024e75c0921aabe646d07a (diff) | |
download | server-611b9aa100d1135f04cde572115a5ea1f680ad72.tar.gz |
Add user search.
Diffstat (limited to 'views')
-rw-r--r-- | views/contacts.pug | 4 | ||||
-rw-r--r-- | views/search_user.pug | 31 |
2 files changed, 35 insertions, 0 deletions
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) |