@ -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 <a href='https://github.com/FreeCodeCamp/freecodecamp/blob/master/seed_data/field-guides.json'>here</a>."
|
||||
});
|
||||
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 <a href='https://github.com/FreeCodeCamp/freecodecamp/blob/master/seed_data/field-guides.json'>here</a>."
|
||||
});
|
||||
}
|
||||
return res.redirect('../field-guide/how-do-i-use-this-guide?');
|
||||
}
|
||||
var nameString = fieldGuide.name.toLowerCase().replace(/\s/g, '-');
|
||||
|
@ -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 <a href='/field-guide/how-can-i-find-other-free-code-camp-campers-in-my-city' target='_blank'>here</a> 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",
|
||||
|
@ -282,10 +282,15 @@
|
||||
" <h2>Find your city below and join their group. This is a great way to hang out with other coders, share insights, and pair program.</h2>",
|
||||
" <h3>",
|
||||
" <ol>",
|
||||
" <li><a href='https://www.facebook.com/groups/free.code.camp.atlanta/' target='_blank'>Atlanta</a></li>",
|
||||
" <li><a href='https://www.facebook.com/groups/free.code.camp.tempe.phoenix.scottsdale/' target='_blank'>Phoenix</a></li>",
|
||||
" <li><a href='https://www.facebook.com/groups/free.code.camp.san.francisco' target='_blank'>San Francisco</a></li>",
|
||||
" <li><a href='https://www.facebook.com/groups/free.code.camp.tempe.phoenix.scottsdale/' target='_blank'>Scottsdale</a></li>",
|
||||
" <li><a href='https://www.facebook.com/groups/free.code.camp.tampa/' target='_blank'>Tampa</a></li>",
|
||||
" <li><a href='https://www.facebook.com/groups/free.code.camp.tempe.phoenix.scottsdale/' target='_blank'>Tempe</a></li>",
|
||||
" </ol>",
|
||||
" </h3>",
|
||||
" <h3>If you didn't see your city on this list, you should create your own Facebook group! Pease follow these steps:</h3>",
|
||||
" <h3>If you didn't see your city on this list, you should create your own Facebook group for your city. Please follow these steps:</h3>",
|
||||
" <h3>",
|
||||
" <ol>",
|
||||
" <li>Sign in to Facebook.</li>",
|
||||
@ -310,6 +315,8 @@
|
||||
" <li>Finally, message @quincylarson in Slack with a link to your city's group page and he'll include it here.</li>",
|
||||
" </ol>",
|
||||
" </h3>",
|
||||
" <h3>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.</h3>",
|
||||
" <h3>If Facebook is blocked in your country, feel free to use social network with a similar group functionality that's popular in your region.</h3>",
|
||||
"</div>"
|
||||
]
|
||||
},
|
||||
|
@ -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
|
||||
|
@ -21,9 +21,10 @@ h3
|
||||
if (data.completedFieldGuides.indexOf(data.fieldGuideIds[i]) > -1) {
|
||||
$(div).html("<div class='row'>" +
|
||||
"<div class='hidden-xs col-sm-3 col-md-2 text-primary ion-checkmark-circled padded-ionic-icon text-center'></div>" +
|
||||
"<div class='col-xs-12 col-sm-9 col-md-10'>" +
|
||||
"<div class='col-xs-12 col-sm-6 col-md-8'>" +
|
||||
"<li class='faded'><a href='/field-guide/" + linkedName + "'>" + data.fieldGuideList[i].name + "</a></li>" +
|
||||
"</div>" +
|
||||
"<div class='col-sm-3 col-md-2'></div>" +
|
||||
"</div>" +
|
||||
"</div>");
|
||||
} else {
|
||||
|
@ -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")
|
||||
|
Reference in New Issue
Block a user