summaryrefslogtreecommitdiff
path: root/views.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'views.rkt')
-rw-r--r--views.rkt25
1 files changed, 15 insertions, 10 deletions
diff --git a/views.rkt b/views.rkt
index a379f1d..cd33cad 100644
--- a/views.rkt
+++ b/views.rkt
@@ -83,16 +83,21 @@
(a ((class "btn btn-outline-primary") [href "/fertilizer/new"]) "Ajouter un intrant")))
(define (ferti-recipe ferti-recipe)
- `((h2 () "Recette") ,(if (ormap (λ (pair) (not (zero? (cdr pair)))) ferti-recipe)
- `(table ((class "table"))
- (tr (th "Intrant") (th ((class "text-end")) "Quantité (g/L)"))
- ,@(for/list ([fertilizer-amount ferti-recipe]
- #:when (not (zero? (cdr fertilizer-amount))))
- (match-define (cons fertilizer amount) fertilizer-amount)
- `(tr (td () ,(fertilizer-name fertilizer))
- (td ((class "text-end font-monospace"))
- ,(round 2 amount)))))
- `(p "La recette Ferti requiert au moins un relevé et une cible."))))
+ `((h2 () "Recette")
+ ,(if (ormap (λ (pair) (not (zero? (cdr pair)))) ferti-recipe)
+ `(table ((class "table"))
+ (tr (th "Intrant") (th ((class "text-end")) "Quantité (g/L)"))
+ ,@(for/list ([fertilizer-amount ferti-recipe]
+ #:when (not (zero? (cdr fertilizer-amount))))
+ (match-define (cons fertilizer amount) fertilizer-amount)
+ `(tr (td ()
+ ,(let ([canonical-name (fertilizer-name fertilizer)]
+ [brand-name (fertilizer-brand-name fertilizer)])
+ (if brand-name
+ (format "~a (~a)" brand-name canonical-name)
+ canonical-name)))
+ (td ((class "text-end font-monospace")) ,(round 2 amount)))))
+ `(p "La recette Ferti requiert au moins un relevé et une cible."))))
(define (ferti-targets latest-measurement-hash latest-target-hash)
`((h2 () "Dernière Cible")
Copyright 2019--2026 Marius PETER