clean code

This commit is contained in:
pena 2022-12-06 00:12:14 +01:00 committed by Swrup
parent 5ec03d06c2
commit ee626ccd61
24 changed files with 99 additions and 894 deletions

View file

@ -1,7 +1,12 @@
open Tyxml.Html
let csrf_tag request =
let open Tyxml.Html in
let token = Dream.csrf_token request in
input ~a:[ a_name "dream.csrf"; a_input_type `Hidden; a_value token ] ()
let make_input_text id = input ~a:[ a_id id; a_name id; a_input_type `Text ] ()
let make_form request ~action ~items =
(* TODO labels ...? *)
form ~a:[ a_action action; a_method `Post ] (Util.csrf_tag request :: items)
form ~a:[ a_action action; a_method `Post ] (csrf_tag request :: items)