From 043b1cdefa6d82a3a31f1d22f37f56f9b36feea7 Mon Sep 17 00:00:00 2001 From: Adrian Cochrane Date: Sat, 4 Nov 2023 14:05:42 +1300 Subject: [PATCH] Implement tel input type --- form.html | 1 + src/Text/HTML/Form/WebApp.hs | 2 ++ tpl/number.html | 32 ++++++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+) create mode 100644 tpl/number.html diff --git a/form.html b/form.html index baac475..184277e 100644 --- a/form.html +++ b/form.html @@ -13,6 +13,7 @@ + diff --git a/src/Text/HTML/Form/WebApp.hs b/src/Text/HTML/Form/WebApp.hs index 6dd79a8..ac643dc 100644 --- a/src/Text/HTML/Form/WebApp.hs +++ b/src/Text/HTML/Form/WebApp.hs @@ -104,6 +104,8 @@ renderInput form ix input@Input { inputType="file" } path qs = do "link" ~> ('/':show ix ++ '/':L.intercalate "/" path') ] doesDirectoryExist' parent file = doesDirectoryExist $ parent file +renderInput form ix input@Input { inputType = "tel" } [] qs = + template "number.html" form ix input qs renderInput form ix input [keyboard] qs = renderInput form ix input [keyboard, ""] qs renderInput form ix input [keyboard, ""] qs | Just (Just _) <- resolveSource path = diff --git a/tpl/number.html b/tpl/number.html new file mode 100644 index 0000000..992d576 --- /dev/null +++ b/tpl/number.html @@ -0,0 +1,32 @@ +{% extends "base.html" %} + +{%- block control -%}
+

{{ input.value }}

+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
789-
456SPACE
123DEL
*0#.
+
{%- endblock -%} -- 2.30.2