Browse Source

Add .editorconfig

master
Simon Ser 4 years ago
parent
commit
b325933a8b
No known key found for this signature in database GPG Key ID: FDE7BE0E88F5E48
6 changed files with 161 additions and 152 deletions
  1. +9
    -0
      .editorconfig
  2. +3
    -3
      plugins/base/public/assets/style.css
  3. +19
    -19
      plugins/base/public/compose.html
  4. +7
    -7
      plugins/base/public/login.html
  5. +29
    -29
      plugins/base/public/mailbox.html
  6. +94
    -94
      plugins/base/public/message.html

+ 9
- 0
.editorconfig View File

@@ -0,0 +1,9 @@
root = true

[*]
indent_style = tab
indent_size = 4

[*.{html,css,scss}]
indent_style = space
indent_size = 2

+ 3
- 3
plugins/base/public/assets/style.css View File

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

+ 19
- 19
plugins/base/public/compose.html View File

@@ -3,31 +3,31 @@
<h1>koushin</h1>

<p>
<a href="/mailbox/INBOX">Back</a>
<a href="/mailbox/INBOX">Back</a>
</p>

<h2>Compose new message</h2>

<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>
<input type="email" name="from" id="from" required value="{{.Message.From}}">
<br><br>
<label for="to">To:</label>
<input type="email" name="to" id="to" multiple required value="{{.Message.ToString}}">
<br><br>
<label for="subject">Subject:</label>
<input type="text" name="subject" id="subject" value="{{.Message.Subject}}">
<br><br>
<label for="text">Body:</label><br>
<textarea name="text" id="text" cols="80" rows="20">{{.Message.Text}}</textarea>
<br><br>
<label for="attachments">Attachments:</label>
<input type="file" name="attachments" id="attachments" multiple>
<br><br>
<input type="submit" name="save_as_draft" value="Save as draft">
<input type="submit" value="Send">
<label for="from">From:</label>
<input type="email" name="from" id="from" required value="{{.Message.From}}">
<br><br>
<label for="to">To:</label>
<input type="email" name="to" id="to" multiple required value="{{.Message.ToString}}">
<br><br>
<label for="subject">Subject:</label>
<input type="text" name="subject" id="subject" value="{{.Message.Subject}}">
<br><br>
<label for="text">Body:</label><br>
<textarea name="text" id="text" cols="80" rows="20">{{.Message.Text}}</textarea>
<br><br>
<label for="attachments">Attachments:</label>
<input type="file" name="attachments" id="attachments" multiple>
<br><br>
<input type="submit" name="save_as_draft" value="Save as draft">
<input type="submit" value="Send">
</form>

{{template "foot.html"}}

+ 7
- 7
plugins/base/public/login.html View File

@@ -3,13 +3,13 @@
<h1>koushin</h1>

<form method="post" action="">
<label for="username">Username:</label>
<input type="text" name="username" id="username"/>
<br><br>
<label for="password">Password:</label>
<input type="password" name="password" id="password"/>
<br><br>
<input type="submit" value="Login">
<label for="username">Username:</label>
<input type="text" name="username" id="username"/>
<br><br>
<label for="password">Password:</label>
<input type="password" name="password" id="password"/>
<br><br>
<input type="submit" value="Login">
</form>

{{template "foot.html"}}

+ 29
- 29
plugins/base/public/mailbox.html View File

@@ -3,48 +3,48 @@
<h1>koushin</h1>

<p>
<a href="/logout">Logout</a> · <a href="/compose">Compose</a>
<a href="/logout">Logout</a> · <a href="/compose">Compose</a>
</p>

<h2>{{.Mailbox.Name}}</h2>

<form method="get" action="">
<input type="search" name="query" value="{{.Query}}">
<input type="submit" value="Search">
<input type="search" name="query" value="{{.Query}}">
<input type="submit" value="Search">
</form>

<p>Mailboxes:</p>
<ul>
{{range .Mailboxes}}
<li><a href="/mailbox/{{.Name | pathescape}}">{{.Name}}</a></li>
{{end}}
{{range .Mailboxes}}
<li><a href="/mailbox/{{.Name | pathescape}}">{{.Name}}</a></li>
{{end}}
</ul>

{{if .Messages}}
<p>Messages:</p>
<ul>
{{range .Messages}}
<li><a href="/message/{{$.Mailbox.Name | pathescape}}/{{.Uid}}?part={{.TextPartName}}">
{{if .Envelope.Subject}}
{{.Envelope.Subject}}
{{else}}
(No subject)
{{end}}
</a></li>
{{end}}
</ul>
<p>
{{if ge .PrevPage 0}}
<a href="?page={{.PrevPage}}&query={{.Query}}">Prev</a>
{{end}}
{{if and (ge .PrevPage 0) (ge .NextPage 0)}}·{{end}}
{{if ge .NextPage 0}}
<a href="?page={{.NextPage}}&query={{.Query}}">Next</a>
{{end}}
</p>
<p>Messages:</p>
<ul>
{{range .Messages}}
<li><a href="/message/{{$.Mailbox.Name | pathescape}}/{{.Uid}}?part={{.TextPartName}}">
{{if .Envelope.Subject}}
{{.Envelope.Subject}}
{{else}}
(No subject)
{{end}}
</a></li>
{{end}}
</ul>
<p>
{{if ge .PrevPage 0}}
<a href="?page={{.PrevPage}}&query={{.Query}}">Prev</a>
{{end}}
{{if and (ge .PrevPage 0) (ge .NextPage 0)}}·{{end}}
{{if ge .NextPage 0}}
<a href="?page={{.NextPage}}&query={{.Query}}">Next</a>
{{end}}
</p>
{{else}}
<p>No message.</p>
<p>No message.</p>
{{end}}

