diff --git a/bookwyrm/static/js/guided_tour.js b/bookwyrm/static/js/guided_tour.js new file mode 100644 index 000000000..7c9d9a7f1 --- /dev/null +++ b/bookwyrm/static/js/guided_tour.js @@ -0,0 +1,17 @@ +/** + * Set guided tour user value to False + * @param {csrf_token} string + * @return {undefined} + */ + +function disableGuidedTour(csrf_token) { + console.log(csrf_token); + fetch('/guided-tour/False', { + headers: { + 'X-CSRFToken': csrf_token, + }, + method: 'POST', + redirect: 'follow', + mode: 'same-origin', + }) +} diff --git a/bookwyrm/templates/guided_tour/group.html b/bookwyrm/templates/guided_tour/group.html index 619c48929..68d4e7759 100644 --- a/bookwyrm/templates/guided_tour/group.html +++ b/bookwyrm/templates/guided_tour/group.html @@ -1,21 +1,19 @@ {% load i18n %} {% csrf_token %} + + + diff --git a/bookwyrm/templates/guided_tour/user_groups.html b/bookwyrm/templates/guided_tour/user_groups.html index 1eebe2a09..603bc53b6 100644 --- a/bookwyrm/templates/guided_tour/user_groups.html +++ b/bookwyrm/templates/guided_tour/user_groups.html @@ -1,19 +1,6 @@ {% load i18n %} -{% csrf_token %} diff --git a/bookwyrm/templates/layout.html b/bookwyrm/templates/layout.html index 0155c6650..9c99eb7fa 100644 --- a/bookwyrm/templates/layout.html +++ b/bookwyrm/templates/layout.html @@ -225,6 +225,7 @@ + {% block scripts %}{% endblock %}