[PATCH alps v2] themes/alps: handle messages without text parts
Export this patch
From: Konstantinos Koukas <contact@koukas.org>
Fixes: https://todo.sr.ht/~migadu/alps/165
---
This aims to make the order of the plain text and HTML tabs more clear.
themes/alps/message.html | 14 +++++---------
1 file changed, 5 insertions(+), 9 deletions(-)
diff --git a/themes/alps/message.html b/themes/alps/message.html
index ee5aa02..7e0fd27 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 eq $text.MIMEType "text/plain" }}
<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>
--
2.38.5
Pushed, thanks!
alps/patches/.build.yml: SUCCESS in 1m15s
[themes/alps: handle messages without text parts][0] v2 from [~koukas][1]
[0]: https://lists.sr.ht/~migadu/alps-devel/patches/43263
[1]: mailto:contact@koukas.org
✓ #1034691 SUCCESS alps/patches/.build.yml https://builds.sr.ht/~migadu/job/1034691