aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatarLibravatar Konstantinos Koukas <[email protected]> 2023-08-03 18:28:27 +0300
committerLibravatarLibravatar Simon Ser <[email protected]> 2023-08-06 09:15:18 +0200
commiteecda9c0245b4c9af476624451dce24c38d6b96f (patch)
treeba8d1b7fe8e9d4449c2c50397f79b47738481551
parent8a6dd176040060b5beac5cacc466682d1c6942fe (diff)
downloadalps-eecda9c0245b4c9af476624451dce24c38d6b96f.tar.gz
alps-eecda9c0245b4c9af476624451dce24c38d6b96f.tar.bz2
alps-eecda9c0245b4c9af476624451dce24c38d6b96f.zip
themes/alps: handle messages without text parts
Fixes: https://todo.sr.ht/~migadu/alps/165
-rw-r--r--themes/alps/message.html14
1 files changed, 5 insertions, 9 deletions
diff --git a/themes/alps/message.html b/themes/alps/message.html
index ee5aa02..8f67e8d 100644
--- a/themes/alps/message.html
+++ b/themes/alps/message.html
@@ -185,20 +185,17 @@
{{ $text := .Message.TextPart }}
<div class="tabs">
{{/* https://github.com/golang/go/issues/31103 */}}
+ {{ if $text }}
+ {{ if ne $text.MIMEType "text/html" }}
<a
href="?part={{$text.PathString}}"
{{ if eq $text.PathString .Part.PathString }}
class="active"
{{ end }}
- >
- {{ if eq $text.MIMEType "text/html" }}
- HTML
- {{ else }}
- Plain text
+ >Plain text</a>
{{ end }}
- </a>
- {{ if and $html $text }}
- {{ if ne $html.PathString $text.PathString }}
+ {{ end }}
+ {{ if $html }}
<a
href="?part={{$html.PathString}}"
{{ if eq $html.PathString .Part.PathString }}
@@ -206,7 +203,6 @@
{{ end }}
>HTML</a>
{{ end }}
- {{ end }}
<a href="{{.Message.URL}}/raw?plain=1">Raw email</a>
</div>