Add .editorconfig

This commit is contained in:
Simon Ser 2020-01-24 20:58:27 +01:00
parent 3384c39a17
commit b325933a8b
No known key found for this signature in database
GPG key ID: 0FDE7BE0E88F5E48
6 changed files with 160 additions and 151 deletions

9
.editorconfig Normal file
View file

@ -0,0 +1,9 @@
root = true
[*]
indent_style = tab
indent_size = 4
[*.{html,css,scss}]
indent_style = space
indent_size = 2

View file

@ -1,5 +1,5 @@
iframe { iframe {
width: 100%; width: 100%;
height: 400px; height: 400px;
border: 0; border: 0;
} }

View file

@ -3,31 +3,31 @@
<h1>koushin</h1> <h1>koushin</h1>
<p> <p>
<a href="/mailbox/INBOX">Back</a> <a href="/mailbox/INBOX">Back</a>
</p> </p>
<h2>Compose new message</h2> <h2>Compose new message</h2>
<form method="post" action="" enctype="multipart/form-data"> <form method="post" action="" enctype="multipart/form-data">
<input type="hidden" name="in_reply_to" value="{{.Message.InReplyTo}}"> <input type="hidden" name="in_reply_to" value="{{.Message.InReplyTo}}">
<label for="from">From:</label> <label for="from">From:</label>
<input type="email" name="from" id="from" required value="{{.Message.From}}"> <input type="email" name="from" id="from" required value="{{.Message.From}}">
<br><br> <br><br>
<label for="to">To:</label> <label for="to">To:</label>
<input type="email" name="to" id="to" multiple required value="{{.Message.ToString}}"> <input type="email" name="to" id="to" multiple required value="{{.Message.ToString}}">
<br><br> <br><br>
<label for="subject">Subject:</label> <label for="subject">Subject:</label>
<input type="text" name="subject" id="subject" value="{{.Message.Subject}}"> <input type="text" name="subject" id="subject" value="{{.Message.Subject}}">
<br><br> <br><br>
<label for="text">Body:</label><br> <label for="text">Body:</label><br>
<textarea name="text" id="text" cols="80" rows="20">{{.Message.Text}}</textarea> <textarea name="text" id="text" cols="80" rows="20">{{.Message.Text}}</textarea>
<br><br> <br><br>
<label for="attachments">Attachments:</label> <label for="attachments">Attachments:</label>
<input type="file" name="attachments" id="attachments" multiple> <input type="file" name="attachments" id="attachments" multiple>
<br><br> <br><br>
<input type="submit" name="save_as_draft" value="Save as draft"> <input type="submit" name="save_as_draft" value="Save as draft">
<input type="submit" value="Send"> <input type="submit" value="Send">
</form> </form>
{{template "foot.html"}} {{template "foot.html"}}

View file

@ -3,13 +3,13 @@
<h1>koushin</h1> <h1>koushin</h1>
<form method="post" action=""> <form method="post" action="">
<label for="username">Username:</label> <label for="username">Username:</label>
<input type="text" name="username" id="username"/> <input type="text" name="username" id="username"/>
<br><br> <br><br>
<label for="password">Password:</label> <label for="password">Password:</label>
<input type="password" name="password" id="password"/> <input type="password" name="password" id="password"/>
<br><br> <br><br>
<input type="submit" value="Login"> <input type="submit" value="Login">
</form> </form>
{{template "foot.html"}} {{template "foot.html"}}

View file

