get bonfire solutions showing up in the view; eliminate a lot of old views in favor of new challenge map

This commit is contained in:
Michael Q Larson
2015-04-05 18:37:58 -07:00
parent ef57ec58c2
commit 840930d967
17 changed files with 29 additions and 219 deletions

6
app.js
View File

@ -249,7 +249,7 @@ app.get('/jquery-exercises', resourcesController.jqueryExercises);
app.get('/chat', resourcesController.chat); app.get('/chat', resourcesController.chat);
app.get('/challenge-map', challengeMapController.challengeMap); app.get('/map', challengeMapController.challengeMap);
app.get('/live-pair-programming', function(req, res) { app.get('/live-pair-programming', function(req, res) {
res.redirect(301, '/wiki/live-stream-pair-programming-on-twitch.tv'); res.redirect(301, '/wiki/live-stream-pair-programming-on-twitch.tv');
@ -484,8 +484,6 @@ app.get('/api/trello', resourcesController.trelloCalls);
* Bonfire related routes * Bonfire related routes
*/ */
app.get('/bonfires/getBonfireList', bonfireController.showAllBonfires);
app.get('/wiki/getWikiList', wikiController.showAllWikis); app.get('/wiki/getWikiList', wikiController.showAllWikis);
app.get('/playground', bonfireController.index); app.get('/playground', bonfireController.index);
@ -529,8 +527,6 @@ app.post('/completed-wiki/', wikiController.completedWiki);
app.get('/challenges/', coursewareController.returnNextCourseware); app.get('/challenges/', coursewareController.returnNextCourseware);
app.get('/challenges/getCoursewareList', coursewareController.showAllCoursewares);
app.get( app.get(
'/challenges/:coursewareName', '/challenges/:coursewareName',
coursewareController.returnIndividualCourseware coursewareController.returnIndividualCourseware

View File

@ -30,7 +30,7 @@ $(document).ready(function() {
.addClass('animated fadeInDown'); .addClass('animated fadeInDown');
}); });
function completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash) { function completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash, bonfireName) {
$('#complete-bonfire-dialog').modal('show'); $('#complete-bonfire-dialog').modal('show');
// Only post to server if there is an authenticated user // Only post to server if there is an authenticated user
if ($('.signup-btn-nav').length < 1) { if ($('.signup-btn-nav').length < 1) {
@ -38,10 +38,10 @@ $(document).ready(function() {
'/completed-bonfire', '/completed-bonfire',
{ {
bonfireInfo: { bonfireInfo: {
bonfireName: title,
completedWith: didCompleteWith, completedWith: didCompleteWith,
solution: bonfireSolution, solution: bonfireSolution,
bonfireHash: thisBonfireHash bonfireHash: thisBonfireHash,
bonfireName: bonfireName
} }
}, },
function(res) { function(res) {
@ -72,9 +72,9 @@ $(document).ready(function() {
$('.next-bonfire-button').on('click', function() { $('.next-bonfire-button').on('click', function() {
var bonfireSolution = myCodeMirror.getValue(); var bonfireSolution = myCodeMirror.getValue();
var thisBonfireHash = passedBonfireHash || null; var thisBonfireHash = passedBonfireHash || null;
var bonfireName = title; var bonfireName = $('#bonfire-name').text();
var didCompleteWith = $('#completed-with').val() || null; var didCompleteWith = $('#completed-with').val() || null;
completedBonfire(didCompleteWith, bonfireName, bonfireSolution, thisBonfireHash); completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash, bonfireName);
}); });
@ -99,18 +99,6 @@ $(document).ready(function() {
editor.focus(); editor.focus();
}); });
$('#all-bonfires-dialog').on('hidden.bs.modal', function() {
editor.focus();
});
$('#showAllCoursewares').on('click', function() {
$('#all-coursewares-dialog').modal('show');
});
$('#all-coursewares-dialog').on('hidden.bs.modal', function() {
editor.focus();
});
$('#complete-courseware-dialog').on('hidden.bs.modal', function() { $('#complete-courseware-dialog').on('hidden.bs.modal', function() {
editor.focus(); editor.focus();
}); });
@ -188,11 +176,11 @@ $(document).ready(function() {
$('.all-challenges').on('click', function() { $('.all-challenges').on('click', function() {
$('#all-challenges-dialog').modal('show'); $('#show-all-dialog').modal('show');
}); });
$('#showAllButton').on('click', function() { $('#showAllButton').on('click', function() {
$('#all-challenges-dialog').modal('show'); $('#show-all-dialog').modal('show');
}); });
$('.next-challenge-button').on('click', function() { $('.next-challenge-button').on('click', function() {

View File

@ -97,6 +97,7 @@ block content
| Try it out | Try it out
.hidden-xs.col-sm-12 .hidden-xs.col-sm-12
script(src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js")
#cal-heatmap.img-center #cal-heatmap.img-center
script. script.
$(document).ready(function() { $(document).ready(function() {
@ -129,14 +130,14 @@ block content
table.table.table-striped table.table.table-striped
thead thead
tr tr
th Challenge th.col-xs-4 Challenge
th Date Completed th.col-xs-2 Completed
th Link th.col-xs-6 Link
for challenge in challenges for challenge in challenges
tr tr
td= challenge.name td.col-xs-4= challenge.name
td= moment(challenge.completedDate, 'x').format("MMM DD, YYYY") td.col-xs-2= moment(challenge.completedDate, 'x').format("MMM DD, YYYY")
td td.col-xs-6
a(href=challenge.solution) View my solution a(href=challenge.solution) View my solution
br br
@ -145,12 +146,12 @@ block content
table.table.table-striped table.table.table-striped
thead thead
tr tr
th Bonfire th.col-xs-4 Bonfire
th Date Completed th.col-xs-2 Completed
th Link th.col-xs-6 Solution
for bonfire in bonfires for bonfire in bonfires
tr tr
td= bonfire.name td.col-xs-4= bonfire.name
td= moment(bonfire.completedDate, 'x').format("MMM DD, YYYY") td.col-xs-2= moment(bonfire.completedDate, 'x').format("MMM DD, YYYY")
td= bonfire.solution td.col-xs-6= bonfire.solution
br br

View File

@ -21,7 +21,7 @@ block content
.row .row
.col-xs-12.col-sm-12.col-md-4.bonfire-top .col-xs-12.col-sm-12.col-md-4.bonfire-top
#testCreatePanel #testCreatePanel
h1.text-center= name h1#bonfire-name.text-center= name
h2.text-center h2.text-center
.bonfire-flames Difficulty:&thinsp; .bonfire-flames Difficulty:&thinsp;
if (difficulty == "0") if (difficulty == "0")
@ -82,7 +82,6 @@ block content
| Less information | Less information
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter) #submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
#showAllButton.btn.btn-info.btn-big.btn-block Show all bonfires
br br
form.code form.code
.form-group.codeMirrorView .form-group.codeMirrorView
@ -139,13 +138,6 @@ block content
- else - else
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
#all-challenges-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
.modal-content
.modal-header.all-list-header Bonfires
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
include ../partials/bonfires
script. script.
var MDNlinks = !{JSON.stringify(MDNlinks)}; var MDNlinks = !{JSON.stringify(MDNlinks)};
if (!MDNlinks.length) { if (!MDNlinks.length) {

View File

@ -36,13 +36,7 @@ block content
= phrase = phrase
- else - else
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
#all-challenges-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
.modal-content
.modal-header.challenge-list-header Challenges
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
include ../partials/challenges
script. script.
$.ajax({ $.ajax({
url: 'https://api-ssl.bitly.com/v3/shorten?access_token=75e7931a19befaafcf108021b6d597e554b2c5c3&longUrl=http%3A%2F%2Ffreecodecamp.com%2Fchallenges%2F' + !{JSON.stringify(number)} + '&format=txt' url: 'https://api-ssl.bitly.com/v3/shorten?access_token=75e7931a19befaafcf108021b6d597e554b2c5c3&longUrl=http%3A%2F%2Ffreecodecamp.com%2Fchallenges%2F' + !{JSON.stringify(number)} + '&format=txt'
@ -53,4 +47,4 @@ block content
url = "https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=" + data + "&hashtags=LearnToCode, JavaScript"; url = "https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=" + data + "&hashtags=LearnToCode, JavaScript";
$('.btn-twitter').attr('href', url); $('.btn-twitter').attr('href', url);
} }
); );

View File

@ -50,8 +50,6 @@ block content
script. script.
var userLoggedIn = false; var userLoggedIn = false;
.button-spacer .button-spacer
#showAllButton.btn.btn-info.btn-big.btn-block Show all challenges
br
ul#testSuite.list-group ul#testSuite.list-group
br br
script(type="text/javascript"). script(type="text/javascript").
@ -85,10 +83,3 @@ block content
span.completion-icon.ion-checkmark-circled.text-primary span.completion-icon.ion-checkmark-circled.text-primary
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
script(src="/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js") script(src="/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js")
#all-challenges-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
.modal-content
.modal-header.all-list-header Challenges
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
include ../partials/challenges

View File

@ -35,7 +35,6 @@ block content
span.ion-arrow-up-b span.ion-arrow-up-b
| Less information | Less information
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter) #submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
#showAllButton.btn.btn-info.btn-big.btn-block Show all challenges
br br
form.code form.code
.form-group.codeMirrorView .form-group.codeMirrorView
@ -75,10 +74,3 @@ block content
= phrase = phrase
- else - else
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
#all-challenges-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
.modal-content
.modal-header.all-list-header Challenges
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
include ../partials/challenges

View File

@ -22,7 +22,6 @@ block content
var userLoggedIn = false; var userLoggedIn = false;
br br
.button-spacer .button-spacer
#showAllButton.btn.btn-info.btn-big.btn-block Show all challenges
script(type="text/javascript"). script(type="text/javascript").
var tests = !{JSON.stringify(tests)}; var tests = !{JSON.stringify(tests)};
var passedCoursewareHash = !{JSON.stringify(coursewareHash)}; var passedCoursewareHash = !{JSON.stringify(coursewareHash)};
@ -54,10 +53,3 @@ block content
$('#complete-courseware-dialog').modal('show'); $('#complete-courseware-dialog').modal('show');
} }
}); });
#all-challenges-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
.modal-content
.modal-header.all-list-header Challenges
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
include ../partials/challenges

View File

@ -73,7 +73,7 @@ block content
if !user if !user
a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free) a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free)
.spacer .spacer
#all-challenges-dialog.modal(tabindex='-1') #show-all-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation .modal-dialog.animated.fadeInUp.fast-animation
.modal-content .modal-content
.modal-header.all-list-header Nonprofit Projects .modal-header.all-list-header Nonprofit Projects

View File

@ -1,30 +0,0 @@
h3
ol#bonfireList
script(src='/js/lib/ramda/ramda.min.js')
script.
var getLinkedName = function getLinkedName(name) {
// ensure name is a string
name = name + '';
return name.toLowerCase().replace(/\s/g, '-');
}
$.ajax({
url: '/bonfires/getBonfireList',
type: 'GET'
})
.success(
function(data) {
var docfrag = document.createDocumentFragment();
for (var i = 0; i < data.bonfireList.length; i++) {
var li = document.createElement("li");
var linkedName = getLinkedName(data.bonfireList[i].name);
if (data.completedList.length > 0 && R.contains(data.bonfireList[i]._id, data.completedList)) {
$(li).html("<span class='sr-only'>completed</span><a href='/bonfires/" + linkedName + "'>" + data.bonfireList[i].name + "</a></li>");
$(li).addClass('strikethrough');
} else {
$(li).html("<a href='/bonfires/" + linkedName + "'>" + data.bonfireList[i].name + "</a></li>");
}
docfrag.appendChild(li);
};
$('#bonfireList').append(docfrag);
});

View File

@ -1,28 +0,0 @@
h3
ol#coursewareList
script(src='/js/lib/ramda/ramda.min.js')
script.
var getLinkedName = function getLinkedName(name) {
return name.toLowerCase().replace(/\s/g, '-');
}
$.ajax({
url: '/challenges/getCoursewareList',
type: 'GET'
})
.success(
function(data) {
var docfrag = document.createDocumentFragment();
for (var i = 0; i < data.coursewareList.length; i++) {
var li = document.createElement("li");
var linkedName = getLinkedName(data.coursewareList[i].name);
if (data.completedList.length > 0 && R.contains(data.coursewareList[i]._id, data.completedList)) {
$(li).html("<span class='sr-only'>completed</span><a href='/challenges/" + linkedName + "'>" + data.coursewareList[i].name + "</a></li>");
$(li).addClass('strikethrough');
} else {
$(li).html("<a href='/challenges/" + linkedName + "'>" + data.coursewareList[i].name + "</a></li>");
}
docfrag.appendChild(li);
};
$('#coursewareList').append(docfrag);
});

View File

@ -1,75 +0,0 @@
.panel.panel-info
.panel-heading.landing-panel-heading.text-center Frequently Asked Questions
.panel-body
.landing-panel-body
.row
.text-left.col-xs-12.col-md-10.col-md-offset-1
h2 What will I learn, and in what sequence?
ul
p.landing-p First, you'll learn basic web design tools like:
ul
li.landing-p &#8226 HTML - the structure of web pages
li.landing-p &#8226 CSS - the visual style of web pages
li.landing-p &#8226 Bootstrap - a "responsive design" tool that helps your websites look great on tablets and phones
li.landing-p &#8226 jQuery - an easy tool for controlling content in the browser
li.landing-p &#8226 Chrome DevTools - a tool for understanding and debugging websites, right in your browser
p.landing-p Then you'll learn computer science and the art of programming:
ul
li.landing-p &#8226 JavaScript - the one programming language that all web browsers use
li.landing-p &#8226 Algorithms - step-by-step recipes for getting things done
li.landing-p &#8226 Automated Testing - write tests to test the limits of your code
p.landing-p You'll spend the last half of Free Code Camp using Agile Methodologies and Full Stack JavaScript to build projects for nonprofits:
ul
li.landing-p &#8226 Agile - a set of software development principles that focus the design and production of a project on the needs of its users
li.landing-p &#8226 Git - a version control system for saving and sharing your projects
li.landing-p &#8226 MongoDB - a popular non-relational database
li.landing-p &#8226 Angular.js - a tool for making exciting web interfaces
li.landing-p &#8226 Express.js - a powerful web development framework
li.landing-p &#8226 Node.js - a JavaScript-based web server
h2 Will I be ready to get a software engineer job after this?
ul
p.landing-p At the end of Free Code Camp, you will have pair programmed around 1,000 hours with dozens of other students, built a portfolio of projects that people are actively using, and a roster of glowing references from nonprofits you've helped. This is more coding than most coding bootcamps provide, and on average, 75% of bootcamp graduates get software engineering jobs within 6 months, and earn an average annual salary of $76,000.
img.img-center.img-responsive(src="https://s3.amazonaws.com/freecodecamp/table-of-earnings.png" alt="A chart showing the average earnings of coding bootcamp graduates")
h2 How long does Free Code Camp take?
ul
p.landing-p It takes about 1,000 hours of coding to develop the skills you'll need to get an entry level software engineering job. Most coding bootcamps try to jam all this into 12 weeks of intensive study. Free Code Camp is fully online, and there will always be other people at your skill level that you can pair program with, so you can learn at your own pace. Here are some example coding schedules:
table.table
thead
th Time budgeted
th.hidden-xs Hours per week
th Weeks to complete
tr.info
td Weekends
td.hidden-xs 10 hours/week
td 100 weeks (2 years)
tr.success
td Nights and Weekends
td.hidden-xs 20 hours/week
td 50 weeks (1 year)
tr.warning
td Full time
td.hidden-xs 40 hours/week
td 25 weeks (6 months)
tr.danger
td Traditional Bootcamp Pacing
td.hidden-xs 80 hours/week
td 12 weeks (3 months)
h2 Why does Free Code Camp use JavaScript instead of Ruby or Python?
ul
p.landing-p Like JavaScript, Ruby and Python are high-level scripting languages that can be used for full stack web development. But even if you learned these languages, you'd still need to learn JavaScript. That's because JavaScript is the only language that runs in web browsers. JavaScript has been around for 20 years, and it is still growing in popularity. Because of this, JavaScript has more tools and online learning resources than any other language.
img.img-center.img-responsive(src="https://s3.amazonaws.com/freecodecamp/github-repo-growth.png", style="max-height: 355px;" alt="A chart showing the volume of new GitHub repositories by year, with JavaScript growing and most languages declining.")
br
h2 How will I learn all this?
ul
p.landing-p By pair programming with other Free Code Camp students on our coding challenges. Eventually, you'll work with people at nonprofits to build real-life software solutions.
h2 What is 'pair programming', and what's so special about it?
ul
p.landing-p Pair programming is where two people code together on one computer. You discuss different approaches to solving problems, and keep each other motivated. The result is better code than either of you could have written by yourselves. Because of its benefits, many engineers pair program full time. And it's the best way to learn coding. Thanks to tools that allow two people to share mouse and keyboard inputs, you can pair program with a friend without needing to be in the same room.
h2 Is this really free? Do you claim part of my first year's salary like some bootcamps do?
ul
p.landing-p Our name is Free Code Camp. We are a free code camp. If you had to pay us (or sign over future earnings), we'd have to change our name. And we are not going to do that.
h2 Does Free Code Camp have an application process?
ul
p.landing-p Unlike coding bootcamps, anyone can study at Free Code Camp. We're not going to tell you that you can't become a software engineer. We believe the only person who should be able to tell you that is you. If you persevere, and keep working through our challenges and nonprofit projects, you will become an employable software engineer.
br
br

View File

@ -12,7 +12,7 @@
.collapse.navbar-collapse .collapse.navbar-collapse
ul.nav.navbar-nav.navbar-right.hamburger-dropdown ul.nav.navbar-nav.navbar-right.hamburger-dropdown
li li
a(href='/challenge-map') Challenges a(href='/map') Map
li li
a(href='/chat' target='_blank') Chat a(href='/chat' target='_blank') Chat
li li

View File

@ -2,7 +2,6 @@ script(src="//ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js")
script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js") script(src="//ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js")
script(src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js") script(src="//cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/0.12.0/ui-bootstrap-tpls.min.js")
script(src="//d3js.org/d3.v3.min.js") script(src="//d3js.org/d3.v3.min.js")
script(src="//cdn.jsdelivr.net/cal-heatmap/3.3.10/cal-heatmap.min.js")
include meta include meta
title #{title} | Free Code Camp title #{title} | Free Code Camp
meta(charset='utf-8') meta(charset='utf-8')

View File

@ -39,7 +39,7 @@ block content
script. script.
var challengeName = 'Learn to code' var challengeName = 'Learn to code'
.row .row
.col-xs-12.col-sm-12.col-md-6 .col-xs-12
.panel.panel-info .panel.panel-info
.panel-heading.landing-panel-heading.text-center Announcements .panel-heading.landing-panel-heading.text-center Announcements
.panel-body .panel-body
@ -76,8 +76,6 @@ block content
.col-xs-12.github-and-twitter-button-text .col-xs-12.github-and-twitter-button-text
html. html.
<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> <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>
.col-xs-12.col-sm-12.col-md-6
include ../partials/faq
//#announcementModal.modal(tabindex='-1') //#announcementModal.modal(tabindex='-1')
// .modal-dialog // .modal-dialog
// .modal-content // .modal-content
@ -95,4 +93,4 @@ block content
// $('#announcementModal').modal('show'); // $('#announcementModal').modal('show');
// localStorage.campWideMeeting = "true"; // localStorage.campWideMeeting = "true";
// } // }
// }); // });

View File

@ -24,7 +24,7 @@ block content
if !user if !user
a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free) a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free)
.spacer .spacer
#all-challenges-dialog.modal(tabindex='-1') #show-all-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation .modal-dialog.animated.fadeInUp.fast-animation
.modal-content .modal-content
.modal-header.all-list-header Wiki Articles .modal-header.all-list-header Wiki Articles