Pull some useful changes from aborted branch

This commit is contained in:
Michael Q Larson
2015-04-16 23:54:26 -07:00
parent d2fae63310
commit d10011acc3
4 changed files with 147 additions and 110 deletions

View File

@ -8,7 +8,7 @@ exports.index = function(req, res) {
res.redirect('/challenges/') res.redirect('/challenges/')
} else { } else {
res.render('home', { res.render('home', {
title: 'Learn to Code and Become a Software Engineer' title: 'Learn to Code JavaScript and get a Coding Job by Helping Nonprofits'
}); });
} }
}; };

View File

@ -18,7 +18,10 @@ var userSchema = new mongoose.Schema({
github: String, github: String,
linkedin: String, linkedin: String,
tokens: Array, tokens: Array,
progressTimestamps: [], progressTimestamps: {
type: Array,
default: []
},
profile: { profile: {
username: { username: {
type: String, type: String,
@ -28,7 +31,7 @@ var userSchema = new mongoose.Schema({
}, },
bio: { bio: {
type: String, type: String,
defaults: '' default: ''
}, },
name: { name: {
type: String, type: String,
@ -63,7 +66,6 @@ var userSchema = new mongoose.Schema({
default: '' default: ''
} }
}, },
challengesHash: {},
portfolio: { portfolio: {
website1Link: { website1Link: {
type: String, type: String,

View File

@ -606,21 +606,45 @@
"tests": [] "tests": []
}, },
{ {
"_id": "bd7158d8c442eddfaeb5bdff", "_id": "bd7158d8c442eddfaeb5bd1f",
"name": "Zipline: Integrate with Twitch's API", "name": "Zipline: Use the Twitch.tv JSON API",
"difficulty": 1.01, "difficulty": 1.01,
"challengeSeed": "123488494", "challengeSeed": "123488494",
"description": [ "description": [
"Go to CodePen <a href='http://codepen.io/FreeCodeCamp/pen/gbEmJr'>http://codepen.io/FreeCodeCamp/pen/gbEmJr</a> and click the \"fork\" button. This will create a \"fork\", or copy of the file, which you can then edit yourself.", "Build a Twitch integration on CodePen.io using this as a reference: <a href='http://codepen.io/FreeCodeCamp/full/gbEmJr/' target='_blank'>http://codepen.io/FreeCodeCamp/full/gbEmJr/</a>.",
"Here are the rules: <ol><li>Don't look at the example's code. Figure it out for yourself.</li><li>You may use whichever libraries or APIs you need.</li><li>Reproduce the example project's functionality, and also feel free to personalize it.</li></ul>",
"Here's an example call to Twitch.tv's JSON API: <code>https://api.twitch.tv/kraken/streams/freecodecamp</code>.",
"The relevant documentation is here: <a href='https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel' target='_blank'>https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel</a>.",
"When you are finished, click the \"I've completed this challenge\" button and include a link to your Codepen. If you pair programmed, you should also include the Free Code Camp username of your pair. We will take a look at your code and eventually give you feedback. In the meantime, please move on to your next challenge." "When you are finished, click the \"I've completed this challenge\" button and include a link to your Codepen. If you pair programmed, you should also include the Free Code Camp username of your pair. We will take a look at your code and eventually give you feedback. In the meantime, please move on to your next challenge."
], ],
"challengeType": 3, "challengeType": 3,
"tests": [] "tests": []
}, },
{
"_id": "bd7158d8c442eddfaeb5bd10",
"name": "Zipline: Customize a Twitter Stream",
"difficulty": 1.06,
"challengeSeed": "123488494",
"description": [
"Start by forking this: <a href='http://codepen.io/FreeCodeCamp/pen/aOobVX'>http://codepen.io/FreeCodeCamp/pen/aOobVX</a>"
],
"challengeType": 3,
"tests": []
},
{
"_id": "bd7158d8c442eddfaeb5bd18",
"name": "Zipline: Integrate with a Weather API",
"difficulty": 1.02,
"challengeSeed": "123488494",
"description": [
],
"challengeType": 3,
"tests": []
},
{ {
"_id": "bd7158d8c442eddfaeb5bd0f", "_id": "bd7158d8c442eddfaeb5bd0f",
"name": "Zipline: Integrate with Trello's API", "name": "Zipline: Integrate with Trello's API",
"difficulty": 1.02, "difficulty": 1.05,
"challengeSeed": "123488494", "challengeSeed": "123488494",
"description": [ "description": [
"Go to CodePen <a href='http://codepen.io/FreeCodeCamp/pen/gbEmJr'>http://codepen.io/FreeCodeCamp/pen/gbEmJr</a> and click the \"fork\" button. This will create a \"fork\", or copy of the file, which you can then edit yourself.", "Go to CodePen <a href='http://codepen.io/FreeCodeCamp/pen/gbEmJr'>http://codepen.io/FreeCodeCamp/pen/gbEmJr</a> and click the \"fork\" button. This will create a \"fork\", or copy of the file, which you can then edit yourself.",
@ -636,13 +660,41 @@
"tests": [] "tests": []
}, },
{ {
"_id": "bd7158d8c442eddfaeb5bd1f", "_id": "bd7158d8c442eddfaeb5bd17",
"name": "Zipline: Integrate with a Weather API", "name": "Zipline: Build a Random Quote Generator",
"difficulty": 1.03, "difficulty": 1.06,
"challengeSeed": "123488494",
"description": [
],
"challengeType": 3,
"tests": []
},
{
"_id": "bd7158d8c442eddfaeb5bd1c",
"name": "Zipline: Build a Camper News Viewer",
"difficulty": 1.06,
"challengeSeed": "123488494",
"description": [
],
"challengeType": 3,
"tests": []
},
{
"_id": "bd7158d8c442eddfaeb5bd1d",
"name": "Zipline: Build a JavaScript Calculator",
"difficulty": 1.06,
"challengeSeed": "123488494",
"description": [
],
"challengeType": 3,
"tests": []
},
{
"_id": "bd7158d8c442eddfaeb5bd1e",
"name": "Zipline: Create a Tic Tac Toe Game",
"difficulty": 1.06,
"challengeSeed": "123488494", "challengeSeed": "123488494",
"description": [ "description": [
"Go to CodePen <a href='http://codepen.io/FreeCodeCamp/pen/gbEmJr'>http://codepen.io/FreeCodeCamp/pen/gbEmJr</a> and click the \"fork\" button. This will create a \"fork\", or copy of the file, which you can then edit yourself.",
"When you are finished, click the \"I've completed this challenge\" button and include a link to your Codepen. If you pair programmed, you should also include the Free Code Camp username of your pair. We will take a look at your code and eventually give you feedback. In the meantime, please move on to your next challenge."
], ],
"challengeType": 3, "challengeType": 3,
"tests": [] "tests": []

View File

@ -1,100 +1,83 @@
extends ../layout-wide extends ../layout
block content block content
if (Math.random() > 0.98) .col-xs-12.col-sm-12.col-md-12
img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner-dino.png') .panel.panel-info
else .panel-heading.text-center
img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png') h1 About Free Code Camp
br .panel-body
.row.text-center .row.text-center
.col-xs-12.col-md-6.col-md-offset-3 .col-xs-12
if (user) if (Math.random() > 0.99)
if (!user.sentSlackInvite) img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner-dino.png')
a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/challenges") Take me to my next challenge else
.spacer img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png')
a.btn.btn-primary.btn-cta.next-challenge-button.btn-block(href="/api/slack") Join our Slack Chat Room .col-xs-12.col-md-8.col-md-offset-2
else h2.text-center
a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/signin") Start learning to code (it's free) span.text-primary #{c3} &thinsp;
br | campers have joined our community since we launched &thinsp;
.row span.text-primary #{daysRunning} &thinsp;
.col-xs-12.col-sm-12.col-md-4 | days ago.
.panel.panel-info .row.text-center
.panel-heading.landing-panel-heading.text-center Get Connected .col-xs-12.col-md-8.col-md-offset-2
.panel-body.text-center if (user)
img.img-responsive.img-center(src="https://s3.amazonaws.com/freecodecamp/about-chatroom.jpg" alt="A screen shot from Free Code Camp's main chat room") if (!user.sentSlackInvite)
h3 #{c3} campers are doing challenges. a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/challenges") Take me to my next challenge
h3 #{all} campers are coding for nonprofits. .spacer
.col-xs-12.col-sm-12.col-md-4 a.btn.btn-primary.btn-cta.next-challenge-button.btn-block(href="/api/slack") Join our Slack Chat Room
.panel.panel-info
.panel-heading.landing-panel-heading.text-center Learn JavaScript
.panel-body.text-center
img.img-responsive.img-center(src="https://s3.amazonaws.com/freecodecamp/about-github.jpg" alt="A screen shot of a GitHub commit graph showing a streak of 33 consecutive days of contributions")
include ../partials/github
.col-xs-12.col-sm-12.col-md-4
.panel.panel-info
.panel-heading.landing-panel-heading.text-center Help Nonprofits
.panel-body.text-center
img.img-responsive.img-center(src="https://s3.amazonaws.com/freecodecamp/about-trello.jpg" alt="a screen shot of Free Code Camp's nonprofit project Trello board showing several active projects")
h3 We launched #{daysRunning} days ago.
h3 We help 20 nonprofits. &nbsp;
a(href='https://trello.com/b/BA3xVpz9/nonprofit-projects') (view them)
br
script.
var challengeName = 'Learn to code'
.row
.col-xs-12
.panel.panel-info
.panel-heading.landing-panel-heading.text-center Announcements
.panel-body
.landing-panel-body.text-center
for announcement in announcements
h2
if (announcement.length > 1)
a(href=announcement[1])= announcement[0]
else else
= announcement[0] a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/signin") Start learning to code (it's free)
a.twitter-timeline(data-dnt='true', href='https://twitter.com/FreeCodeCamp', data-widget-id='560847186548621312') Tweets by @FreeCodeCamp br
script. script.
!function (d, s, id) { var challengeName = 'Learn to code'
var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; .row
if (!d.getElementById(id)) { .col-xs-12.col-md-8.col-md-offset-2
js = d.createElement(s); for announcement in announcements
js.id = id; h2
js.src = p + "://platform.twitter.com/widgets.js"; if (announcement.length > 1)
fjs.parentNode.insertBefore(js, fjs); a(href=announcement[1])= announcement[0]
} else
}(document, "script", "twitter-wjs"); = announcement[0]
h3 a.twitter-timeline(data-dnt='true', href='https://twitter.com/FreeCodeCamp', data-widget-id='560847186548621312') Tweets by @FreeCodeCamp
.col-xs-12 Follow us on Twitter here: script.
.col-xs-12.github-and-twitter-button-text !function (d, s, id) {
html. var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https';
<a class="twitter-follow-button" if (!d.getElementById(id)) {
href="https://twitter.com/freecodecamp" js = d.createElement(s);
data-show-count="true" js.id = id;
data-lang="en"> js.src = p + "://platform.twitter.com/widgets.js";
Follow @FreeCodeCamp fjs.parentNode.insertBefore(js, fjs);
</a> }
<script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));</script> }(document, "script", "twitter-wjs");
.col-xs-12.github-and-twitter-button-text Star us on GitHub here: h3
.col-xs-12.github-and-twitter-button-text .col-xs-12 Follow us on Twitter here:
html. .col-xs-12.github-and-twitter-button-text
<iframe src="http://ghbtns.com/github-btn.html?user=freecodecamp&repo=freecodecamp&type=watch&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true"></iframe> html.
#announcementModal.modal(tabindex='-1') <a class="twitter-follow-button"
.modal-dialog href="https://twitter.com/freecodecamp"
.modal-content data-show-count="true"
.modal-header.challenge-list-header Camp-wide Meeting on Saturday at Noon EST data-lang="en">
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') × Follow @FreeCodeCamp
.modal-body </a>
h3.text-left We'll live-stream some of Free Code Camp's new features, and campers will show what they're building. Live Saturday, March 28 at Noon EST on our &thinsp; <script>window.twttr=(function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],t=window.twttr||{};if(d.getElementById(id))return;js=d.createElement(s);js.id=id;js.src="https://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);t._e=[];t.ready=function(f){t._e.push(f);};return t;}(document,"script","twitter-wjs"));</script>
a(href='http://twitch.tv/freecodecamp', target='_blank') Twitch.tv channel .col-xs-12.github-and-twitter-button-text Star us on GitHub here:
| . .col-xs-12.github-and-twitter-button-text
a.btn.btn-lg.btn-info.btn-block(name='_csrf', value=_csrf, aria-hidden='true', href='http://twitch.tv/freecodecamp', target='_blank') Take me to Twitch so I can follow Free Code Camp html.
a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Thanks for the heads-up! <iframe src="http://ghbtns.com/github-btn.html?user=freecodecamp&repo=freecodecamp&type=watch&count=true&size=large" height="30" width="170" frameborder="0" scrolling="0" style="width:170px; height: 30px;" allowTransparency="true"></iframe>
script. #announcementModal.modal(tabindex='-1')
$(document).ready(function() { .modal-dialog
if (!localStorage || !localStorage.campWideMeeting) { .modal-content
$('#announcementModal').modal('show'); .modal-header.challenge-list-header Camp-wide Meeting on Saturday at Noon EST
localStorage.campWideMeeting = "true"; a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
} .modal-body
}); h3.text-left We'll live-stream some of Free Code Camp's new features, and campers will show what they're building. Live Saturday, March 28 at Noon EST on our &thinsp;
a(href='http://twitch.tv/freecodecamp', target='_blank') Twitch.tv channel
| .
a.btn.btn-lg.btn-info.btn-block(name='_csrf', value=_csrf, aria-hidden='true', href='http://twitch.tv/freecodecamp', target='_blank') Take me to Twitch so I can follow Free Code Camp
a.btn.btn-lg.btn-primary.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Thanks for the heads-up!
script.
$(document).ready(function () {
if (!localStorage || !localStorage.campWideMeeting) {
$('#announcementModal').modal('show');
localStorage.campWideMeeting = "true";
}
});