themes/sourcehut: sync with latest base plugin

This commit is contained in:
Simon Ser 2020-02-11 17:11:46 +01:00
parent 97eef13db4
commit 19548694e0
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
4 changed files with 162 additions and 11 deletions

View file

@ -4,7 +4,7 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<div class="col-md-12 header-tabbed"> <div class="col-md-12 header-tabbed">
<h2>INBOX</h2> <h2>Compose</h2>
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/mailbox/INBOX" >Mail</a> <a class="nav-link" href="/mailbox/INBOX" >Mail</a>
@ -12,12 +12,15 @@
<li class="nav-item"> <li class="nav-item">
<a class="nav-link active" href="/compose">Compose</a> <a class="nav-link active" href="/compose">Compose</a>
</li> </li>
<li class="nav-item">
<a class="nav-link" href="/settings">Settings</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>
</div> </div>
<div class="container"> <div class="container">
<form method="post" class="col-md-12"> <form method="post" class="col-md-12" enctype="multipart/form-data">
<input type="hidden" name="in_reply_to" value="{{.Message.InReplyTo}}"> <input type="hidden" name="in_reply_to" value="{{.Message.InReplyTo}}">
<div class="row"> <div class="row">
<div class="form-group col-md-6"> <div class="form-group col-md-6">
@ -69,6 +72,11 @@
href="/mailbox/INBOX" href="/mailbox/INBOX"
class="btn btn-default" class="btn btn-default"
>Cancel</a> >Cancel</a>
<button
type="submit"
name="save_as_draft"
class="btn btn-default"
>Save as draft</button>
<button <button
type="submit" type="submit"
class="btn btn-primary" class="btn btn-primary"

View file

@ -11,11 +11,14 @@
<a <a
class="nav-link active" class="nav-link active"
href="/mailbox/{{.Mailbox.Name | pathescape }}" href="/mailbox/{{.Mailbox.Name | pathescape }}"
>Mailbox</a> >Mail</a>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<a class="nav-link" href="/compose">Compose</a> <a class="nav-link" href="/compose">Compose</a>
</li> </li>
<li class="nav-item">
<a class="nav-link" href="/settings">Settings</a>
</li>
</ul> </ul>
</div> </div>
</div> </div>
@ -63,11 +66,13 @@
{{ .PersonalName }} {{ .PersonalName }}
{{ end }} {{ end }}
</span> </span>
{{if .Envelope.Subject}} <span class="{{if not (.HasFlag "\\Seen")}}font-weight-bold{{end}}">
{{.Envelope.Subject}} {{if .Envelope.Subject}}
{{else}} {{.Envelope.Subject}}
(No subject) {{else}}
{{end}} (No subject)
{{end}}
</span>
</a></li> </a></li>
{{end}} {{end}}
</ul> </ul>

View file

@ -68,16 +68,105 @@
<div class="container message-container"> <div class="container message-container">
<div class="row"> <div class="row">
<div class="col-md-10 body-column"> <div class="col-md-9 body-column">
{{define "addr-list"}}
{{range $i, $addr := .}}
{{- if $i}},{{end}}
{{.PersonalName}}
&lt;<a href="/compose?to={{.Address}}">{{.Address}}</a>&gt;
{{- end}}
{{end}}
<ul>
<li>
<strong>Date</strong>: {{.Message.Envelope.Date | formatdate}}
</li>
<li>
<strong>From</strong>: {{template "addr-list" .Message.Envelope.From}}
</li>
<li>
<strong>To</strong>: {{template "addr-list" .Message.Envelope.To}}
</li>
{{if .Message.Envelope.Cc}}
<li>
<strong>Cc</strong>: {{template "addr-list" .Message.Envelope.Cc}}
</li>
{{end}}
{{if .Message.Envelope.Bcc}}
<li>
<strong>Bcc</strong>: {{template "addr-list" .Message.Envelope.Bcc}}
</li>
{{end}}
</ul>
{{if .Body}} {{if .Body}}
<pre>{{.Body}}</pre> {{if .IsHTML}}
<!-- allow-same-origin is required to resize the frame with its content -->
<!-- allow-popups is required for target="_blank" links -->
<iframe id="email-frame"
srcdoc="{{.Body}}"
sandbox="allow-same-origin allow-popups"></iframe>
{{else}}
<pre>{{.Body}}</pre>
{{end}}
{{else}} {{else}}
<p>Can't preview this message part.</p> <p>Can't preview this message part.</p>
<a href="{{.Message.Uid}}/raw?part={{.PartPath}}">Download</a> <a href="{{.Message.Uid}}/raw?part={{.PartPath}}">Download</a>
{{end}} {{end}}
</div> </div>
<div class="col-md-2 parts-column"> <div class="col-md-3 parts-column">
{{template "message-part-tree" (tuple $ .Message.PartTree)}} {{template "message-part-tree" (tuple $ .Message.PartTree)}}
<details>
<summary>Move to another mailbox</summary>
<form method="post" action="{{.Message.Uid}}/move">
<div class="form-group">
<select class="form-control" name="to" id="move-to">
{{range .Mailboxes}}
<option {{if eq .Name $.Mailbox.Name}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
</div>
<div class="pull-right">
<button class="btn btn-primary">Move</button>
</div>
</form>
</details>
<details>
<summary>Delete</summary>
<form method="post" action="{{.Message.Uid}}/delete">
<p>Are you sure?</p>
<div class="pull-right">
<button class="btn btn-danger">Delete</button>
</div>
</form>
</details>
{{if .Flags}}
<details>
<summary>Edit flags</summary>
<form method="post" action="{{.Message.Uid}}/flag">
<div class="form-group">
{{range $name, $has := .Flags}}
{{if ismutableflag $name}}
<input type="checkbox" name="flags" id="flag-{{$name}}"
value="{{$name}}" {{if $has}}checked{{end}}>
<label for="flag-{{$name}}">{{$name | formatflag}}</label>
<br>
{{else}}
{{if $has}}
<input type="hidden" name="flags" value="{{$name}}">
{{end}}
{{end}}
{{end}}
</div>
<div class="pull-right">
<button class="btn btn-primary">Save</button>
</div>
</form>
</details>
{{end}}
</div> </div>
</div> </div>
</div> </div>

View file

@ -0,0 +1,49 @@
{{template "head.html"}}
{{template "nav.html"}}
<div class="container-fluid">
<div class="row">
<div class="col-md-12 header-tabbed">
<h2>Settings</h2>
<ul class="nav nav-tabs">
<li class="nav-item">
<a class="nav-link" href="/mailbox/INBOX" >Mail</a>
</li>
<li class="nav-item">
<a class="nav-link" href="/compose">Compose</a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/settings">Settings</a>
</li>
</ul>
</div>
</div>
</div>
<div class="container">
<form method="post" class="col-md-12">
<div class="form-group">
<label for="messages_per_page">Messages per page:</label>
<input
type="number"
name="messages_per_page"
id="messages_per_page"
required
class="form-control"
value="{{.Settings.MessagesPerPage}}" />
</div>
<div class="pull-right">
<a
href="/mailbox/INBOX"
class="btn btn-default"
>Cancel</a>
<button
type="submit"
class="btn btn-primary"
>Save</button>
</div>
</form>
</div>
{{template "foot.html"}}