(Public-)Corpus List fix+highligting owner status

This commit is contained in:
Inga Kirschnick
2023-05-05 08:41:14 +02:00
parent 8a85dd9e61
commit b07addc5c3
9 changed files with 51 additions and 58 deletions

View File

@ -110,8 +110,8 @@
</table>
<br>
<p></p>
{% if not current_user.is_following_corpus(corpus) %}
<a class="waves-effect waves-light btn-small">Request Corpus</a>
{% if not current_user.is_following_corpus(corpus) and corpus.user.has_profile_privacy_setting('SHOW_EMAIL') %}
<a class="waves-effect waves-light btn-small" href="mailto:{{ corpus.user.email }}">Request Corpus</a>
{% endif %}
<a class="waves-effect waves-light btn-small" href="{{ url_for('users.user', user_id=corpus.user.id) }}">View profile</a>
</div>
@ -153,7 +153,7 @@
{% block modals %}
{{ super() }}
{% if cfr.has_permission('MANAGE_FOLLOWERS') %}
{% 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>
@ -172,9 +172,7 @@
<a class="modal-close waves-effect waves-green btn-flat">Close</a>
</div>
</div>
{% endif %}
{% if current_user == corpus.user or current_user.is_administrator() %}
<div class="modal" id="delete-modal">
<div class="modal-content">
<h4>Confirm Corpus deletion</h4>
@ -221,9 +219,9 @@
You can set different roles via the link, you can also edit them later in the menu below.
It is recommended not to set the expiration date of the link too far.
</p>
<h5>Please make sure that the invited users are legally allowed to view the included corpus files.</h5>
<p><b>Please make sure that the invited users are legally allowed to view the included corpus files.</b></p>
<div class="row">
<div class="col s12 l3">
<div class="col s12 l2">
<div class="input-field">
<i class="material-icons prefix">badge</i>
<select id="share-link-modal-corpus-follower-role-select">
@ -241,12 +239,12 @@
<label for="expiration-date">Expiration date</label>
</div>
</div>
<div class="col s12 l3">
<div class="col s12 l2">
<br class="hide-on-med-and-down">
<a class="btn waves-effect waves-light" id="share-link-modal-create-button">Create<i class="material-icons right">send</i></a>
</div>
<div class="col s12 l6">
<div class="col s12 l5">
<div class="row hide" id="share-link-modal-output-container">
<div class="col s9">
<div class="input-field">
@ -275,13 +273,6 @@
let corpusDisplay = new CorpusDisplay(document.querySelector('#corpus-display'));
{% if current_user.is_following_corpus(corpus) %}
{% if cfr.has_permission('MANAGE_FILES') %}
let buildButton = document.querySelector('#build-button');
buildButton.addEventListener('click', () => {
Requests.corpora.entity.build({{ corpus.hashid|tojson }})
});
{% endif %}
let unfollowRequestElement = document.querySelector('.action-button[data-action="unfollow-request"]');
unfollowRequestElement.addEventListener('click', () => {
Requests.corpora.entity.followers.entity.delete({{ corpus.hashid|tojson }}, {{ current_user.hashid|tojson }})
@ -321,8 +312,8 @@ let inviteUserModalSearchElement = document.querySelector('#invite-user-modal-se
let inviteUserModalInviteButtonElement = document.querySelector('#invite-user-modal-invite-button');
let users = {
{% for user in users %}
{{ user.username|tojson }}: {{ url_for('users.user_avatar', user_id=user.id)|tojson }}
{% if not loop.last %},{% endif %}
{{ user.username|tojson }}: {{ url_for('users.user_avatar', user_id=user.id)|tojson }}
{% if not loop.last %},{% endif %}
{% endfor %}
};