Changeset - 8cb1f3f685eb
[Not reviewed]
0 1 0
Brett Smith (brett) - 7 years ago 2016-11-29 18:13:40
brett@sfconservancy.org
js: Use three-part progressbar when no middle goal defined.

Since our current fundraiser doesn't have a "middle goal," this makes
it a little easier to maintain the template and do the math.
1 file changed with 9 insertions and 7 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/js/supporter-page.js
Show inline comments
...
 
@@ -48,19 +48,21 @@ $(document).ready(function() {
 
    if (noCommaSiteSoFar >= noCommaSiteMiddleGoal) {
 
        // We've got
 
        var leftOver = noCommaMatchFinalGoal - noCommaSiteSoFar;
 
        var supporterProgress = (noCommaSiteSoFar / noCommaSiteFinalGoal) * 100;
 
        var matchProgress = (noCommaSiteMatchCount / noCommaSiteFinalGoal) * 100;
 
        var needProgress = 100 - matchProgress;
 

	
 
        $('#siteprogressbar').
 
            multiprogressbar({ parts: [
 
                { value: (noCommaSiteSoFar / noCommaSiteFinalGoal) * 100,
 
                { value: supporterProgress,
 
                  text: noCommaSiteSoFar.toLocaleString() + " have joined!",
 
                  barClass: "progress", textClass: "soFarText" },
 
                { value:
 
                  ((noCommaMatchFinalGoal - noCommaSiteMiddleGoal) / noCommaSiteFinalGoal) * 100,
 
                  text: leftOver.toLocaleString() + " more needed to save license compliance work.",
 
                { value: needProgress,
 
                  text: leftOver.toLocaleString() + " more needed",
 
                  barClass: "final-goal", textClass: "goalText" },
 
                {  value: 100,
 
                   text: siteMatchCount + " matched!",
 
                   barClass: "progress", textClass: "soFarText" },
 
                { value: 100,
 
                  text: noCommaSiteMatchCount.toLocaleString() + " matched!",
 
                  barClass: "progress", textClass: "soFarText" },
 
            ]});
 
    } else {
 
        $('#siteprogressbar').
0 comments (0 inline, 0 general)