diff options
Diffstat (limited to 'views.rkt')
| -rw-r--r-- | views.rkt | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -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") |