summaryrefslogtreecommitdiff
path: root/views/message_send.pug
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2021-11-20 19:47:08 +0100
committerTor Andersson <tor@ccxvii.net>2021-11-21 12:48:15 +0100
commita1fe768c6d40c7c885db1c9843c61527cbe583e3 (patch)
treec397e7d6796049607d6348c538621d1e8809a847 /views/message_send.pug
parentd1318d147297161691f5048e1f2cb4e516159144 (diff)
downloadserver-a1fe768c6d40c7c885db1c9843c61527cbe583e3.tar.gz
Rewrite view templates to use Pug engine.
Diffstat (limited to 'views/message_send.pug')
-rw-r--r--views/message_send.pug68
1 files changed, 68 insertions, 0 deletions
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