Allow authors to hide editor notes
This commit is contained in:
parent
045a2c2379
commit
c9ee420dbb
|
@ -1,11 +1,21 @@
|
|||
{{ template "base.html" . }}
|
||||
|
||||
{{ define "extrahead" }}
|
||||
<style>
|
||||
.hide-notes .note {
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{{ end }}
|
||||
|
||||
{{ define "content" }}
|
||||
<h1>{{ .Title }}</h1>
|
||||
{{ if and .User .User.IsEduAuthor }}
|
||||
<div class="mb3">
|
||||
<a href="{{ .EditUrl }}" title="Edit">✎ Edit</a>
|
||||
<a href="{{ .DeleteUrl }}" title="Delete">✖ Delete</a>
|
||||
<input id="hide-notes" type="checkbox">
|
||||
<label for="hide-notes">Hide notes</label>
|
||||
</div>
|
||||
{{ end }}
|
||||
<div class="flex">
|
||||
|
@ -16,4 +26,16 @@
|
|||
I'm a sidebar!
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function toggleNotes() {
|
||||
document.querySelector('.edu-article').classList.toggle('hide-notes',
|
||||
document.querySelector('#hide-notes').checked,
|
||||
);
|
||||
}
|
||||
document.querySelector('#hide-notes').addEventListener('change', event => {
|
||||
toggleNotes();
|
||||
});
|
||||
toggleNotes();
|
||||
</script>
|
||||
{{ end }}
|
||||
|
|
Loading…
Reference in New Issue