From b5747c77120019a6dd074abbd424c42b9a2b272e Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sat, 9 May 2015 10:52:02 -0700 Subject: [PATCH 1/2] add facebook groups challenge, field guide and footer link --- seed_data/coursewares.json | 20 +++++++++++++++++++- seed_data/field-guides.json | 9 ++++++++- views/field-guide/show.jade | 2 +- views/partials/field-guide.jade | 3 ++- views/partials/footer.jade | 9 ++++++--- 5 files changed, 36 insertions(+), 7 deletions(-) diff --git a/seed_data/coursewares.json b/seed_data/coursewares.json index 3ad688a901..27831c4956 100644 --- a/seed_data/coursewares.json +++ b/seed_data/coursewares.json @@ -68,7 +68,7 @@ }, { "_id": "bd7125d8c441eddfaeb5bd2f", - "name": "Customize your Porfolio Page", + "name": "Customize your Portfolio Page", "difficulty": 0.05, "challengeSeed": "125407433", "description": [ @@ -102,6 +102,24 @@ "challengeType": 2, "tests": [] }, + { + "_id": "bd7126d8c441eddfaeb5bd3e", + "name": "Meet Other Campers in your City", + "difficulty": 0.065, + "challengeSeed": "127358841", + "description": [ + "One of the best ways to stay motivated when learning to code is to hang out with other campers.", + "Slack and Camper News are great ways to communicate with other campers, but there's no substitute for meeting people in-person.", + "The easiest way to meet other campers in your city is to join your city's Facebook Group. Click here to view our growing list of local groups.", + "Click the link to your city, then, once Facebook loads, click \"Join group\".", + "Our local groups are new, so if you don't see your city on this list, you should follow the directions to create a Facebook group for your city.", + "If you don't have a Facebook account, we strongly recommend you create one, even if it's just for the purpose of coordinating with campers in your city through this group.", + "Our groups allow you to create events, coordinate those events, and share photos from the events afterward.", + "Whether you're hosting a study group, pair programming at your local library, or going to a weekend hackathon, your city's group will help you make it happen." + ], + "challengeType": 2, + "tests": [] + }, { "_id": "bd7137d8c441eddfaeb5bdef", "name": "Get Help the Hacker Way with RSAP", diff --git a/seed_data/field-guides.json b/seed_data/field-guides.json index 0545caaefb..7685dc457e 100644 --- a/seed_data/field-guides.json +++ b/seed_data/field-guides.json @@ -282,10 +282,15 @@ "

Find your city below and join their group. This is a great way to hang out with other coders, share insights, and pair program.

", "

", "
    ", + "
  1. Atlanta
  2. ", + "
  3. Phoenix
  4. ", "
  5. San Francisco
  6. ", + "
  7. Scottsdale
  8. ", + "
  9. Tampa
  10. ", + "
  11. Tempe
  12. ", "
", "

", - "

If you didn't see your city on this list, you should create your own Facebook group! Pease follow these steps:

", + "

If you didn't see your city on this list, you should create your own Facebook group for your city. Please follow these steps:

", "

", "
    ", "
  1. Sign in to Facebook.
  2. ", @@ -310,6 +315,8 @@ "
  3. Finally, message @quincylarson in Slack with a link to your city's group page and he'll include it here.
  4. ", "
", "

", + "

If you don't have a Facebook page, we strongly recommend you create one, even if it's just for the purpose of coordinating with campers in your city through this group.

", + "

If Facebook is blocked in your country, feel free to use social network with a similar group functionality that's popular in your region.

", "" ] }, diff --git a/views/field-guide/show.jade b/views/field-guide/show.jade index 561a09d465..dc159ef470 100644 --- a/views/field-guide/show.jade +++ b/views/field-guide/show.jade @@ -12,7 +12,7 @@ block content .spacer .col-xs-12.col-sm-6.col-sm-offset-3 .text-center - if user + if user && user.uncompletedFieldGuides.length > 0 .next-field-guide-button.btn.btn-primary.btn-big.btn-block Next article (ctrl + enter) .ten-pixel-break #showAllButton.btn.btn-info.btn-big.btn-block Show me all articles diff --git a/views/partials/field-guide.jade b/views/partials/field-guide.jade index 78c64279df..5c08d39896 100644 --- a/views/partials/field-guide.jade +++ b/views/partials/field-guide.jade @@ -21,9 +21,10 @@ h3 if (data.completedFieldGuides.indexOf(data.fieldGuideIds[i]) > -1) { $(div).html("
" + "" + - "
" + + "" + + "
" + "
" + "
"); } else { diff --git a/views/partials/footer.jade b/views/partials/footer.jade index de503bde8f..8fdd3f26c3 100644 --- a/views/partials/footer.jade +++ b/views/partials/footer.jade @@ -1,17 +1,20 @@ .fcc-footer .col-xs-12.hidden-xs.hidden-sm a.ion-speakerphone(href='http://blog.freecodecamp.com', target='_blank')  Blog   - a.ion-social-twitch-outline(href="/twitch")  Twitch  a.ion-social-github(href="http://github.com/freecodecamp", target='_blank')  Github   + a.ion-social-twitch-outline(href="/twitch")  Twitch  + a.ion-social-facebook(href="/field-guide/how-can-i-find-other-free-code-camp-campers-in-my-city")  Facebook   a.ion-social-twitter(href="http://twitter.com/freecodecamp", target='_blank')  Twitter   a.ion-locked(href="/privacy")  Privacy   .col-xs-12.visible-xs.visible-sm a.ion-speakerphone(href='http://blog.freecodecamp.com', target='_blank') span.sr-only Free Code Camp's Blog - a.ion-social-twitch-outline(href="/twitch") - span.sr-only Free Code Camp Live Pair Programming on Twitch.tv a.ion-social-github(href="http://github.com/freecodecamp", target='_blank') span.sr-only Free Code Camp on GitHub + a.ion-social-twitch-outline(href="/twitch") + span.sr-only Free Code Camp Live Pair Programming on Twitch.tv + a.ion-social-facebook(href="/field-guide/how-can-i-find-other-free-code-camp-campers-in-my-city") + span.sr-only Free Code Camp local groups on Facebook a.ion-social-twitter(href="http://twitter.com/freecodecamp", target='_blank') span.sr-only Free Code Camp on Twitter a.ion-locked(href="/privacy") From c2f0072801933c83e5fbc0faa7ba6bc36f235d4f Mon Sep 17 00:00:00 2001 From: Quincy Larson Date: Sat, 9 May 2015 11:20:17 -0700 Subject: [PATCH 2/2] minor tweeks to improve field guide flow --- controllers/fieldGuide.js | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/controllers/fieldGuide.js b/controllers/fieldGuide.js index 51f01e8529..a7d00fc97b 100644 --- a/controllers/fieldGuide.js +++ b/controllers/fieldGuide.js @@ -9,6 +9,16 @@ exports.returnIndividualFieldGuide = function(req, res, next) { var fieldGuideName = dashedName.replace(/\-/g, ' '); + var completed = req.user.completedFieldGuides; + + var uncompletedFieldGuides = resources.allFieldGuideIds().filter(function (elem) { + if (completed.indexOf(elem) === -1) { + return elem; + } + }); + req.user.uncompletedFieldGuides = uncompletedFieldGuides; + req.user.save(); + FieldGuide.find({'name': new RegExp(fieldGuideName, 'i')}, function(err, fieldGuideFromMongo) { if (err) { next(err); @@ -52,26 +62,18 @@ exports.returnNextFieldGuide = function(req, res, next) { return res.redirect('../field-guide/how-do-i-use-this-guide?'); } - var completed = req.user.completedFieldGuides; - - var uncompletedFieldGuides = resources.allFieldGuideIds().filter(function (elem) { - if (completed.indexOf(elem) === -1) { - return elem; - } - }); - req.user.uncompletedFieldGuides = uncompletedFieldGuides; - req.user.save(); - - var displayedFieldGuides = FieldGuide.find({'_id': uncompletedFieldGuides[0]}); + var displayedFieldGuides = FieldGuide.find({'_id': req.user.uncompletedFieldGuides[0]}); displayedFieldGuides.exec(function(err, fieldGuide) { if (err) { return next(err); } fieldGuide = fieldGuide.pop(); if (typeof fieldGuide === 'undefined') { - req.flash('success', { - msg: "You've read all our current Field Guide entries. You can contribute to our Field Guide here." - }); + if (req.user.completedFieldGuides.length > 0) { + req.flash('success', { + msg: "You've read all our current Field Guide entries. You can contribute to our Field Guide here." + }); + } return res.redirect('../field-guide/how-do-i-use-this-guide?'); } var nameString = fieldGuide.name.toLowerCase().replace(/\s/g, '-');