clean code
This commit is contained in:
parent
5ec03d06c2
commit
ee626ccd61
24 changed files with 99 additions and 894 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue