Changeset - 963c023eabb6
[Not reviewed]
0 2 0
Bradley Kuhn (bkuhn) - 6 years ago 2015-12-01 03:19:46
bkuhn@ebb.org
site-wide supporter count fundraiser.

Using the jQuery UI multiprogress bar added earlier, this change allows
display of the of the progress bar on every page.
2 files changed with 63 insertions and 0 deletions:
0 comments (0 inline, 0 general)
www/conservancy/static/css/conservancy.css
Show inline comments
...
 
@@ -125,6 +125,38 @@ h3 { margin-top: .6em; margin-bottom: .4em; }
 
    background: rgb(206, 31, 31);
 
}
 

	
 
#siteprogressbar {
 
    margin: .5em 20% .5em 2%;
 
}
 
#siteprogressbar .goalText {
 
    color: #557733;
 
    font-size: 10pt;
 
}
 
#siteprogressbar .soFarText {
 
    font-size: 10pt;
 
}
 
#siteprogressbar .progress {
 
    background: #577632;
 
}
 
@media all and (max-width: 600px) {
 
  .goalText {
 
      font-size: 8pt;
 
  }
 
  .soFarText {
 
      font-size: 8pt;
 
  }
 
}
 
#siteprogressbar .progress {
 
    background: #577632;
 
}
 
#siteprogressbar .middle-goal {
 
    background: #d0d0d0;
 
}
 

	
 
#siteprogressbar .final-goal {
 
    background: #eeeeee;
 
}
 

	
 
#fundraiser-percentage {
 
    text-align: center;
 
}
www/conservancy/static/js/supporter-page.js
Show inline comments
...
 
@@ -5,6 +5,18 @@
 
*/
 

	
 
$(document).ready(function() {
 
    var siteFinalGoal = $('span#site-fundraiser-final-goal').text();
 
    var noCommaSiteFinalGoal = parseInt(siteFinalGoal.replace(/,/g, ""));
 
    var siteMiddleGoal = $('span#site-fundraiser-middle-goal').text();
 
    var noCommaSiteMiddleGoal = parseInt(siteMiddleGoal.replace(/,/g, ""));
 
    var siteSoFar = $('span#site-fundraiser-so-far').text();
 
    var noCommaSiteSoFar = parseInt(siteSoFar.replace(/,/g, ""));
 
    var siteMatchCount = $('span#site-fundraiser-match-count').text();
 
    var noCommaSiteMatchCount = parseInt(siteMatchCount.replace(/,/g, ""));
 
    if (! noCommaSiteMatchCount) {
 
        noCommaSiteMatchCount = "0";
 
    }
 
    var noCommaMatchFinalGoal = noCommaSiteFinalGoal - noCommaSiteMatchCount;
 
    var goal  = $('span#fundraiser-goal').text();
 
    var soFar = $('span#fundraiser-so-far').text();
 
    var donationCount = $('span#fundraiser-donation-count').text();
...
 
@@ -17,6 +29,25 @@ $(document).ready(function() {
 
    var curDonationCount = 0;
 
    var riseLevelPercent = 0.5;
 
    var incrementDonationCount = Math.round( (riseLevelPercent / 100) * noCommaDonationCount );
 
    $('#siteprogressbar').empty();
 

	
 
    $('#siteprogressbar').
 
        multiprogressbar({ parts: [
 
          { value: (noCommaSiteSoFar / noCommaSiteFinalGoal) * 100,
 
            text: siteSoFar + " joined!",
 
            barClass: "progress", textClass: "soFarText" },
 
            { value: ((noCommaSiteMiddleGoal - noCommaSiteSoFar) / noCommaSiteFinalGoal) * 100,
 
            text: siteMiddleGoal + " will save our basic work",
 
            barClass: "middle-goal", textClass: "goalText" },
 
            { value: 
 
              ((noCommaMatchFinalGoal - noCommaSiteMiddleGoal) / noCommaSiteFinalGoal) * 100,
 
              text: noCommaMatchFinalGoal.toLocaleString() + " will save license compliance", 
 
              barClass: "final-goal", textClass: "goalText" },
 
            {  value: 100,
 
               text: siteMatchCount + " matched!",
 
               barClass: "progress", textClass: "soFarText" },
 

	
 
        ]});
 

	
 
    $('span#fundraiser-percentage').css({ 'color'        : 'green',
 
                                          'font-weight'  : 'bold',
0 comments (0 inline, 0 general)