update corpus public page

This commit is contained in:
Inga Kirschnick 2023-02-09 11:56:02 +01:00
parent 4d227415d9
commit 66fbf4d57b

View File

@ -67,9 +67,7 @@
followingUserList.add({{ following_users|tojson }}); #} followingUserList.add({{ following_users|tojson }}); #}
corpusFollowingRequest.addEventListener('click', () => { corpusFollowingRequest.addEventListener('click', () => {
corpusFollowingRequest.innerHTML = '<i class="material-icons left">add</i>Unfollow Corpus'; if ({{ current_user.is_following_corpus(corpus)|tojson }}) {
if ("{{ current_user.is_following_corpus(corpus) }}" === "False") {
corpusFollowingRequest.lastChild.textContent = 'Unfollow Corpus';
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
fetch(`/corpora/{{ corpus.hashid }}/unfollow`, {method: 'POST', headers: {Accept: 'application/json'}}) fetch(`/corpora/{{ corpus.hashid }}/unfollow`, {method: 'POST', headers: {Accept: 'application/json'}})
.then( .then(