@ -3,48 +3,48 @@
<h1>koushin</h1> <h1>koushin</h1>
<p> <p>
<a href="/logout">Logout</a> · <a href="/compose">Compose</a> <a href="/logout">Logout</a> · <a href="/compose">Compose</a>
</p> </p>
<h2>{{.Mailbox.Name}}</h2> <h2>{{.Mailbox.Name}}</h2>
<form method="get" action=""> <form method="get" action="">
<input type="search" name="query" value="{{.Query}}"> <input type="search" name="query" value="{{.Query}}">
<input type="submit" value="Search"> <input type="submit" value="Search">
</form> </form>
<p>Mailboxes:</p> <p>Mailboxes:</p>
<ul> <ul>
{{range .Mailboxes}} {{range .Mailboxes}}
<li><a href="/mailbox/{{.Name | pathescape}}">{{.Name}}</a></li> <li><a href="/mailbox/{{.Name | pathescape}}">{{.Name}}</a></li>
{{end}} {{end}}
</ul> </ul>
{{if .Messages}} {{if .Messages}}
<p>Messages:</p> <p>Messages:</p>
<ul> <ul>
{{range .Messages}} {{range .Messages}}
<li><a href="/message/{{$.Mailbox.Name | pathescape}}/{{.Uid}}?part={{.TextPartName}}"> <li><a href="/message/{{$.Mailbox.Name | pathescape}}/{{.Uid}}?part={{.TextPartName}}">
{{if .Envelope.Subject}} {{if .Envelope.Subject}}
{{.Envelope.Subject}} {{.Envelope.Subject}}
{{else}} {{else}}
(No subject) (No subject)
{{end}} {{end}}
</a></li> </a></li>
{{end}} {{end}}
</ul> </ul>
<p> <p>
{{if ge .PrevPage 0}} {{if ge .PrevPage 0}}
<a href="?page={{.PrevPage}}&query={{.Query}}">Prev</a> <a href="?page={{.PrevPage}}&query={{.Query}}">Prev</a>
{{end}} {{end}}
{{if and (ge .PrevPage 0) (ge .NextPage 0)}}·{{end}} {{if and (ge .PrevPage 0) (ge .NextPage 0)}}·{{end}}
{{if ge .NextPage 0}} {{if ge .NextPage 0}}
<a href="?page={{.NextPage}}&query={{.Query}}">Next</a> <a href="?page={{.NextPage}}&query={{.Query}}">Next</a>
{{end}} {{end}}
</p> </p>
{{else}} {{else}}
<p>No message.</p> <p>No message.</p>
{{end}} {{end}}
{{template "foot.html"}} {{template "foot.html"}}

View file

