summaryrefslogtreecommitdiff
path: root/views.rkt
diff options
context:
space:
mode:
Diffstat (limited to 'views.rkt')
-rw-r--r--views.rkt10
1 files changed, 5 insertions, 5 deletions
diff --git a/views.rkt b/views.rkt
index 8dcbc16..965cab9 100644
--- a/views.rkt
+++ b/views.rkt
@@ -161,11 +161,11 @@
(define table
`(table ((class "table table-striped"))
(tr (th () "Nom de référence") (th () "Nom de marque"))
- ,@(for/list ([fertilizer fertilizers])
- `(tr (td (a ([href
- ,(format "/ferti/fertilizers/~a" (fertilizer-product-id fertilizer))])
- ,(fertilizer-product-name fertilizer)))
- (td ,(or (fertilizer-brand-name fertilizer) "—"))))))
+ ,@(for/list ([fp fertilizers])
+ (define brand-name (fertilizer-brand-name fp))
+ `(tr (td (a ([href ,(format "/ferti/fertilizers/~a" (fertilizer-product-id fp))])
+ ,(fertilizer-product-name fp)))
+ (td ,(if (and brand-name (non-empty-string? brand-name)) brand-name "—"))))))
(ferti-template `((h2 () "Intrants") (a ((class "btn btn-primary mb-3") [href
"/ferti/fertilizers/new"])
"Ajouter un intrant")
Copyright 2019--2026 Marius PETER