diff options
| author | stuebinm | 2026-03-08 21:29:37 +0100 |
|---|---|---|
| committer | stuebinm | 2026-03-08 21:31:19 +0100 |
| commit | 699c0e04de96dfe25714b87758c1a151c3ee2408 (patch) | |
| tree | 446f08af7d895983981d158f32771fe0520e0557 /app/Main.hs | |
| parent | 83031c010be0ed73f45ba5975d16cb05a1638ff1 (diff) | |
helptext: add little html input formrnv
Diffstat (limited to 'app/Main.hs')
| -rw-r--r-- | app/Main.hs | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/app/Main.hs b/app/Main.hs index 9ee0209..0f2e3e7 100644 --- a/app/Main.hs +++ b/app/Main.hs @@ -228,13 +228,23 @@ app AppData{..} request respond = mkAnswer >>= (respond . toResponse) Exact (_,match) -> lookupName match ril100map & maybe None Exact Fuzzy (_,match) -> Fuzzy (ril100BaseUrl <> "/" <> match) - helptext = Plaintext $ "\ + helptext = Html $ "\ + \<pre>\ \ril100 → Name: " <> ril100BaseUrl <> "/RM\n\ \Name → ril100: " <> ril100BaseUrl <> "/Mannheim\n\n\ \Leitpunkt → Name: " <> leitpunktBaseUrl <> "/MA\n\ - \Name → Leitpunkt: " <> leitpunktBaseUrl <> "/Mannheim\n\n\ + \Name → Leitpunkt: " <> leitpunktBaseUrl <> "/Mannheim\n\ + \</pre>\ + \<form id=\"form1\"><input id=\"query\" type=\"text\" \ + \oninput=\"document.getElementById('form1').action = '/' + this.value\">\ + \<input type=\"submit\" value=\"search\"></form>\ + \<pre>\ \Am selben Bahnsteig gegenüber:\n\ - \ " <> ril100BaseUrl <> "/RM/gleis" + \ " <> ril100BaseUrl <> "/RM/gleis\n\ + \</pre>\ + \<form id=\"form2\"><input id=\"query\" type=\"text\" \ + \oninput=\"document.getElementById('form2').action = '/' + this.value + '/gleis'\">\ + \<input type=\"submit\" value=\"search\"></form>" host = head (BS.split (fromIntegral (ord '.')) rawHost) where rawHost = case lookup "x-forwarded-host" $ requestHeaders request of Nothing -> fromMaybe "" $ requestHeaderHost request |
