Add setting for default format

This commit is contained in:
r 2020-10-19 06:51:23 +00:00
parent ef41ff32e2
commit fdd9b8fd2b
7 changed files with 26 additions and 5 deletions

View file

@ -16,8 +16,11 @@
<div>
{{if gt (len .Formats) 0}}
<span class="post-form-field">
{{$defFormat := .DefaultFormat}}
<select id="post-format" name="format" accesskey="F" title="Format (F)">
{{range .Formats}} <option value="{{.Type}}">{{.Name}}</option> {{end}}
{{range .Formats}}
<option value="{{.Type}}" {{if eq $defFormat .Type}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
</span>
{{end}}

View file

@ -4,6 +4,15 @@
<form id="settings-form" action="/settings" method="POST">
<input type="hidden" name="csrf_token" value="{{$.Ctx.CSRFToken}}">
<div class="settings-form-field">
<label for="visibility"> Default format </label>
{{$defFormat := .Settings.DefaultFormat}}
<select id="post-format" name="format">
{{range .PostFormats}}
<option value="{{.Type}}" {{if eq $defFormat .Type}}selected{{end}}>{{.Name}}</option>
{{end}}
</select>
</div>
<div class="settings-form-field">
<label for="visibility"> Default scope </label>
<select id="visibility" name="visibility">