Embed templates and static files
This commit is contained in:
parent
868d2a7bbd
commit
8edd857d22
11 changed files with 31 additions and 17 deletions
32
internal/conf/templates/edit.tmpl.html
Normal file
32
internal/conf/templates/edit.tmpl.html
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
{{define "title"}}Edit {{.note.Title}}{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
<form action="{{.urlSave}}" method="POST">
|
||||
<div class="mb-3">
|
||||
<input type="text" class="form-control" id="noteTitleInput" name="title" aria-described-by="titleHelp" value="{{.note.Title}}"/>
|
||||
<div id="titleHelp" class="form-text">Enter your note title</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<div class="border rounded rounded-1">
|
||||
<div id="toolbar"></div>
|
||||
<textarea class="form-control" id="noteBodyInput" name="body" aria-described-by="bodyHelp">{{.text}}</textarea>
|
||||
</div>
|
||||
<div id="bodyHelp" class="form-text">Enter your note content in markdown</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">Save</button>
|
||||
</form>
|
||||
|
||||
<script src="/static/js/tiny-mde.min.js"></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="/static/css/tiny-mde.min.css"
|
||||
/>
|
||||
<script type="text/javascript">
|
||||
var tinyMDE = new TinyMDE.Editor({ textarea: "noteBodyInput" });
|
||||
var commandBar = new TinyMDE.CommandBar({
|
||||
element: "toolbar",
|
||||
editor: tinyMDE,
|
||||
});
|
||||
</script>
|
||||
{{end}}
|
||||
Loading…
Add table
Add a link
Reference in a new issue