fix issue with nonprofit show views not loading

This commit is contained in:
Quincy Larson
2015-07-31 22:06:07 -07:00
parent feab8b508e
commit 7b85031a8a

View File

@ -64,21 +64,21 @@ module.exports = function(app) {
return res.redirect('../nonprofit/' + dashedNameFull); return res.redirect('../nonprofit/' + dashedNameFull);
} }
var buttonActive = false; //We need to create logic that verifies completion. Defaulting to false for now.
if ( //var buttonActive = false;
req.user && //if (
req.user.uncompletedBonfires.length === 0 && // req.user &&
req.user.completedCoursewares.length > 63 // req.user.completedCoursewares.length > 63
) { //) {
var hasShownInterest = // var hasShownInterest =
nonprofit.interestedCampers.filter(function(user) { // nonprofit.interestedCampers.filter(function(user) {
return user.username === req.user.username; // return user.username === req.user.username;
}); // });
//
if (hasShownInterest.length === 0) { // if (hasShownInterest.length === 0) {
buttonActive = true; // buttonActive = true;
} // }
} //}
res.render('nonprofits/show', { res.render('nonprofits/show', {
dashedName: dashedNameFull, dashedName: dashedNameFull,
@ -112,7 +112,7 @@ module.exports = function(app) {
whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo, whatDoesNonprofitDo: nonprofit.whatDoesNonprofitDo,
interestedCampers: nonprofit.interestedCampers, interestedCampers: nonprofit.interestedCampers,
assignedCampers: nonprofit.assignedCampers, assignedCampers: nonprofit.assignedCampers,
buttonActive: buttonActive, buttonActive: false,
moneySaved: nonprofit.moneySaved, moneySaved: nonprofit.moneySaved,
currentStatus: nonprofit.currentStatus currentStatus: nonprofit.currentStatus
}); });