2019-08-16 21:27:24 +00:00
|
|
|
{{define "import"}}
|
|
|
|
{{template "header" .}}
|
|
|
|
|
|
|
|
<div class="snug content-container">
|
2019-08-17 23:18:40 +00:00
|
|
|
{{if .Message}}
|
|
|
|
<div class="alert {{if .InfoMsg}}info{{else}}success{{end}}">
|
|
|
|
<p>{{.Message}}</p>
|
|
|
|
</div>
|
|
|
|
{{end}}
|
2019-08-16 21:27:24 +00:00
|
|
|
<h2 id="posts-header">Import</h2>
|
|
|
|
<p>Upload text or markdown files to import as posts.</p>
|
|
|
|
<div class="formContainer">
|
2019-08-19 16:05:52 +00:00
|
|
|
<form id="importPosts" class="import" enctype="multipart/form-data" action="/api/me/import" method="POST">
|
2019-08-16 21:27:24 +00:00
|
|
|
<label for="file" hidden>Browse files to upload</label>
|
2019-08-21 22:42:48 +00:00
|
|
|
<input class="fileInput" name="files" type="file" multiple accept="text/markdown, text/plain"/>
|
2019-08-16 21:27:24 +00:00
|
|
|
<br />
|
|
|
|
<label for="collection">Select a blog to import the posts under.</label>
|
|
|
|
<select name="collection">
|
|
|
|
{{range $i, $el := .Collections}}
|
|
|
|
<option value={{.Alias}}>
|
|
|
|
{{if .Title}}{{.Title}}{{else}}{{.Alias}}{{end}}
|
|
|
|
</option>
|
|
|
|
{{end}}
|
|
|
|
<option value="" selected>drafts</option>
|
|
|
|
</select>
|
|
|
|
<br />
|
|
|
|
<input type="submit" value="Import" />
|
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
{{if .Flashes}}
|
|
|
|
<ul class="errors">
|
|
|
|
{{range .Flashes}}<li class="urgent">{{.}}</li>{{end}}
|
|
|
|
</ul>
|
|
|
|
{{end}}
|
|
|
|
</div>
|
|
|
|
|
|
|
|
{{template "footer" .}}
|
2019-08-26 22:04:00 +00:00
|
|
|
{{end}}
|