make is_administrator a property, add back db events

This commit is contained in:
Patrick Jentsch
2024-04-11 14:33:47 +02:00
parent d0d2a8abd6
commit ccf484c9bc
24 changed files with 205 additions and 74 deletions

View File

@ -120,7 +120,7 @@
{% block modals %}
{{ super() }}
{% if current_user == corpus.user or current_user.is_administrator() %}
{% if current_user == corpus.user or current_user.is_administrator %}
<div class="modal" id="publishing-modal">
<div class="modal-content">
<h4>Change your Corpus publishing status</h4>
@ -247,7 +247,7 @@
});
{% endif %}
{% if current_user == corpus.user or current_user.is_administrator() %}
{% if current_user == corpus.user or current_user.is_administrator %}
// #region Publishing
let publishingModalIsPublicSwitchElement = document.querySelector('#publishing-modal-is-public-switch');
publishingModalIsPublicSwitchElement.addEventListener('change', (event) => {

View File

@ -77,7 +77,7 @@
</div>
</div>
<div class="card-action right-align">
{% if current_user.is_administrator() %}
{% if current_user.is_administrator %}
<a class="action-button btn disabled waves-effect waves-light modal-trigger" data-action="get-log-request" id="job-log-button" href="#job-log-modal"><i class="material-icons left">text_snippet</i>Log</a>
{% endif %}
<a class="btn disabled waves-effect waves-light modal-trigger" href="#restart-job-modal"><i class="material-icons left">repeat</i>Restart</a>
@ -159,7 +159,7 @@
nopaque.requests.jobs.entity.restart({{ job.hashid|tojson }});
});
if ({{ current_user.is_administrator()|tojson }}) {
if ({{ current_user.is_administrator|tojson }}) {
let jobLogButtonElement = document.querySelector('#job-log-button');
jobLogButtonElement.addEventListener('click', (event) => {
nopaque.requests.jobs.entity.log({{ job.hashid|tojson }})