From f30239fb6c80734c1e69de6549bd650dde9b26dd Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 12 Oct 2015 22:56:10 -0700 Subject: [PATCH 1/2] add time estimates to challenge blocks on map --- seed/challenges/advanced-bonfires.json | 1 + seed/challenges/angularjs.json | 1 + .../automated-testing-and-debugging.json | 1 + seed/challenges/basejumps.json | 1 + seed/challenges/basic-bonfires.json | 1 + seed/challenges/basic-javascript.json | 1 + seed/challenges/basic-ziplines.json | 1 + seed/challenges/bootstrap.json | 1 + .../front-end-development-certificate.json | 1 + .../full-stack-development-certificate.json | 1 + seed/challenges/gear-up-for-success.json | 1 + seed/challenges/getting-started.json | 1 + seed/challenges/git.json | 1 + seed/challenges/hikes.json | 1 + seed/challenges/html5-and-css.json | 1 + seed/challenges/intermediate-bonfires.json | 1 + seed/challenges/intermediate-ziplines.json | 1 + seed/challenges/jquery.json | 1 + seed/challenges/mongodb.json | 1 + seed/challenges/nodejs-and-expressjs.json | 1 + ...t-oriented-and-functional-programming.json | 1 + .../upper-intermediate-bonfires.json | 1 + seed/index.js | 1 + server/boot/challenge.js | 3 +- server/views/challengeMap/show.jade | 68 ++++++++++--------- 25 files changed, 61 insertions(+), 33 deletions(-) diff --git a/seed/challenges/advanced-bonfires.json b/seed/challenges/advanced-bonfires.json index a4488b8696..e6dc2474c3 100644 --- a/seed/challenges/advanced-bonfires.json +++ b/seed/challenges/advanced-bonfires.json @@ -1,6 +1,7 @@ { "name": "Advanced Algorithm Scripting", "order": 15, + "time": "50h", "challenges": [ { "id": "aff0395860f5d3034dc0bfc9", diff --git a/seed/challenges/angularjs.json b/seed/challenges/angularjs.json index 92c85e751b..905c120f33 100644 --- a/seed/challenges/angularjs.json +++ b/seed/challenges/angularjs.json @@ -1,6 +1,7 @@ { "name": "AngularJS", "order": 16, + "time": "5h", "challenges": [ { "id": "bd7154d8c441eddfaeb5bdef", diff --git a/seed/challenges/automated-testing-and-debugging.json b/seed/challenges/automated-testing-and-debugging.json index b5ab25c2f9..0c7304045b 100644 --- a/seed/challenges/automated-testing-and-debugging.json +++ b/seed/challenges/automated-testing-and-debugging.json @@ -1,6 +1,7 @@ { "name": "Automated Testing and Debugging", "order": 14, + "time": "15m", "challenges": [ { "id":"cf1111c1c16feddfaeb6bdef", diff --git a/seed/challenges/basejumps.json b/seed/challenges/basejumps.json index b665d28622..627e95482f 100644 --- a/seed/challenges/basejumps.json +++ b/seed/challenges/basejumps.json @@ -1,6 +1,7 @@ { "name": "Full Stack JavaScript Projects", "order": 20, + "time": "300h", "challenges": [ { "id": "bd7158d8c443eddfaeb5bcef", diff --git a/seed/challenges/basic-bonfires.json b/seed/challenges/basic-bonfires.json index 2c22329088..2c5a3667d2 100644 --- a/seed/challenges/basic-bonfires.json +++ b/seed/challenges/basic-bonfires.json @@ -1,6 +1,7 @@ { "name": "Basic Algorithm Scripting", "order": 8, + "time": "50h", "challenges": [ { "id": "ad7123c8c441eddfaeb5bdef", diff --git a/seed/challenges/basic-javascript.json b/seed/challenges/basic-javascript.json index f9caca1efe..7d88e724ce 100644 --- a/seed/challenges/basic-javascript.json +++ b/seed/challenges/basic-javascript.json @@ -1,6 +1,7 @@ { "name": "Basic JavaScript", "order": 6, + "time": "3h", "challenges": [ { "id":"bd7123c9c441eddfaeb4bdef", diff --git a/seed/challenges/basic-ziplines.json b/seed/challenges/basic-ziplines.json index a13e962f7c..dd13678621 100644 --- a/seed/challenges/basic-ziplines.json +++ b/seed/challenges/basic-ziplines.json @@ -1,6 +1,7 @@ { "name": "Basic Front End Development Projects", "order": 9, + "time": "100h", "challenges": [ { "id": "bd7158d8c442eddfbeb5bd1f", diff --git a/seed/challenges/bootstrap.json b/seed/challenges/bootstrap.json index 3982fe18d5..91e0e5e776 100644 --- a/seed/challenges/bootstrap.json +++ b/seed/challenges/bootstrap.json @@ -1,6 +1,7 @@ { "name": "Responsive Design with Bootstrap", "order": 3, + "time": "2h", "challenges": [ { "id": "bad87fee1348bd9acde08712", diff --git a/seed/challenges/front-end-development-certificate.json b/seed/challenges/front-end-development-certificate.json index 65b98018c6..4d6a83c406 100644 --- a/seed/challenges/front-end-development-certificate.json +++ b/seed/challenges/front-end-development-certificate.json @@ -1,6 +1,7 @@ { "name": "Claim Your Front End Development Certificate", "order": 12, + "time": "5m", "challenges": [ { "id": "561add10cb82ac38a17513be", diff --git a/seed/challenges/full-stack-development-certificate.json b/seed/challenges/full-stack-development-certificate.json index d383fc5a0f..1d0cd92963 100644 --- a/seed/challenges/full-stack-development-certificate.json +++ b/seed/challenges/full-stack-development-certificate.json @@ -1,6 +1,7 @@ { "name": "Claim Your Full Stack Development Certificate", "order": 21, + "time": "5m", "challenges": [ { "id": "660add10cb82ac38a17513be", diff --git a/seed/challenges/gear-up-for-success.json b/seed/challenges/gear-up-for-success.json index d11fdecf6e..0eb45c60a0 100644 --- a/seed/challenges/gear-up-for-success.json +++ b/seed/challenges/gear-up-for-success.json @@ -1,6 +1,7 @@ { "name": "Gear up for Success", "order": 4, + "time": "10m", "challenges": [ { "id": "560add65cb82ac38a17513c2", diff --git a/seed/challenges/getting-started.json b/seed/challenges/getting-started.json index 8f8b559eb7..87ba38e5a2 100644 --- a/seed/challenges/getting-started.json +++ b/seed/challenges/getting-started.json @@ -1,6 +1,7 @@ { "name": "Get Started with Free Code Camp", "order": 1, + "time": "10m", "challenges": [ { "id": "560add10cb82ac38a17513be", diff --git a/seed/challenges/git.json b/seed/challenges/git.json index d3abf068ba..8a642ab615 100644 --- a/seed/challenges/git.json +++ b/seed/challenges/git.json @@ -1,6 +1,7 @@ { "name": "Git", "order" : 17, + "time": "3h", "challenges": [ { "id": "bd7353d8c341eddeaeb5bd0f", diff --git a/seed/challenges/hikes.json b/seed/challenges/hikes.json index 1f5d7f3113..0e9dbb56a4 100644 --- a/seed/challenges/hikes.json +++ b/seed/challenges/hikes.json @@ -1,6 +1,7 @@ { "name": "Hikes", "order": 0.050, + "time": "3h", "challenges": [ { "id": "bd7128d8c441eddfbeb5bddf", diff --git a/seed/challenges/html5-and-css.json b/seed/challenges/html5-and-css.json index f4a6cd5d7b..41c46c2126 100644 --- a/seed/challenges/html5-and-css.json +++ b/seed/challenges/html5-and-css.json @@ -1,6 +1,7 @@ { "name": "HTML5 and CSS", "order": 2, + "time": "3h", "challenges": [ { "id": "bd7123c8c441eddfaeb5bdef", diff --git a/seed/challenges/intermediate-bonfires.json b/seed/challenges/intermediate-bonfires.json index ae17999083..38f77d9631 100644 --- a/seed/challenges/intermediate-bonfires.json +++ b/seed/challenges/intermediate-bonfires.json @@ -1,6 +1,7 @@ { "name": "Intermediate Algorithm Scripting", "order": 10, + "time": "50h", "challenges": [ { "id": "a3566b1109230028080c9345", diff --git a/seed/challenges/intermediate-ziplines.json b/seed/challenges/intermediate-ziplines.json index 27680d7350..fd3ea5b5e9 100644 --- a/seed/challenges/intermediate-ziplines.json +++ b/seed/challenges/intermediate-ziplines.json @@ -1,6 +1,7 @@ { "name": "Intermediate Front End Development Projects", "order": 11, + "time": "200h", "challenges": [ { "id": "bd7158d8c442eddfaeb5bd10", diff --git a/seed/challenges/jquery.json b/seed/challenges/jquery.json index 6aa103d38c..e220c99d29 100644 --- a/seed/challenges/jquery.json +++ b/seed/challenges/jquery.json @@ -1,6 +1,7 @@ { "name": "jQuery", "order": 5, + "time": "2h", "challenges": [ { "id": "bad87fee1348bd9acdd08826", diff --git a/seed/challenges/mongodb.json b/seed/challenges/mongodb.json index 437a4da2e6..0fe93ba6f9 100644 --- a/seed/challenges/mongodb.json +++ b/seed/challenges/mongodb.json @@ -1,6 +1,7 @@ { "name": "MongoDB", "order" : 19, + "time": "3h", "challenges": [ { "id": "bd7243d8c341eddeaeb5bd0f", diff --git a/seed/challenges/nodejs-and-expressjs.json b/seed/challenges/nodejs-and-expressjs.json index 6eb04629c0..36b2231409 100644 --- a/seed/challenges/nodejs-and-expressjs.json +++ b/seed/challenges/nodejs-and-expressjs.json @@ -1,6 +1,7 @@ { "name": "Node.js and Express.js", "order" : 18, + "time": "20h", "challenges": [ { "id": "bd7153d8c441eddfaeb5bd0f", diff --git a/seed/challenges/object-oriented-and-functional-programming.json b/seed/challenges/object-oriented-and-functional-programming.json index 7e890b52fe..8f1c7a8a1a 100644 --- a/seed/challenges/object-oriented-and-functional-programming.json +++ b/seed/challenges/object-oriented-and-functional-programming.json @@ -1,6 +1,7 @@ { "name": "Object Oriented and Functional Programming", "order": 7, + "time": "1h", "note": [ "Methods", "Closures", diff --git a/seed/challenges/upper-intermediate-bonfires.json b/seed/challenges/upper-intermediate-bonfires.json index b1ddbc2ac1..126da14507 100644 --- a/seed/challenges/upper-intermediate-bonfires.json +++ b/seed/challenges/upper-intermediate-bonfires.json @@ -1,6 +1,7 @@ { "name": "Upper Intermediate Algorithm Scripting", "order": 13, + "time": "50h", "challenges": [ { "id": "a2f1d72d9b908d0bd72bb9f6", diff --git a/seed/index.js b/seed/index.js index bd05f2de96..464242c26e 100644 --- a/seed/index.js +++ b/seed/index.js @@ -68,6 +68,7 @@ Challenge.destroyAll(function(err, info) { challenge.suborder = index + 1; challenge.block = block; challenge.isBeta = challenge.isBeta || isBeta; + challenge.time = challengeSpec.time; return challenge; }); diff --git a/server/boot/challenge.js b/server/boot/challenge.js index 3b973cc0ac..218e5fc321 100644 --- a/server/boot/challenge.js +++ b/server/boot/challenge.js @@ -555,7 +555,8 @@ module.exports = function(app) { name: blockArray[0].block, dashedName: dasherize(blockArray[0].block), challenges: blockArray, - completed: completedCount / blockArray.length * 100 + completed: completedCount / blockArray.length * 100, + time: blockArray[0] && blockArray[0].time || "???" }; }) .filter(({ name }) => name !== 'Hikes') diff --git a/server/views/challengeMap/show.jade b/server/views/challengeMap/show.jade index db351b7af8..ae0370b802 100644 --- a/server/views/challengeMap/show.jade +++ b/server/views/challengeMap/show.jade @@ -85,40 +85,44 @@ block content .spacer.negative-55 .row - .col-xs-12.col-sm-8.col-sm-offset-2 - h3 #{challengeBlock.name} + .hidden-xs.col-sm-3.col-md-2 + h3.text-primary.text-right + i.fa.fa-clock-o #{challengeBlock.time} + .col-xs-12.col-sm-9.col-md-10 + h3 #{challengeBlock.name}   + + .row - .col-xs-12 - ol - for challenge in challengeBlock.challenges - if challenge.completed - .row - .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.map-p.negative-10 - .col-xs-12.col-sm-9.col-md-10 - li.faded.map-p.negative-10 - a(href="/challenges/#{challenge.dashedName}") - span.capitalize= challenge.type + ': ' - span= challenge.title - span.sr-only= " Complete" - - - else - .row - .hidden-xs.col-sm-3.col-md-2 - span.negative-10 - .col-xs-12.col-sm-9.col-md-10 - li.map-p.negative-10 - a(href="/challenges/#{challenge.dashedName}") - span.capitalize= challenge.type + ': ' - span= challenge.title - span.sr-only= " Incomplete" - - if (challengeBlock.completed === 100) - .button-spacer + ol + for challenge in challengeBlock.challenges + if challenge.completed .row - .col-xs-12.col-sm-8.col-md-6.col-sm-offset-3.col-md-offset-2.hidden - a.btn.btn-lg.btn-block.signup-btn.map-challenge-block-share Section complete. Share your Portfolio with your friends. - .hidden(id="#{challengeBlock.name}") + .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.map-p.negative-10 + .col-xs-12.col-sm-9.col-md-10 + li.faded.map-p.negative-10 + a(href="/challenges/#{challenge.dashedName}") + span.capitalize= challenge.type + ': ' + span= challenge.title + span.sr-only= " Complete" + + + else + .row + .hidden-xs.col-sm-3.col-md-2 + span.negative-10 + .col-xs-12.col-sm-9.col-md-10 + li.map-p.negative-10 + a(href="/challenges/#{challenge.dashedName}") + span.capitalize= challenge.type + ': ' + span= challenge.title + span.sr-only= " Incomplete" + + if (challengeBlock.completed === 100) + .button-spacer + .row + .col-xs-12.col-sm-8.col-md-6.col-sm-offset-3.col-md-offset-2.hidden + a.btn.btn-lg.btn-block.signup-btn.map-challenge-block-share Section complete. Share your Portfolio with your friends. + .hidden(id="#{challengeBlock.name}") script. var username = !{JSON.stringify(user && user.username || '')}; var lastCompleted = !{JSON.stringify(lastCompleted || false)} From 8da93ddea9d8b208117b08444d744f81ef797ba8 Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Mon, 12 Oct 2015 23:02:24 -0700 Subject: [PATCH 2/2] add spacing and nowrap to ensure time stays on single line --- server/views/challengeMap/show.jade | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/views/challengeMap/show.jade b/server/views/challengeMap/show.jade index ae0370b802..14243dee9b 100644 --- a/server/views/challengeMap/show.jade +++ b/server/views/challengeMap/show.jade @@ -86,8 +86,8 @@ block content .row .hidden-xs.col-sm-3.col-md-2 - h3.text-primary.text-right - i.fa.fa-clock-o #{challengeBlock.time} + h3.text-primary.text-right.nowrap + i.fa.fa-clock-o  #{challengeBlock.time} .col-xs-12.col-sm-9.col-md-10 h3 #{challengeBlock.name}