Add editor interface
This commit is contained in:
@@ -18,12 +18,30 @@
|
||||
<main>
|
||||
{{if .EditMode}}
|
||||
<form class="edit-form" method="POST" action="{{.PostURL}}">
|
||||
<textarea name="content" autofocus>{{.RawContent}}</textarea>
|
||||
<div class="editor-toolbar">
|
||||
<button type="button" class="btn-tool" data-action="bold" title="Bold">**</button>
|
||||
<button type="button" class="btn-tool" data-action="italic" title="Italic">*</button>
|
||||
<span class="toolbar-sep"></span>
|
||||
<button type="button" class="btn-tool" data-action="h1" title="Heading 1">#</button>
|
||||
<button type="button" class="btn-tool" data-action="h2" title="Heading 2">##</button>
|
||||
<button type="button" class="btn-tool" data-action="h3" title="Heading 3">###</button>
|
||||
<span class="toolbar-sep"></span>
|
||||
<button type="button" class="btn-tool" data-action="code" title="Inline code">`</button>
|
||||
<button type="button" class="btn-tool" data-action="codeblock" title="Code block">```</button>
|
||||
<span class="toolbar-sep"></span>
|
||||
<button type="button" class="btn-tool" data-action="link" title="Link">[]</button>
|
||||
<button type="button" class="btn-tool" data-action="quote" title="Blockquote">></button>
|
||||
<button type="button" class="btn-tool" data-action="ul" title="Unordered list">-</button>
|
||||
<button type="button" class="btn-tool" data-action="ol" title="Ordered list">1.</button>
|
||||
<button type="button" class="btn-tool" data-action="hr" title="Horizontal rule">---</button>
|
||||
</div>
|
||||
<textarea name="content" id="editor" autofocus>{{.RawContent}}</textarea>
|
||||
<div class="form-actions">
|
||||
<a class="btn-cancel" href="{{.PostURL}}">CANCEL</a>
|
||||
<button class="btn-save" type="submit">SAVE</button>
|
||||
</div>
|
||||
</form>
|
||||
<script src="/_/editor.js"></script>
|
||||
{{else}} {{if .Content}}
|
||||
<div class="content">{{.Content}}</div>
|
||||
{{end}} {{if .Entries}}
|
||||
|
||||
Reference in New Issue
Block a user