A focused writing and publishing space. https://write.with.parts
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
writefreely/templates/user/import.tmpl

38 lines
1.1 KiB

{{define "import"}}
{{template "header" .}}
<div class="snug content-container">
{{if .Message}}
<div class="alert {{if .InfoMsg}}info{{else}}success{{end}}">
<p>{{.Message}}</p>
</div>
{{end}}
<h2 id="posts-header">Import</h2>
<p>Upload text or markdown files to import as posts.</p>
<div class="formContainer">
<form id="importPosts" class="import" enctype="multipart/form-data" action="/me/import" method="POST">
<label for="file" hidden>Browse files to upload</label>
<input class="fileInput" name="files" type="file" multiple accept=".txt,.md"/>
<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" .}}
{{end}}