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