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