summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Peter <dev@marius-peter.com>2025-12-13 22:29:22 +0100
committerMarius Peter <dev@marius-peter.com>2025-12-13 22:29:22 +0100
commita69dc8c3784145babd5cb8d0bab5ebb250a01b46 (patch)
tree5f2231734a1083d2dbe6bca40a622da688d530b3
parenta21dbe04c68adf6a89b8eb1b6e75e87a0cdf62f1 (diff)
Ensure usage of em-dash if brand-name is absent or empty.
-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