Add cert counts
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
import { Observable } from 'rx';
|
||||
import dedent from 'dedent';
|
||||
import moment from 'moment';
|
||||
|
||||
@ -15,11 +16,29 @@ export default function about(app) {
|
||||
function showAbout(req, res, next) {
|
||||
const daysRunning = moment().diff(new Date('10/15/2014'), 'days');
|
||||
|
||||
userCount$()
|
||||
.map(camperCount => numberWithCommas(camperCount))
|
||||
.doOnNext(camperCount => {
|
||||
Observable.combineLatest(
|
||||
userCount$(),
|
||||
userCount$({ isFrontEndCert: true }),
|
||||
userCount$({ isDataVisCert: true }),
|
||||
userCount$({ isBackEndCert: true }),
|
||||
(
|
||||
userCount,
|
||||
frontEndCount = 0,
|
||||
dataVisCount = 0,
|
||||
backEndCount = 0
|
||||
) => ({
|
||||
userCount: numberWithCommas(userCount),
|
||||
frontEndCount,
|
||||
dataVisCount,
|
||||
backEndCount
|
||||
})
|
||||
)
|
||||
.doOnNext(({ userCount, frontEndCount, dataVisCount, backEndCount }) => {
|
||||
res.render('resources/about', {
|
||||
camperCount,
|
||||
userCount,
|
||||
frontEndCount,
|
||||
dataVisCount,
|
||||
backEndCount,
|
||||
daysRunning,
|
||||
title: dedent`
|
||||
About our Open Source Community, our social media presence,
|
||||
|
@ -11,7 +11,7 @@ block content
|
||||
| days ago
|
||||
li
|
||||
span.tag Population:	
|
||||
span.text-primary #{camperCount}
|
||||
span.text-primary #{userCount}
|
||||
| campers
|
||||
li
|
||||
span.tag Completed:	
|
||||
@ -23,8 +23,22 @@ block content
|
||||
| in pro-bono code
|
||||
li.nowrap
|
||||
span.tag Pledged:	
|
||||
span.text-primary #{globalPledgedAmount}
|
||||
span.text-primary $#{globalPledgedAmount}
|
||||
| to nonprofits
|
||||
li.nowrap
|
||||
span.tag Certifications earned:
|
||||
li.nowrap
|
||||
span.tag Front End:	
|
||||
span.text-primary #{frontEndCount}
|
||||
| campers
|
||||
li.nowrap
|
||||
span.tag Data Viz:	
|
||||
span.text-primary #{dataVisCount}
|
||||
| campers
|
||||
li.nowrap
|
||||
span.tag Back End:	
|
||||
span.text-primary #{backEndCount}
|
||||
| campers
|
||||
.spacer
|
||||
.row
|
||||
.col-xs-12.col-sm-10.col-sm-offset-1.col-md-6.col-md-offset-3
|
||||
|
Reference in New Issue
Block a user