mirror of
https://gitlab.ub.uni-bielefeld.de/sfb1288inf/nopaque.git
synced 2024-12-24 02:24:20 +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>')
|
||||
# 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'])
|
||||
|
@ -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>
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user