92 lines
5.3 KiB
HTML
92 lines
5.3 KiB
HTML
{{define "webmail_message_pane.html"}}
|
|
<div class="pane-toolbar d-flex justify-content-between align-items-center mb-3">
|
|
<div class="btn-group btn-group-sm">
|
|
<button type="button" onclick="openCompose('/webmail/mail/compose?reply={{.uid}}&folder={{.active_folder}}')" class="btn btn-outline-primary" title="Reply"><i class="bi bi-reply"></i></button>
|
|
<button type="button" onclick="openCompose('/webmail/mail/compose?replyall={{.uid}}&folder={{.active_folder}}')" class="btn btn-outline-primary" title="Reply All"><i class="bi bi-reply-all"></i></button>
|
|
<button type="button" onclick="openCompose('/webmail/mail/compose?forward={{.uid}}&folder={{.active_folder}}')" class="btn btn-outline-primary" title="Forward"><i class="bi bi-arrow-right"></i></button>
|
|
</div>
|
|
<div class="d-flex align-items-center gap-2">
|
|
<form method="post" action="/webmail/mail/{{.active_folder}}/{{.uid}}/move" class="d-flex align-items-center gap-1">
|
|
<input type="hidden" name="csrf_token" value="{{.csrf_token}}">
|
|
<select name="target_folder" class="form-select form-select-sm" style="width: auto;">
|
|
<option value="">Move to…</option>
|
|
{{$folder := .active_folder}}
|
|
{{range .folders}}{{if ne . $folder}}<option value="{{.}}">{{.}}</option>{{end}}{{end}}
|
|
</select>
|
|
<button type="submit" class="btn btn-outline-secondary btn-sm" title="Move"><i class="bi bi-folder-symlink"></i></button>
|
|
</form>
|
|
<form method="post" action="/webmail/mail/{{.active_folder}}/{{.uid}}/delete" onsubmit="return confirm('{{if eq .active_folder "Trash"}}Permanently delete this message? This cannot be undone.{{else}}Move this message to Trash?{{end}}');">
|
|
<input type="hidden" name="csrf_token" value="{{.csrf_token}}">
|
|
<button type="submit" class="btn btn-outline-danger btn-sm" title="{{if eq .active_folder "Trash"}}Delete Permanently{{else}}Move to Trash{{end}}"><i class="bi bi-trash"></i></button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<h5 class="mb-2">{{if .parsed.Header.Subject}}{{.parsed.Header.Subject}}{{else}}<span class="text-muted">(no subject)</span>{{end}}</h5>
|
|
{{if or .smime.Signed .smime.Encrypted}}
|
|
<div class="mb-2">
|
|
{{if .smime.Encrypted}}
|
|
{{if .smime.Decrypted}}<span class="badge bg-success"><i class="bi bi-unlock-fill me-1"></i>Encrypted & decrypted</span>
|
|
{{else}}<span class="badge bg-danger" title="{{.smime.DecryptErr}}"><i class="bi bi-lock-fill me-1"></i>Encrypted — could not decrypt</span>{{end}}
|
|
{{end}}
|
|
{{if .smime.Signed}}
|
|
{{if .smime.SignatureOK}}<span class="badge bg-success" title="{{.smime.SignerEmail}}"><i class="bi bi-patch-check-fill me-1"></i>Signature verified{{if .smime.SignerEmail}} ({{.smime.SignerEmail}}){{end}}</span>
|
|
{{else}}<span class="badge bg-danger" title="{{.smime.SignatureErr}}"><i class="bi bi-exclamation-triangle-fill me-1"></i>Signature invalid</span>{{end}}
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
{{if .pgp.Encrypted}}
|
|
<div class="mb-2">
|
|
{{if .pgp.Decrypted}}<span class="badge bg-success"><i class="bi bi-unlock-fill me-1"></i>PGP encrypted & decrypted</span>
|
|
{{else if .pgp.NeedsUnlock}}<span class="badge bg-warning text-dark"><i class="bi bi-lock-fill me-1"></i>PGP encrypted — enter your passphrase to decrypt</span>
|
|
{{else}}<span class="badge bg-danger" title="{{.pgp.DecryptErr}}"><i class="bi bi-lock-fill me-1"></i>PGP encrypted — could not decrypt</span>{{end}}
|
|
</div>
|
|
{{if .pgp.NeedsUnlock}}
|
|
<form method="post" action="/webmail/pgp/unlock" class="row g-2 align-items-end mb-2">
|
|
<input type="hidden" name="csrf_token" value="{{.csrf_token}}">
|
|
<input type="hidden" name="next" value="{{.message_url}}">
|
|
<div class="col-auto">
|
|
<select class="form-select form-select-sm" name="identity_id">
|
|
{{range .pgp.Identities}}<option value="{{.ID}}">{{if .Label}}{{.Label}}{{else}}Key{{end}} ({{.Fingerprint}})</option>{{end}}
|
|
</select>
|
|
</div>
|
|
<div class="col-auto">
|
|
<input type="password" class="form-control form-control-sm" name="passphrase" placeholder="Passphrase" required>
|
|
</div>
|
|
<div class="col-auto">
|
|
<button type="submit" class="btn btn-warning btn-sm">Unlock & Decrypt</button>
|
|
</div>
|
|
</form>
|
|
{{end}}
|
|
{{end}}
|
|
<div class="small text-muted mb-3">
|
|
<div><strong>From:</strong> {{.parsed.Header.From}}</div>
|
|
<div><strong>To:</strong> {{.parsed.Header.To}}</div>
|
|
{{if .parsed.Header.Cc}}<div><strong>Cc:</strong> {{.parsed.Header.Cc}}</div>{{end}}
|
|
<div><strong>Date:</strong> {{.parsed.Header.Date}}</div>
|
|
</div>
|
|
|
|
{{if .html_body}}
|
|
<div class="msg-body-html">{{.html_body}}</div>
|
|
{{else if .parsed.TextBody}}
|
|
<div class="msg-body-text">{{.parsed.TextBody}}</div>
|
|
{{else}}
|
|
<p class="text-muted mb-0">(empty message body)</p>
|
|
{{end}}
|
|
|
|
{{if .parsed.Attachments}}
|
|
<hr>
|
|
<h6><i class="bi bi-paperclip me-1"></i>Attachments</h6>
|
|
<div class="list-group">
|
|
{{$folder := .active_folder}}
|
|
{{$uid := .uid}}
|
|
{{range $i, $att := .parsed.Attachments}}
|
|
<a href="/webmail/mail/{{$folder}}/{{$uid}}/attachment/{{$i}}" class="list-group-item list-group-item-action bg-transparent text-white d-flex justify-content-between align-items-center">
|
|
<span><i class="bi bi-file-earmark me-2"></i>{{$att.Filename}}</span>
|
|
<i class="bi bi-download"></i>
|
|
</a>
|
|
{{end}}
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|