{{template "foot.html"}}

+ 94
- 94
plugins/base/public/message.html View File

@@ -3,105 +3,105 @@
<h1>koushin</h1>

<p>
<a href="/mailbox/{{.Mailbox.Name | pathescape}}?page={{.MailboxPage}}">
Back
</a>
<a href="/mailbox/{{.Mailbox.Name | pathescape}}?page={{.MailboxPage}}">
Back
</a>
</p>

<h2>
{{if .Message.Envelope.Subject}}
{{.Message.Envelope.Subject}}
{{else}}
(No subject)
{{end}}
{{if .Message.Envelope.Subject}}
{{.Message.Envelope.Subject}}
{{else}}
(No subject)
{{end}}
</h2>

<form method="post" action="{{.Message.Uid}}/move">
<label for="move-to">Move to:</label>
<select name="to" id="move-to">
{{range .Mailboxes}}
<option {{if eq .Name $.Mailbox.Name}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
<input type="submit" value="Move">
<label for="move-to">Move to:</label>
<select name="to" id="move-to">
{{range .Mailboxes}}
<option {{if eq .Name $.Mailbox.Name}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
<input type="submit" value="Move">
</form>

<form method="post" action="{{.Message.Uid}}/delete">
<input type="submit" value="Delete">
<input type="submit" value="Delete">
</form>

{{if .Flags}}
<form method="post" action="{{.Message.Uid}}/flag">
<p>Flags:</p>
{{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}}
<input type="submit" value="Set flags">
</form>
<form method="post" action="{{.Message.Uid}}/flag">
<p>Flags:</p>
{{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}}
<input type="submit" value="Set flags">
</form>
{{end}}

{{define "addr-list"}}
{{range $i, $addr := .}}
{{if $i}},{{end}}
{{.PersonalName}}
&lt;<a href="/compose?to={{.Address}}">{{.Address}}</a>&gt;
{{end}}
{{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}}
<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>

{{define "message-part-tree"}}
{{/* nested templates can't access the parent's context */}}
{{$ = index . 0}}
{{with index . 1}}
<a
{{if .IsText}}
href="{{$.Message.Uid}}?part={{.PathString}}"
{{else}}
href="{{$.Message.Uid}}/raw?part={{.PathString}}"
{{end}}
>
{{if eq $.PartPath .PathString}}<strong>{{end}}
{{.String}}
{{if eq $.PartPath .PathString}}</strong>{{end}}
</a>
{{if .Children}}
<ul>
{{range .Children}}
<li>{{template "message-part-tree" (tuple $ .)}}</li>
{{end}}
</ul>
{{end}}
{{end}}
{{/* nested templates can't access the parent's context */}}
{{$ = index . 0}}
{{with index . 1}}
<a
{{if .IsText}}
href="{{$.Message.Uid}}?part={{.PathString}}"
{{else}}
href="{{$.Message.Uid}}/raw?part={{.PathString}}"
{{end}}
>
{{if eq $.PartPath .PathString}}<strong>{{end}}
{{.String}}
{{if eq $.PartPath .PathString}}</strong>{{end}}
</a>
{{if .Children}}
<ul>
{{range .Children}}
<li>{{template "message-part-tree" (tuple $ .)}}</li>
{{end}}
</ul>
{{end}}
{{end}}
{{end}}

<p>Parts:</p>
@@ -111,23 +111,23 @@
<hr>

{{if .Body}}
<p>
{{if .Message.HasFlag "\\Draft"}}
<a href="{{.Message.Uid}}/edit?part={{.PartPath}}">Edit draft</a>
{{else}}
<a href="{{.Message.Uid}}/reply?part={{.PartPath}}">Reply</a>
{{end}}
</p>
{{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}}
<p>
{{if .Message.HasFlag "\\Draft"}}
<a href="{{.Message.Uid}}/edit?part={{.PartPath}}">Edit draft</a>
{{else}}
<a href="{{.Message.Uid}}/reply?part={{.PartPath}}">Reply</a>
{{end}}
</p>
{{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}}
<p>Can't preview this message part.</p>
<a href="{{.Message.Uid}}/raw?part={{.PartPath}}">Download</a>
<p>Can't preview this message part.</p>
<a href="{{.Message.Uid}}/raw?part={{.PartPath}}">Download</a>
{{end}}

{{template "foot.html"}}

Loading…
Cancel
Save