From a2a150066f5b2e1b0eef6b3f8c42bb1091136d2e Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 19 Jul 2022 17:00:27 +0530 Subject: issue: Render tags as an unordered list. * tissue/issue.scm (document->sxml): Render tags as an unordered list. * tissue/web/server.scm (%css): Style list items with tag classes, not anchor tags. --- tissue/issue.scm | 28 +++++++++++++++------------- tissue/web/server.scm | 16 +++++++++++----- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/tissue/issue.scm b/tissue/issue.scm index 9e2ca9c..5868120 100644 --- a/tissue/issue.scm +++ b/tissue/issue.scm @@ -178,17 +178,11 @@ object representing a list of search results." (a (@ (href ,(document-web-uri issue)) (class "search-result-title")) ,(document-title issue)) - ,@(map (lambda (tag) - (let ((words (string-split tag (char-set #\- #\space)))) - `(a (@ (href ,(string-append - "/search?query=" - (uri-encode - ;; Quote tag if it has spaces. - (string-append "tag:" - (if (string-any #\space tag) - (string-append "\"" tag "\"") - tag))))) - (class ,(string-append "tag" + (ul (@ (class "tags")) + ,@(map (lambda (tag) + (let ((words (string-split tag (char-set #\- #\space)))) + `(li (@ (class + ,(string-append "tag" (string-append " tag-" (sanitize-string tag)) (if (not (null? (lset-intersection string=? words @@ -210,8 +204,16 @@ object representing a list of search results." (list "enhancement" "feature")))) " tag-feature" "")))) - ,tag))) - (issue-keywords issue)) + (a (@ (href ,(string-append + "/search?query=" + (uri-encode + ;; Quote tag if it has spaces. + (string-append "tag:" + (if (string-any #\space tag) + (string-append "\"" tag "\"") + tag)))))) + ,tag)))) + (issue-keywords issue))) (div (@ (class "search-result-metadata")) ,(string-append (format #f "opened ~a by ~a" diff --git a/tissue/web/server.scm b/tissue/web/server.scm index 33e6892..b3891ab 100644 --- a/tissue/web/server.scm +++ b/tissue/web/server.scm @@ -104,7 +104,13 @@ form { text-align: center; } } .search-result-snippet { font-size: smaller; } -a.tag { +.tags { + list-style-type: none; + padding: 0; + display: inline; +} +.tag { display: inline; } +.tag a { padding: 0.25em 0.4em; color: white; background-color: blue; @@ -112,13 +118,13 @@ a.tag { margin: auto 0.25em; font-size: smaller; } -a.tag-bug { background-color: red; } -a.tag-feature { background-color: green; } -a.tag-progress, a.tag-unassigned { +.tag-bug a { background-color: red; } +.tag-feature a { background-color: green; } +.tag-progress a, .tag-unassigned a { background-color: orange; color: black; } -a.tag-chore { +.tag-chore a { background-color: khaki; color: black; }") -- cgit v1.2.3