mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-11-14 16:55:42 +00:00
Bug fixes
This commit is contained in:
parent
08ca938333
commit
0a45e1bb65
@ -97,14 +97,14 @@ def analysis(corpus_id):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
# @bp.route('/<hashid:corpus_id>/follow/<token>')
|
@bp.route('/<hashid:corpus_id>/follow/<token>')
|
||||||
# def follow_corpus(corpus_id, token):
|
def follow_corpus(corpus_id, token):
|
||||||
# corpus = Corpus.query.get_or_404(corpus_id)
|
corpus = Corpus.query.get_or_404(corpus_id)
|
||||||
# if current_user.follow_corpus_by_token(token):
|
if current_user.follow_corpus_by_token(token):
|
||||||
# db.session.commit()
|
db.session.commit()
|
||||||
# flash(f'You are following "{corpus.title}" now', category='corpus')
|
flash(f'You are following "{corpus.title}" now', category='corpus')
|
||||||
# return redirect(url_for('corpora.corpus', corpus_id=corpus_id))
|
return redirect(url_for('corpora.corpus', corpus_id=corpus_id))
|
||||||
# abort(403)
|
abort(403)
|
||||||
|
|
||||||
|
|
||||||
@bp.route('/import', methods=['GET', 'POST'])
|
@bp.route('/import', methods=['GET', 'POST'])
|
||||||
|
@ -135,9 +135,11 @@
|
|||||||
<script>
|
<script>
|
||||||
let languageSwitch = document.querySelector('#terms-of-use-modal-switch');
|
let languageSwitch = document.querySelector('#terms-of-use-modal-switch');
|
||||||
let termsOfUseContent = document.querySelectorAll('.terms-of-use-modal-content');
|
let termsOfUseContent = document.querySelectorAll('.terms-of-use-modal-content');
|
||||||
languageSwitch.addEventListener('change', function() {
|
if (languageSwitch) {
|
||||||
termsOfUseContent.forEach(content => {
|
languageSwitch.addEventListener('change', function() {
|
||||||
content.classList.toggle('hide');
|
termsOfUseContent.forEach(content => {
|
||||||
|
content.classList.toggle('hide');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
}
|
||||||
</script>
|
</script>
|
||||||
|
@ -273,7 +273,7 @@ publicCorpusFollowerList.add(
|
|||||||
{% if cfr.has_permission('MANAGE_FILES') %}
|
{% if cfr.has_permission('MANAGE_FILES') %}
|
||||||
let followerBuildRequest = document.querySelector('#follower-build-request');
|
let followerBuildRequest = document.querySelector('#follower-build-request');
|
||||||
followerBuildRequest.addEventListener('click', () => {
|
followerBuildRequest.addEventListener('click', () => {
|
||||||
requests.corpora.entity.build({{ corpus.hashid|tojson }})
|
nopaque.requests.corpora.entity.build({{ corpus.hashid|tojson }})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
@ -285,7 +285,7 @@ followerBuildRequest.addEventListener('click', () => {
|
|||||||
{% if current_user.is_following_corpus(corpus) %}
|
{% if current_user.is_following_corpus(corpus) %}
|
||||||
let unfollowRequestElement = document.querySelector('.action-button[data-action="unfollow-request"]');
|
let unfollowRequestElement = document.querySelector('.action-button[data-action="unfollow-request"]');
|
||||||
unfollowRequestElement.addEventListener('click', () => {
|
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) => {
|
.then((response) => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
@ -335,7 +335,7 @@ M.Modal.init(
|
|||||||
|
|
||||||
inviteUserModalInviteButtonElement.addEventListener('click', (event) => {
|
inviteUserModalInviteButtonElement.addEventListener('click', (event) => {
|
||||||
let usernames = inviteUserModalSearch.chipsData.map((chipData) => chipData.tag);
|
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) => {
|
.then((response) => {
|
||||||
window.location.reload();
|
window.location.reload();
|
||||||
});
|
});
|
||||||
@ -383,7 +383,7 @@ M.Modal.init(
|
|||||||
shareLinkModalCreateButtonElement.addEventListener('click', (event) => {
|
shareLinkModalCreateButtonElement.addEventListener('click', (event) => {
|
||||||
let role = shareLinkModalCorpusFollowerRoleSelectElement.value;
|
let role = shareLinkModalCorpusFollowerRoleSelectElement.value;
|
||||||
let expiration = shareLinkModalExpirationDateDatepickerElement.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) => {
|
.then((response) => {
|
||||||
response.json()
|
response.json()
|
||||||
.then((json) => {
|
.then((json) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user