From 10508eb5d4698e2328b7e9b4f69b11ed63a96621 Mon Sep 17 00:00:00 2001 From: Ethan Nguyen Date: Fri, 30 Jul 2021 18:18:02 -0400 Subject: [PATCH] feat(profile): add JS confirmation when publishing profile --- tjdests/static/main.js | 18 ++++++++++++++++++ tjdests/templates/base.html | 11 +---------- 2 files changed, 19 insertions(+), 10 deletions(-) create mode 100644 tjdests/static/main.js diff --git a/tjdests/static/main.js b/tjdests/static/main.js new file mode 100644 index 0000000..9048241 --- /dev/null +++ b/tjdests/static/main.js @@ -0,0 +1,18 @@ +$(document).ready(function(){ + $("select").each(function(){ + new TomSelect("#" + this.id, {allowEmptyOption: true, "plugins": ["change_listener"]}); + }); + $(function () { + $('[data-toggle="tooltip"]').tooltip() + }) + + $("#id_publish_data").change(function () { + if (this.checked) { + var confirmreturn = confirm("You have indicated that you wish to publicize the data that you have entered. " + + "Note that any current and future TJHSST student will be able to view your data. You may unpublish your data at any time.\n\n" + + "By selecting the affirmative answer below, you declare that all data that you have entered and " + + "will enter in the future is accurate to the best of your belief. ") + $(this).prop("checked", confirmreturn) + } + }) +}) \ No newline at end of file diff --git a/tjdests/templates/base.html b/tjdests/templates/base.html index 3488f66..cccc299 100644 --- a/tjdests/templates/base.html +++ b/tjdests/templates/base.html @@ -16,16 +16,7 @@ - + {{ settings.BRANDING_NAME }} {{ settings.SENIOR_GRAD_YEAR }}