Further work on note ownership and sharing
This commit is contained in:
parent
bb775ec55f
commit
4fda818e6e
4 changed files with 125 additions and 34 deletions
|
|
@ -24,10 +24,30 @@
|
|||
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,
|
||||
commands: [
|
||||
'bold', 'italic', 'strikethrough',
|
||||
'|',
|
||||
'code',
|
||||
'|',
|
||||
'h1', 'h2',
|
||||
'|',
|
||||
'ul', 'ol', {name: "checklist", title: "Check List", action: makeChecklist},
|
||||
'|',
|
||||
'blockquote', 'hr',
|
||||
'|',
|
||||
'insertLink', 'insertImage'
|
||||
],
|
||||
});
|
||||
|
||||
|
||||
function makeChecklist(editor) {
|
||||
editor.wrapSelection("* [ ] ", "")
|
||||
};
|
||||
</script>
|
||||
{{end}}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,26 @@
|
|||
<a class="btn btn-primary" href="{{.urlEdit}}">Edit</a>
|
||||
<a class="btn btn-danger" href="{{.urlDelete}}">Delete</a>
|
||||
</div>
|
||||
<div class="mt-2">
|
||||
<h3>Ownership</h3>
|
||||
{{if .note.Viewers}}
|
||||
<p>This note is owned by <em>{{.note.Owner}}</em> and is further visible to</p>
|
||||
<ul>
|
||||
{{range .viewers}}
|
||||
<li>{{.}}</li>
|
||||
{{end}}
|
||||
</ul>
|
||||
{{else}}
|
||||
<p>This note is owned by <em>{{.note.Owner}}</em>.</p>
|
||||
{{end}}
|
||||
|
||||
<form action="{{.urlShare}}" method="POST">
|
||||
<div class="mb-3">
|
||||
<input type="text" class="form-control" id="viewerInput" name="viewer" aria-described-by="viewerHelp" />
|
||||
<div id="viewerHelp" class="form-text">Share with other user</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" type="submit">Share</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let checkBoxes = document.querySelectorAll('input[type=checkbox]')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue