From d10011acc353f12d478937b9f5e5d3037e7d15a0 Mon Sep 17 00:00:00 2001 From: Michael Q Larson Date: Thu, 16 Apr 2015 23:54:26 -0700 Subject: [PATCH] Pull some useful changes from aborted branch --- controllers/home.js | 2 +- models/User.js | 8 +- seed_data/coursewares.json | 70 ++++++++++-- views/resources/learn-to-code.jade | 177 +++++++++++++---------------- 4 files changed, 147 insertions(+), 110 deletions(-) diff --git a/controllers/home.js b/controllers/home.js index 523ed04051..836ad9e62b 100644 --- a/controllers/home.js +++ b/controllers/home.js @@ -8,7 +8,7 @@ exports.index = function(req, res) { res.redirect('/challenges/') } else { 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' }); } }; diff --git a/models/User.js b/models/User.js index efb813cd2b..731a5ee901 100644 --- a/models/User.js +++ b/models/User.js @@ -18,7 +18,10 @@ var userSchema = new mongoose.Schema({ github: String, linkedin: String, tokens: Array, - progressTimestamps: [], + progressTimestamps: { + type: Array, + default: [] + }, profile: { username: { type: String, @@ -28,7 +31,7 @@ var userSchema = new mongoose.Schema({ }, bio: { type: String, - defaults: '' + default: '' }, name: { type: String, @@ -63,7 +66,6 @@ var userSchema = new mongoose.Schema({ default: '' } }, - challengesHash: {}, portfolio: { website1Link: { type: String, diff --git a/seed_data/coursewares.json b/seed_data/coursewares.json index 07e2ada181..e3ff8235de 100644 --- a/seed_data/coursewares.json +++ b/seed_data/coursewares.json @@ -606,21 +606,45 @@ "tests": [] }, { - "_id": "bd7158d8c442eddfaeb5bdff", - "name": "Zipline: Integrate with Twitch's API", + "_id": "bd7158d8c442eddfaeb5bd1f", + "name": "Zipline: Use the Twitch.tv JSON API", "difficulty": 1.01, "challengeSeed": "123488494", "description": [ - "Go to CodePen http://codepen.io/FreeCodeCamp/pen/gbEmJr 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: http://codepen.io/FreeCodeCamp/full/gbEmJr/.", + "Here are the rules:
  1. Don't look at the example's code. Figure it out for yourself.
  2. You may use whichever libraries or APIs you need.
  3. Reproduce the example project's functionality, and also feel free to personalize it.
  4. ", + "Here's an example call to Twitch.tv's JSON API: https://api.twitch.tv/kraken/streams/freecodecamp.", + "The relevant documentation is here: https://github.com/justintv/Twitch-API/blob/master/v3_resources/streams.md#get-streamschannel.", "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, "tests": [] }, + { + "_id": "bd7158d8c442eddfaeb5bd10", + "name": "Zipline: Customize a Twitter Stream", + "difficulty": 1.06, + "challengeSeed": "123488494", + "description": [ + "Start by forking this: http://codepen.io/FreeCodeCamp/pen/aOobVX" + ], + "challengeType": 3, + "tests": [] + }, + { + "_id": "bd7158d8c442eddfaeb5bd18", + "name": "Zipline: Integrate with a Weather API", + "difficulty": 1.02, + "challengeSeed": "123488494", + "description": [ + ], + "challengeType": 3, + "tests": [] + }, { "_id": "bd7158d8c442eddfaeb5bd0f", "name": "Zipline: Integrate with Trello's API", - "difficulty": 1.02, + "difficulty": 1.05, "challengeSeed": "123488494", "description": [ "Go to CodePen http://codepen.io/FreeCodeCamp/pen/gbEmJr 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": [] }, { - "_id": "bd7158d8c442eddfaeb5bd1f", - "name": "Zipline: Integrate with a Weather API", - "difficulty": 1.03, + "_id": "bd7158d8c442eddfaeb5bd17", + "name": "Zipline: Build a Random Quote Generator", + "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", "description": [ - "Go to CodePen http://codepen.io/FreeCodeCamp/pen/gbEmJr 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, "tests": [] diff --git a/views/resources/learn-to-code.jade b/views/resources/learn-to-code.jade index 7981389cbf..c5d336127d 100644 --- a/views/resources/learn-to-code.jade +++ b/views/resources/learn-to-code.jade @@ -1,100 +1,83 @@ -extends ../layout-wide +extends ../layout block content - if (Math.random() > 0.98) - img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner-dino.png') - else - img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png') - br - .row.text-center - .col-xs-12.col-md-6.col-md-offset-3 - if (user) - if (!user.sentSlackInvite) - a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/challenges") Take me to my next challenge - .spacer - a.btn.btn-primary.btn-cta.next-challenge-button.btn-block(href="/api/slack") Join our Slack Chat Room - else - a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/signin") Start learning to code (it's free) - br - .row - .col-xs-12.col-sm-12.col-md-4 - .panel.panel-info - .panel-heading.landing-panel-heading.text-center Get Connected - .panel-body.text-center - 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") - h3 #{c3} campers are doing challenges. - h3 #{all} campers are coding for nonprofits. - .col-xs-12.col-sm-12.col-md-4 - .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.   - 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] + .col-xs-12.col-sm-12.col-md-12 + .panel.panel-info + .panel-heading.text-center + h1 About Free Code Camp + .panel-body + .row.text-center + .col-xs-12 + if (Math.random() > 0.99) + img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner-dino.png') + else + img.img-responsive.img-center(src='https://s3.amazonaws.com/freecodecamp/wide-social-banner.png') + .col-xs-12.col-md-8.col-md-offset-2 + h2.text-center + span.text-primary #{c3}   + | campers have joined our community since we launched   + span.text-primary #{daysRunning}   + | days ago. + .row.text-center + .col-xs-12.col-md-8.col-md-offset-2 + if (user) + if (!user.sentSlackInvite) + a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/challenges") Take me to my next challenge + .spacer + a.btn.btn-primary.btn-cta.next-challenge-button.btn-block(href="/api/slack") Join our Slack Chat Room else - = announcement[0] - a.twitter-timeline(data-dnt='true', href='https://twitter.com/FreeCodeCamp', data-widget-id='560847186548621312') Tweets by @FreeCodeCamp + a.btn.btn-cta.signup-btn.next-challenge-button.btn-block(href="/signin") Start learning to code (it's free) + br script. - !function (d, s, id) { - var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; - if (!d.getElementById(id)) { - js = d.createElement(s); - js.id = id; - js.src = p + "://platform.twitter.com/widgets.js"; - fjs.parentNode.insertBefore(js, fjs); - } - }(document, "script", "twitter-wjs"); - h3 - .col-xs-12 Follow us on Twitter here: - .col-xs-12.github-and-twitter-button-text - html. - - - .col-xs-12.github-and-twitter-button-text Star us on GitHub here: - .col-xs-12.github-and-twitter-button-text - html. - - #announcementModal.modal(tabindex='-1') - .modal-dialog - .modal-content - .modal-header.challenge-list-header Camp-wide Meeting on Saturday at Noon EST - 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   - 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"; - } - }); + var challengeName = 'Learn to code' + .row + .col-xs-12.col-md-8.col-md-offset-2 + for announcement in announcements + h2 + if (announcement.length > 1) + a(href=announcement[1])= announcement[0] + else + = announcement[0] + a.twitter-timeline(data-dnt='true', href='https://twitter.com/FreeCodeCamp', data-widget-id='560847186548621312') Tweets by @FreeCodeCamp + script. + !function (d, s, id) { + var js, fjs = d.getElementsByTagName(s)[0], p = /^http:/.test(d.location) ? 'http' : 'https'; + if (!d.getElementById(id)) { + js = d.createElement(s); + js.id = id; + js.src = p + "://platform.twitter.com/widgets.js"; + fjs.parentNode.insertBefore(js, fjs); + } + }(document, "script", "twitter-wjs"); + h3 + .col-xs-12 Follow us on Twitter here: + .col-xs-12.github-and-twitter-button-text + html. + + + .col-xs-12.github-and-twitter-button-text Star us on GitHub here: + .col-xs-12.github-and-twitter-button-text + html. + + #announcementModal.modal(tabindex='-1') + .modal-dialog + .modal-content + .modal-header.challenge-list-header Camp-wide Meeting on Saturday at Noon EST + 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   + 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"; + } + });