message view: add print button & stylesheet

This commit is contained in:
Drew DeVault 2020-10-30 12:53:25 -04:00
parent cbeacf9d06
commit 6a6ea3e63b
4 changed files with 28 additions and 1 deletions

View file

@ -0,0 +1,10 @@
header,
aside,
.actions,
.tabs {
display: none;
}
.message {
padding: 0;
}

View file

@ -0,0 +1,6 @@
const print = document.getElementById("print");
print.style.display = "inherit";
print.addEventListener("click", e => {
e.preventDefault();
window.print();
});

View file

@ -9,5 +9,6 @@
{{end -}}
<title>{{.GlobalData.Title}}</title>
<link rel="stylesheet" href="/themes/alps/assets/style.css">
<link rel="stylesheet" href="/themes/alps/assets/print.css" media="print">
</head>
<body>

View file

@ -78,7 +78,7 @@
<button class="action-group" type="submit">Move</button>
</form>
<span class="followups">
<span class="followups action-group">
{{if .Message.HasFlag "\\Draft"}}
<a class="action-group button-link" href="{{.Message.URL}}/edit{{if .Message.TextPart}}?part={{.Message.TextPart.PathString}}{{end}}">Edit draft</a>
{{else}}
@ -86,6 +86,15 @@
<a class="action-group button-link" href="{{.Message.URL}}/forward{{if .Message.TextPart}}?part={{.Message.TextPart.PathString}}{{end}}">Forward</a>
{{end}}
</span>
<span class="action-group">
<a
class="action-group button-link"
id="print"
href="#"
style="display: none"
>Print</a>
</span>
</div>
</div>
</section>
@ -204,5 +213,6 @@
</main>
</div>
</div>
<script src="/themes/alps/assets/print.js"></script>
{{template "foot.html"}}