Merge branch 'map-ad' into staging

This commit is contained in:
Berkeley Martinez
2015-10-31 22:13:34 -07:00
3 changed files with 45 additions and 25 deletions

View File

@ -689,6 +689,12 @@ iframe.iphone {
transition: background .2s ease-in-out, border .2s ease-in-out; transition: background .2s ease-in-out, border .2s ease-in-out;
} }
.population-table {
@media (max-width: 767px) {
font-size: 16px;
}
}
@media (max-width: 991px) { @media (max-width: 991px) {
.navbar-header { .navbar-header {
float: none; float: none;

View File

@ -35,12 +35,14 @@ const dasherize = utils.dasherize;
const unDasherize = utils.unDasherize; const unDasherize = utils.unDasherize;
const getMDNLinks = utils.getMDNLinks; const getMDNLinks = utils.getMDNLinks;
/*
function makeChallengesUnique(challengeArr) { function makeChallengesUnique(challengeArr) {
// clone and reverse challenges // clone and reverse challenges
// then filter by unique id's // then filter by unique id's
// then reverse again // then reverse again
return _.uniq(challengeArr.slice().reverse(), 'id').reverse(); return _.uniq(challengeArr.slice().reverse(), 'id').reverse();
} }
*/
function numberWithCommas(x) { function numberWithCommas(x) {
return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); return x.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',');
} }
@ -556,7 +558,7 @@ module.exports = function(app) {
dashedName: dasherize(blockArray[0].block), dashedName: dasherize(blockArray[0].block),
challenges: blockArray, challenges: blockArray,
completed: completedCount / blockArray.length * 100, completed: completedCount / blockArray.length * 100,
time: blockArray[0] && blockArray[0].time || "???" time: blockArray[0] && blockArray[0].time || '???'
}; };
}) })
.filter(({ name }) => name !== 'Hikes') .filter(({ name }) => name !== 'Hikes')
@ -579,6 +581,9 @@ module.exports = function(app) {
res.render('challengeMap/show', { res.render('challengeMap/show', {
blocks, blocks,
daysRunning, daysRunning,
globalCompletedCount: numberWithCommas(
5612952 + (Math.floor((Date.now() - 1446268581061) / 3000))
),
camperCount, camperCount,
lastCompleted, lastCompleted,
title: "A map of all Free Code Camp's Challenges" title: "A map of all Free Code Camp's Challenges"

View File

@ -10,27 +10,36 @@ block content
else else
img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png') img.img-responsive.img-center.border-radius-5(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png')
.col-xs-12.col-md-8.col-md-offset-2 .col-xs-12.col-md-8.col-md-offset-2
h2.text-center h2
span.text-primary #{camperCount}   table.population-table.img-center
| campers have joined our community tr
br td Established: 
| since we launched   td
span.text-primary #{daysRunning}  span.text-primary #{daysRunning} 
| days ago. | days ago
tr
td Population: 
td
span.text-primary #{camperCount} 
| campers
tr
td Completed: 
td
span.text-primary #{globalCompletedCount} 
| challenges
.spacer .spacer
if (user && user.progressTimestamps.length > 5) if (user && user.progressTimestamps.length > 100)
#tshirt-notice.col-xs-12.col-md-8.col-md-offset-2.hidden #map-notice.col-xs-12.col-md-8.col-md-offset-2.hidden
h2.text-center Get our first-edition t-shirt. h2.text-center We have a subreddit
br img.thumbnail.img-center.img-responsive(src="http://i.imgur.com/lyd0bfM.jpg")
span.text-success Only available until Oct 29! h4.text-center We welcome you to come ask questions and share your thoughts with our entire open source community.
img.thumbnail.img-center.img-responsive(src="http://i.imgur.com/o07uuOL.png") a.button.btn.btn-block.btn-primary(href="https://reddit.com/r/freecodecamp" target="_blank") Check it out
p.text-justify Our community has voted. Get our winning design emblazoned on a durable, American-made American Apparel shirt (available in women's and men's sizes). 
a(href="https://teespring.com/free-code-camp-shirt-eu" target="_blank") Also ships from Europe
| .
a.button.btn.btn-block.signup-btn(href="https://teespring.com/get-free-code-camp-t-shirt" target="_blank") Get yours
.button-spacer .button-spacer
.text-center .text-center
a#hideTshirtNoticeButton(href='#') Hide this forever a#hide-map-notice-button(href='#') Hide this
.spacer .spacer
.row .row
.col-xs-12.col-sm-8.col-sm-offset-2 .col-xs-12.col-sm-8.col-sm-offset-2
@ -131,14 +140,14 @@ block content
var username = !{JSON.stringify(user && user.username || '')}; var username = !{JSON.stringify(user && user.username || '')};
var lastCompleted = !{JSON.stringify(lastCompleted || false)} var lastCompleted = !{JSON.stringify(lastCompleted || false)}
$(document).ready(function () { $(document).ready(function () {
if (!localStorage || !localStorage.hideTshirtNotice) { if (!localStorage || !localStorage.hideRedditNotice) {
$("#tshirt-notice").removeClass("hidden"); $("#map-notice").removeClass("hidden");
} }
$("#hideTshirtNoticeButton").on("click", function() { $("#hide-map-notice-button").on("click", function() {
$("#tshirt-notice").addClass('animated fadeOut'); $("#map-notice").addClass('animated fadeOut');
setTimeout(function() { setTimeout(function() {
$("#tshirt-notice").hide(); $("#map-notice").hide();
}, 1000); }, 1000);
localStorage.hideTshirtNotice = "true"; localStorage.hideRedditNotice = "true";
}); });
}); });