Avoid displaying recipe table if recipe does not exist.

Commit
78287b13a960e7a5462416813a3ab333ded57c82
Author
Marius Peter <dev@marius-peter.com>
Author date
Committer
Marius Peter <dev@marius-peter.com>
Committer date
views.rkt
index d2fd2459..172aab3e 100644..100644
@@ -116,14 +116,16 @@
116 116 ;;;;;;;;
117 117
118 118 (h2 () "Recette")
119 Removed: (table ([class "table"])
120 Removed: (tr (th () "Produit Fertilisant")
121 Removed: (th ([class "text-end"]) "Quantité"))
122 Removed: ,@(for/list ([fertilizer-amount ferti-recipe]
123 Removed: #:when (not (zero? (cdr fertilizer-amount))))
124 Removed: (match-define (cons fertilizer amount) fertilizer-amount)
125 Removed: `(tr (td () ,(fertilizer-name fertilizer))
126 Removed: (td ([class "text-end font-monospace"]) ,(round 2 amount)))))
119 Added: ,(if (ormap (λ (pair) (not (zero? (cdr pair)))) ferti-recipe)
120 Added: `(table ([class "table"])
121 Added: (tr (th "Intrant")
122 Added: (th ([class "text-end"]) "Quantité (g/L)"))
123 Added: ,@(for/list ([fertilizer-amount ferti-recipe]
124 Added: #:when (not (zero? (cdr fertilizer-amount))))
125 Added: (match-define (cons fertilizer amount) fertilizer-amount)
126 Added: `(tr (td () ,(fertilizer-name fertilizer))
127 Added: (td ([class "text-end font-monospace"]) ,(round 2 amount)))))
128 Added: `(p "La recette Ferti requiert au moins un relevé et une cible."))
127 129
128 130
129 131 ;;;;;;;;;