@ -3,105 +3,105 @@
<h1>koushin</h1> <h1>koushin</h1>
<p> <p>
<a href="/mailbox/{{.Mailbox.Name | pathescape}}?page={{.MailboxPage}}"> <a href="/mailbox/{{.Mailbox.Name | pathescape}}?page={{.MailboxPage}}">
Back Back
</a> </a>
</p> </p>
<h2> <h2>
{{if .Message.Envelope.Subject}} {{if .Message.Envelope.Subject}}
{{.Message.Envelope.Subject}} {{.Message.Envelope.Subject}}
{{else}} {{else}}
(No subject) (No subject)
{{end}} {{end}}
</h2> </h2>
<form method="post" action="{{.Message.Uid}}/move"> <form method="post" action="{{.Message.Uid}}/move">
<label for="move-to">Move to:</label> <label for="move-to">Move to:</label>
<select name="to" id="move-to"> <select name="to" id="move-to">
{{range .Mailboxes}} {{range .Mailboxes}}
<option {{if eq .Name $.Mailbox.Name}}selected{{end}}>{{.Name}}</option> <option {{if eq .Name $.Mailbox.Name}}selected{{end}}>{{.Name}}</option>
{{end}} {{end}}
</select> </select>
<input type="submit" value="Move"> <input type="submit" value="Move">
</form> </form>
<form method="post" action="{{.Message.Uid}}/delete"> <form method="post" action="{{.Message.Uid}}/delete">
<input type="submit" value="Delete"> <input type="submit" value="Delete">
</form> </form>
{{if .Flags}} {{if .Flags}}
<form method="post" action="{{.Message.Uid}}/flag"> <form method="post" action="{{.Message.Uid}}/flag">
<p>Flags:</p> <p>Flags:</p>
{{range $name, $has := .Flags}} {{range $name, $has := .Flags}}
{{if ismutableflag $name}} {{if ismutableflag $name}}
<input type="checkbox" name="flags" id="flag-{{$name}}" <input type="checkbox" name="flags" id="flag-{{$name}}"
value="{{$name}}" {{if $has}}checked{{end}}> value="{{$name}}" {{if $has}}checked{{end}}>
<label for="flag-{{$name}}">{{$name | formatflag}}</label> <label for="flag-{{$name}}">{{$name | formatflag}}</label>
<br> <br>
{{else}} {{else}}
{{if $has}} {{if $has}}
<input type="hidden" name="flags" value="{{$name}}"> <input type="hidden" name="flags" value="{{$name}}">
{{end}} {{end}}
{{end}} {{end}}
{{end}} {{end}}
<input type="submit" value="Set flags"> <input type="submit" value="Set flags">
</form> </form>
{{end}} {{end}}
{{define "addr-list"}} {{define "addr-list"}}
{{range $i, $addr := .}} {{range $i, $addr := .}}
{{if $i}},{{end}} {{if $i}},{{end}}
{{.PersonalName}} {{.PersonalName}}
&lt;<a href="/compose?to={{.Address}}">{{.Address}}</a>&gt; &lt;<a href="/compose?to={{.Address}}">{{.Address}}</a>&gt;
{{end}} {{end}}
{{end}} {{end}}
<ul> <ul>
<li> <li>
<strong>Date</strong>: {{.Message.Envelope.Date | formatdate}} <strong>Date</strong>: {{.Message.Envelope.Date | formatdate}}
</li> </li>
<li> <li>
<strong>From</strong>: {{template "addr-list" .Message.Envelope.From}} <strong>From</strong>: {{template "addr-list" .Message.Envelope.From}}
</li> </li>
<li> <li>
<strong>To</strong>: {{template "addr-list" .Message.Envelope.To}} <strong>To</strong>: {{template "addr-list" .Message.Envelope.To}}
</li> </li>
{{if .Message.Envelope.Cc}} {{if .Message.Envelope.Cc}}
<li> <li>
<strong>Cc</strong>: {{template "addr-list" .Message.Envelope.Cc}} <strong>Cc</strong>: {{template "addr-list" .Message.Envelope.Cc}}
</li> </li>
{{end}} {{end}}
{{if .Message.Envelope.Bcc}} {{if .Message.Envelope.Bcc}}
<li> <li>
<strong>Bcc</strong>: {{template "addr-list" .Message.Envelope.Bcc}} <strong>Bcc</strong>: {{template "addr-list" .Message.Envelope.Bcc}}
</li> </li>
{{end}} {{end}}
</ul> </ul>
{{define "message-part-tree"}} {{define "message-part-tree"}}
{{/* nested templates can't access the parent's context */}} {{/* nested templates can't access the parent's context */}}
{{$ = index . 0}} {{$ = index . 0}}
{{with index . 1}} {{with index . 1}}
<a <a
{{if .IsText}} {{if .IsText}}
href="{{$.Message.Uid}}?part={{.PathString}}" href="{{$.Message.Uid}}?part={{.PathString}}"
{{else}} {{else}}
href="{{$.Message.Uid}}/raw?part={{.PathString}}" href="{{$.Message.Uid}}/raw?part={{.PathString}}"
{{end}} {{end}}
> >
{{if eq $.PartPath .PathString}}<strong>{{end}} {{if eq $.PartPath .PathString}}<strong>{{end}}
{{.String}} {{.String}}
{{if eq $.PartPath .PathString}}</strong>{{end}} {{if eq $.PartPath .PathString}}</strong>{{end}}
</a> </a>
{{if .Children}} {{if .Children}}
<ul> <ul>
{{range .Children}} {{range .Children}}
<li>{{template "message-part-tree" (tuple $ .)}}</li> <li>{{template "message-part-tree" (tuple $ .)}}</li>
{{end}} {{end}}
</ul> </ul>
{{end}} {{end}}
{{end}} {{end}}
{{end}} {{end}}
<p>Parts:</p> <p>Parts:</p>
@ -111,23 +111,23 @@
<hr> <hr>
{{if .Body}} {{if .Body}}
<p> <p>
{{if .Message.HasFlag "\\Draft"}} {{if .Message.HasFlag "\\Draft"}}
<a href="{{.Message.Uid}}/edit?part={{.PartPath}}">Edit draft</a> <a href="{{.Message.Uid}}/edit?part={{.PartPath}}">Edit draft</a>
{{else}} {{else}}
<a href="{{.Message.Uid}}/reply?part={{.PartPath}}">Reply</a> <a href="{{.Message.Uid}}/reply?part={{.PartPath}}">Reply</a>
{{end}} {{end}}
</p> </p>
{{if .IsHTML}} {{if .IsHTML}}
<!-- allow-same-origin is required to resize the frame with its content --> <!-- allow-same-origin is required to resize the frame with its content -->
<!-- allow-popups is required for target="_blank" links --> <!-- allow-popups is required for target="_blank" links -->
<iframe id="email-frame" srcdoc="{{.Body}}" sandbox="allow-same-origin allow-popups"></iframe> <iframe id="email-frame" srcdoc="{{.Body}}" sandbox="allow-same-origin allow-popups"></iframe>
{{else}} {{else}}
<pre>{{.Body}}</pre> <pre>{{.Body}}</pre>
{{end}} {{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}}
{{template "foot.html"}} {{template "foot.html"}}