diff options
author | Ricardo Wurmus <rekado@elephly.net> | 2020-04-01 05:25:17 +0200 |
---|---|---|
committer | Ricardo Wurmus <rekado@elephly.net> | 2020-04-01 05:25:17 +0200 |
commit | d1dde957c7bd26867e667113934babea61d0174f (patch) | |
tree | 7f364a87b0b1acd87b337a732f0f7e93d55f09a5 | |
parent | 213980ffe03ecd3db54eecc3f02e52ea09c16aec (diff) |
view/utils: Add download-icon.
-rw-r--r-- | mumi/web/view/utils.scm | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/mumi/web/view/utils.scm b/mumi/web/view/utils.scm index bdecc14..4811035 100644 --- a/mumi/web/view/utils.scm +++ b/mumi/web/view/utils.scm @@ -107,6 +107,27 @@ "-" (symbol->string (assoc-ref value 'subtype)))) +;; https://icons.getbootstrap.com/icons/download/ +(define download-icon + '(svg (@ (class "bi bi-download") + (width "1em") + (height "1em") + (viewBox "0 0 16 16") + (fill "currentColor") + (xmlns "http://www.w3.org/2000/svg")) + (title "Download") + (path (@ (fill-rule "evenodd") + (clip-rule "evenodd") + (d "M.5 8a.5.5 0 01.5.5V12a1 1 0 001 1h12a1 1 0 001-1\ +V8.5a.5.5 0 011 0V12a2 2 0 01-2 2H2a2 2 0 01-2-2V8.5A.5.5 0 01.5 8z")) "") + (path (@ (fill-rule "evenodd") + (clip-rule "evenodd") + (d "M5 7.5a.5.5 0 01.707 0L8 9.793 10.293 7.5a.5.5 0 \ +11.707.707l-2.646 2.647a.5.5 0 01-.708 0L5 8.207A.5.5 0 015 7.5z")) "") + (path (@ (fill-rule "evenodd") + (clip-rule "evenodd") + (d "M8 1a.5.5 0 01.5.5v8a.5.5 0 01-1 0v-8A.5.5 0 018 1z")) ""))) + (define (display-message-body bug-num message-number message) "Convenience procedure to render MESSAGE (part of bug with number BUG-NUM), even when it is a multipart message." @@ -139,7 +160,7 @@ BUG-NUM), even when it is a multipart message." `(div (@ (class "multipart scheme")) (div (@ (class "download-part")) (a (@ (href ,(attachment-url))) - "Download")) + ,download-icon)) ,(highlights->sxml (highlight lex-scheme body)))) (else `(div (@ (class ,(string-join @@ -148,7 +169,7 @@ BUG-NUM), even when it is a multipart message." ""))))) (div (@ (class "download-part")) (a (@ (href ,(attachment-url))) - "Download")) + ,download-icon)) ,(prettify body)))))) (define (display-mime-entity entity . path) (match entity |