guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: Make it possible to show HTML for the invalid parameter messages


From: Christopher Baines
Subject: 02/03: Make it possible to show HTML for the invalid parameter messages
Date: Sat, 28 Nov 2020 14:40:05 -0500 (EST)

cbaines pushed a commit to branch master
in repository data-service.

commit cb871530cf80ffb647bf5ffe123524d46f2f9f2f
Author: Christopher Baines <mail@cbaines.net>
AuthorDate: Sat Nov 28 19:36:26 2020 +0000

    Make it possible to show HTML for the invalid parameter messages
    
    So that they can include links.
---
 guix-data-service/web/view/html.scm | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/guix-data-service/web/view/html.scm 
b/guix-data-service/web/view/html.scm
index 40cf60e..f949331 100644
--- a/guix-data-service/web/view/html.scm
+++ b/guix-data-service/web/view/html.scm
@@ -251,9 +251,13 @@
                                            (lambda (message)
                                              `(strong
                                                (@ (style "display: block;"))
-                                               ,(string-append
-                                                 "Error: " message)))
-                                           (filter string? messages))))))
+                                               "Error: "
+                                               ,@(if (list? message)
+                                                     message
+                                                     (list message))))
+                                           (remove (lambda (v)
+                                                     (eq? #f v))
+                                                   messages))))))
                                '())
                          ,@(if required? '((strong "Required. ")) '())
                          ,@(if help-text



reply via email to

[Prev in Thread] Current Thread [Next in Thread]