mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2025-02-23 01:03:23 -05:00
Changes the color coding for volunteers who have redeemed all their hours.
This commit is contained in:
parent
7b1e3f0545
commit
6846165297
24
js/shop.js
24
js/shop.js
@ -91,7 +91,6 @@ $(function(){
|
|||||||
var volunteer_hours_redeemed = 0;
|
var volunteer_hours_redeemed = 0;
|
||||||
var obj = $.parseJSON(data);
|
var obj = $.parseJSON(data);
|
||||||
|
|
||||||
console.log(obj.volunteer);
|
|
||||||
var volunteer = "", remaining = 0, vhr = "", max_bikes_earned = 0;
|
var volunteer = "", remaining = 0, vhr = "", max_bikes_earned = 0;
|
||||||
if (obj.volunteer) {
|
if (obj.volunteer) {
|
||||||
volunteer = $.parseJSON(obj.volunteer);
|
volunteer = $.parseJSON(obj.volunteer);
|
||||||
@ -109,17 +108,28 @@ $(function(){
|
|||||||
"Volunteer Hours Remaining: " + remaining + "\r\n" +
|
"Volunteer Hours Remaining: " + remaining + "\r\n" +
|
||||||
"Max Bikes Earned: " + max_bikes_earned;
|
"Max Bikes Earned: " + max_bikes_earned;
|
||||||
|
|
||||||
|
var volunteer_with_redeemed_hours_at_zero = obj.current_year_volunteer_hours - vhr;
|
||||||
|
|
||||||
if (obj.contact_id) {
|
if (obj.contact_id) {
|
||||||
|
|
||||||
if (obj.volunteer_hours && obj.volunteer_hours !== '0') {
|
if (obj.volunteer_hours && obj.volunteer_hours !== '0') {
|
||||||
|
|
||||||
$(".volunteer_hours_" + obj.contact_id).
|
if (volunteer_with_redeemed_hours_at_zero !== 0) {
|
||||||
html("Summary | <span><a href='./contact_add_edit_select.php?contact_id=" +
|
$(".volunteer_hours_" + obj.contact_id).
|
||||||
obj.contact_id +
|
html("Summary | <span><a href='./contact_add_edit_select.php?contact_id=" +
|
||||||
"'>Update Interests</a></span>").
|
obj.contact_id +
|
||||||
parent().css({backgroundColor: "#19a0cc", textAlign: "center", cursor: "cell"}).
|
"'>Update Interests</a></span>").
|
||||||
prop("title",title).css({textAlign: "center"});
|
parent().css({backgroundColor: "#19a0cc", textAlign: "center", cursor: "cell"}).
|
||||||
|
prop("title",title).css({textAlign: "center"});
|
||||||
|
} else {
|
||||||
|
$(".volunteer_hours_" + obj.contact_id).
|
||||||
|
html("Summary | <span><a href='./contact_add_edit_select.php?contact_id=" +
|
||||||
|
obj.contact_id +
|
||||||
|
"'>Update Interests</a></span>").
|
||||||
|
parent().css({backgroundColor: "rgb(216, 198, 39)", textAlign: "center", cursor: "cell"}).
|
||||||
|
prop("title",title).css({textAlign: "center"});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user