Donation goal banner

This commit is contained in:
Jeremy Zhang
2019-10-12 22:36:37 -07:00
parent b0c9e6c5ec
commit 0ec0b52501
10 changed files with 182 additions and 7 deletions

View File

@ -81,7 +81,7 @@ img.center-align {
padding-bottom: 0px;
}
#dblbanner {
#dblbanner, #donbanner {
background-color: darkblue;
text-align: center;
font-size: 12pt;
@ -90,11 +90,11 @@ img.center-align {
display: none;
}
#dblbanner a {
#dblbanner a, #donbanner a {
transition: font-size 0.5s;
color: lightskyblue;
}
#dblbanner a:hover {
#dblbanner a:hover, #donbanner a:hover {
font-size: 14pt;
}

View File

@ -0,0 +1,26 @@
function postForm(donation_goal_progress, donation_goal_total, donation_goal_end) {
var funct = $.ajax({
dataType: "json",
method: "POST",
data: {
"donation_goal_progress": donation_goal_progress,
"donation_goal_total": donation_goal_total,
"donation_goal_end": donation_goal_end
}
});
return funct.promise();
}
$("#submit").click(function () {
Materialize.toast("Saving changes...", 2000);
let donation_goal_progress = $("#donation_goal_progress").val();
let donation_goal_total = $("#donation_goal_total").val();
let donation_goal_end = $("#donation_goal_end").val();
let req = postForm(donation_goal_progress, donation_goal_total, donation_goal_end);
req.done(function () {
Materialize.toast("All changes saved!", 2000);
});
req.fail(function () {
Materialize.toast("There is an error saving changes.", 2000);
});
});