a393429f01
This one is a bit of a doozy. A summary of the changes: - Session has grown storage for attachments which have been uploaded but not yet sent. - The list of attachments on a message is refcounted so that we can clean up the temporary files only after it's done with - i.e. after copying to Sent and after all of the SMTP attempts are done. - Abandoned attachments are cleared out on process shutdown. Future work: - Add a limit to the maximum number of pending attachments the user can have in the session. - Periodically clean out abandoned attachments?
72 lines
2.2 KiB
HTML
72 lines
2.2 KiB
HTML
{{template "head.html" .}}
|
|
{{template "nav.html" .}}
|
|
{{template "util.html" .}}
|
|
|
|
<div class="page-wrap">
|
|
{{ template "aside" . }}
|
|
|
|
<div class="container">
|
|
<main class="create-update">
|
|
|
|
<form method="post" enctype="multipart/form-data">
|
|
<input type="hidden" name="in_reply_to" value="{{.Message.InReplyTo}}">
|
|
|
|
<div class="headers no-js">
|
|
<label>From</label>
|
|
<input type="email" name="from" id="from" value="{{.Message.From}}" />
|
|
|
|
<label>To</label>
|
|
<input
|
|
type="email"
|
|
name="to"
|
|
id="to"
|
|
value="{{.Message.ToString}}"
|
|
multiple
|
|
list="emails"
|
|
{{ if not .Message.To }} autofocus{{ end }}
|
|
/>
|
|
|
|
<label>Subject</label>
|
|
<input type="text" name="subject" id="subject" value="{{.Message.Subject}}" {{ if .Message.To }} autofocus{{ end }}/>
|
|
|
|
<label>Attachments</label>
|
|
<input type="file" name="attachments" id="attachments" multiple>
|
|
|
|
<div id="attachment-list" style="display: none;">
|
|
<div class="help">Drag and drop attachments here</div>
|
|
<!--
|
|
<div class="upload">
|
|
<span class="progress"></span>
|
|
<span class="filename">foobar.pdf</span>
|
|
<span class="size">1234 KiB</span>
|
|
<button>×</button>
|
|
</div>
|
|
-->
|
|
</div>
|
|
|
|
<input type="hidden" id="attachment-uuids" name="attachment-uuids" value="" />
|
|
</div>
|
|
<!-- TODO: list of previous attachments (needs design) -->
|
|
|
|
<textarea name="text" class="body">{{.Message.Text}}</textarea>
|
|
|
|
<datalist id="emails">
|
|
{{range .Extra.EmailSuggestions}}
|
|
<option value="{{.}}">
|
|
{{end}}
|
|
</datalist>
|
|
|
|
<div class="actions">
|
|
<button id="send-button" type="submit">Send Message</button>
|
|
<button id="save-button" type="submit" name="save_as_draft">Save as draft</button>
|
|
<a class="button-link" href="/mailbox/INBOX">Cancel</a>
|
|
</div>
|
|
</form>
|
|
|
|
</main>
|
|
</div>
|
|
</div>
|
|
<script src="/themes/alps/assets/attachments.js"></script>
|
|
|
|
{{template "foot.html"}}
|