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