From a1fe768c6d40c7c885db1c9843c61527cbe583e3 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Sat, 20 Nov 2021 19:47:08 +0100 Subject: Rewrite view templates to use Pug engine. --- views/message_send.pug | 68 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 views/message_send.pug (limited to 'views/message_send.pug') diff --git a/views/message_send.pug b/views/message_send.pug new file mode 100644 index 0000000..c573ef6 --- /dev/null +++ b/views/message_send.pug @@ -0,0 +1,68 @@ +//- vim:ts=4:sw=4: +doctype html +html + head + include head + title Send Message + style. + input, textarea { width: min(45rem,100%) } + script. + function next(event,sel) { + if (event.keyCode === 13) { + document.querySelector(sel).focus(); + return false; + } + return true; + } + + body + include header + article + h1 Send Message + form(method="post" action="/message/send") + + p To: + br + input( + id="to" + type="text" + name="to" + required + size=80 + maxlength=80 + value=to_name + onpress="return next(event,'#subject')" + autofocus=(to_name === "") + ) + + p Subject: + br + input( + id="subject" + type="text" + name="subject" + required + size=80 + maxlength=80 + pattern=".*\\S+.*" + value=subject + onpress="return next(event,'#body')" + autofocus=(to_name !== "" && subject === "") + ) + + p Body: + br + textarea( + id="body" + name="body" + required + cols=80 + rows=20 + maxlength=32000 + autofocus=(to_name !== "" && subject !== "") + ) + | + | #{body} + + p + button(type="submit") Send -- cgit v1.2.3