Bug fixes

This commit is contained in:
Inga Kirschnick 2023-12-21 12:48:50 +01:00
parent 08ca938333
commit 0a45e1bb65
3 changed files with 18 additions and 16 deletions

View File

@ -97,14 +97,14 @@ def analysis(corpus_id):
)
# @bp.route('/<hashid:corpus_id>/follow/<token>')
# def follow_corpus(corpus_id, token):
# corpus = Corpus.query.get_or_404(corpus_id)
# if current_user.follow_corpus_by_token(token):
# db.session.commit()
# flash(f'You are following "{corpus.title}" now', category='corpus')
# return redirect(url_for('corpora.corpus', corpus_id=corpus_id))
# abort(403)
@bp.route('/<hashid:corpus_id>/follow/<token>')
def follow_corpus(corpus_id, token):
corpus = Corpus.query.get_or_404(corpus_id)
if current_user.follow_corpus_by_token(token):
db.session.commit()
flash(f'You are following "{corpus.title}" now', category='corpus')
return redirect(url_for('corpora.corpus', corpus_id=corpus_id))
abort(403)
@bp.route('/import', methods=['GET', 'POST'])

View File

@ -135,9 +135,11 @@
<script>
let languageSwitch = document.querySelector('#terms-of-use-modal-switch');
let termsOfUseContent = document.querySelectorAll('.terms-of-use-modal-content');
languageSwitch.addEventListener('change', function() {
termsOfUseContent.forEach(content => {
content.classList.toggle('hide');
if (languageSwitch) {
languageSwitch.addEventListener('change', function() {
termsOfUseContent.forEach(content => {
content.classList.toggle('hide');
});
});
});
}
</script>

View File

@ -273,7 +273,7 @@ publicCorpusFollowerList.add(
{% if cfr.has_permission('MANAGE_FILES') %}
let followerBuildRequest = document.querySelector('#follower-build-request');
followerBuildRequest.addEventListener('click', () => {
requests.corpora.entity.build({{ corpus.hashid|tojson }})
nopaque.requests.corpora.entity.build({{ corpus.hashid|tojson }})
.then((response) => {
window.location.reload();
});
@ -285,7 +285,7 @@ followerBuildRequest.addEventListener('click', () => {
{% if current_user.is_following_corpus(corpus) %}
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 }})
nopaque.requests.corpora.entity.followers.entity.delete({{ corpus.hashid|tojson }}, {{ current_user.hashid|tojson }})
.then((response) => {
window.location.reload();
});
@ -335,7 +335,7 @@ M.Modal.init(
inviteUserModalInviteButtonElement.addEventListener('click', (event) => {
let usernames = inviteUserModalSearch.chipsData.map((chipData) => chipData.tag);
requests.corpora.entity.followers.add({{ corpus.hashid|tojson }}, usernames)
nopaque.requests.corpora.entity.followers.add({{ corpus.hashid|tojson }}, usernames)
.then((response) => {
window.location.reload();
});
@ -383,7 +383,7 @@ M.Modal.init(
shareLinkModalCreateButtonElement.addEventListener('click', (event) => {
let role = shareLinkModalCorpusFollowerRoleSelectElement.value;
let expiration = shareLinkModalExpirationDateDatepickerElement.value
requests.corpora.entity.generateShareLink({{ corpus.hashid|tojson }}, role, expiration)
nopaque.requests.corpora.entity.generateShareLink({{ corpus.hashid|tojson }}, role, expiration)
.then((response) => {
response.json()
.then((json) => {