diff options
| author | Marius Peter <dev@marius-peter.com> | 2025-12-13 17:56:12 +0100 |
|---|---|---|
| committer | Marius Peter <dev@marius-peter.com> | 2025-12-13 17:56:12 +0100 |
| commit | 11ff437e30206bcb2c73c6412eaadab56f9be8f5 (patch) | |
| tree | 7be42f1248661c6fedae10889f913c734f5d22db | |
| parent | 3b7f77480ab5b5fe1a14bfba7a6f1b486aaa9a0a (diff) | |
Add form-page-template helper.
| -rw-r--r-- | views.rkt | 22 |
1 files changed, 8 insertions, 14 deletions
@@ -80,7 +80,7 @@ (define (normal-date date-string) (~t (iso8601->date date-string) "dd/MM/yyyy")) -;; Pages +;; Ferti (define (ferti-template body-xexpr) (page-template "Ferti" `((h1 ((class "display-1 mb-3")) "Ferti") ,ferti-tabs ,@body-xexpr))) @@ -186,9 +186,6 @@ "Ajouter un profil") ,table))) -(define (new-measurement-page) - (page-template "Nouveau relevé" - `((h1 ((class "display-1 mb-3")) "Nouveau relevé") ;; New (define (form-page-template title action formlet) @@ -197,20 +194,17 @@ (div ((class "mb-3") [style "max-width: 30em"]) (form ([action ,action] [method "POST"]) ,@(formlet-display formlet)))))) +(define (new-measurement-page) + (form-page-template "Nouveau relevé" "/ferti/measurements/create" (measurements-formlet))) (define (new-rotation-page #:date [date-string #f]) - (page-template "Nouvel assolement" - `((h1 ((class "display-1 mb-3")) "Nouvel assolement") - (div ((class "mb-3") [style "max-width: 30em"]) - (form ([action "/ferti/rotations/create"] [method "POST"]) - ,@(formlet-display (rotation-formlet #:date date-string))))))) + (form-page-template "Nouvel assolement" + "/ferti/rotations/create" + (rotation-formlet #:date date-string))) (define (new-fertilizer-page) - (page-template "Nouvel intrant" - `((h1 ((class "display-1 mb-3")) "Nouvel intrant") - (div ((class "mb-3") [style "max-width: 30em"]) - (form ([action "/ferti/fertilizers/create"] [method "POST"]) - ,@(formlet-display (fertilizer-formlet))))))) + (form-page-template "Nouvel intrant" "/ferti/fertilizers/create" (fertilizer-formlet))) + ;; Edit (define (edit-fertilizer-page fp) |