From 510729b256403691c112d8920ee67575b8c125ef Mon Sep 17 00:00:00 2001 From: Marius Peter Date: Sat, 13 Dec 2025 17:57:53 +0100 Subject: Align handler routes to Rails conventions. --- views.rkt | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'views.rkt') diff --git a/views.rkt b/views.rkt index b4292c1..0258157 100644 --- a/views.rkt +++ b/views.rkt @@ -226,12 +226,15 @@ (define nutrient-value (hash-ref (nutrient-measurement-values nm) n 0)) `(tr (td ,(nutrient-french-name n)) (td ((class "text-end font-monospace")) ,(round 2 nutrient-value))))))) - (page-template title - `((h1 ((class "display-1 mb-3")) ,title) - (a ((class "btn btn-danger") - [href ,(format "/ferti/measurements/destroy/~a" (nutrient-measurement-id nm))]) - "Supprimer relevé") - ,table))) + (define button-group + `(div ((class "btn-group")) + (a ((class "btn btn-primary") + [href ,(format "/ferti/measurements/~a/edit" (nutrient-measurement-id nm))]) + "Modifier relevé") + (a ((class "btn btn-danger") + [href ,(format "/ferti/measurements/~a/destroy" (nutrient-measurement-id nm))]) + "Supprimer relevé"))) + (page-template title `((h1 ((class "display-1 mb-3")) ,title) ,button-group ,table))) (define (show-rotation-page cr) (define title (format "Assolement du ~a" (normal-date (crop-rotation-date cr)))) @@ -247,7 +250,7 @@ (page-template title `((h1 ((class "display-1 mb-3")) ,title) (a ((class "btn btn-danger") - [href ,(format "/ferti/rotations/destroy/~a" (crop-rotation-id cr))]) + [href ,(format "/ferti/rotations/~a/destroy" (crop-rotation-id cr))]) "Supprimer assolement") ,table))) -- cgit v1.2.3