feat(profile): add JS confirmation when publishing profile

This commit is contained in:
Ethan Nguyen 2021-07-30 18:18:02 -04:00
parent f5b8211b48
commit 10508eb5d4
No known key found for this signature in database
GPG Key ID: B4CA5339AF911920
2 changed files with 19 additions and 10 deletions

18
tjdests/static/main.js Normal file
View File

@ -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)
}
})
})

View File

@ -16,16 +16,7 @@
<script src="{% static "tom-select.complete.min.js" %}" integrity="sha384-Hnof5Csstpcrk+thlHZ8VXXkD/Wk96gkCvwIvpwYLBVIAPyQA3gkqcPO+RwLARmZ"></script> <script src="{% static "tom-select.complete.min.js" %}" integrity="sha384-Hnof5Csstpcrk+thlHZ8VXXkD/Wk96gkCvwIvpwYLBVIAPyQA3gkqcPO+RwLARmZ"></script>
<link rel="stylesheet" href="{% static "tom-select.bootstrap5.css" %}" integrity="sha384-3syGtcTzvEB6zjzJ4BQ2loMdsaYaxAjWjD3GcbCLAPAE2XkENSR94WcY8c3g5lNu" /> <link rel="stylesheet" href="{% static "tom-select.bootstrap5.css" %}" integrity="sha384-3syGtcTzvEB6zjzJ4BQ2loMdsaYaxAjWjD3GcbCLAPAE2XkENSR94WcY8c3g5lNu" />
<script> <script src="{% static "main.js" %}"></script>
$(document).ready(function(){
$("select").each(function(){
new TomSelect("#" + this.id, {allowEmptyOption: true, "plugins": ["change_listener"]});
});
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
})
</script>
<title>{{ settings.BRANDING_NAME }} {{ settings.SENIOR_GRAD_YEAR }}</title> <title>{{ settings.BRANDING_NAME }} {{ settings.SENIOR_GRAD_YEAR }}</title>
</head> </head>