Add templ package to handle rendering of templates
This commit is contained in:
parent
e6b5ea3921
commit
e7e420cd47
6 changed files with 25 additions and 14 deletions
29
templates/edit.tmpl.html
Normal file
29
templates/edit.tmpl.html
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
{{define "title"}}Edit {{.note.Title}}{{end}}
|
||||
|
||||
{{define "main"}}
|
||||
<form action="{{.urlEdit}}" method="POST">
|
||||
<div class="mb-3">
|
||||
<label for="noteBodyInput" class="form-label">Note</label>
|
||||
<div class="border rounded rounded-1">
|
||||
<div id="toolbar"></div>
|
||||
<textarea class="form-control" id="noteBodyInput" name="body" aria-described-by="bodyHelp">{{.noteBody}}</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="https://unpkg.com/tiny-markdown-editor/dist/tiny-mde.min.js"></script>
|
||||
<link
|
||||
rel="stylesheet"
|
||||
type="text/css"
|
||||
href="https://unpkg.com/tiny-markdown-editor/dist/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