Resolve merge conflict (spacing issue in app.js)

This commit is contained in:
Nathan Leniz
2015-03-28 11:35:14 +09:00
22 changed files with 473 additions and 9 deletions

22
app.js
View File

@ -15,7 +15,7 @@ process.on('uncaughtException', function (err) {
});
var express = require('express'),
accepts = require('accepts'),
//accepts = require('accepts'),
cookieParser = require('cookie-parser'),
compress = require('compression'),
session = require('express-session'),
@ -36,10 +36,12 @@ var express = require('express'),
* Controllers (route handlers).
*/
homeController = require('./controllers/home'),
challengesController = require('./controllers/challenges'),
resourcesController = require('./controllers/resources'),
userController = require('./controllers/user'),
contactController = require('./controllers/contact'),
ziplineController = require('./controllers/ziplines'),
basejumpController = require('./controllers/basejumps'),
nonprofitController = require('./controllers/nonprofits'),
bonfireController = require('./controllers/bonfire'),
coursewareController = require('./controllers/courseware'),
@ -105,7 +107,7 @@ app.use(session({
secret: secrets.sessionSecret,
store: new MongoStore({
url: secrets.db,
'auto_reconnect': true
'autoReconnect': true
})
}));
app.use(passport.initialize());
@ -273,6 +275,18 @@ app.post('/email-signup', userController.postEmailSignup);
app.post('/email-signin', userController.postSignin);
app.get('/nonprofits', contactController.getNonprofitsForm);
app.post('/nonprofits', contactController.postNonprofitsForm);
app.get('/nonprofits/home', nonprofitController.nonprofitsHome);
app.get('/nonprofits/are-you-with-a-registered-nonprofit', nonprofitController.areYouWithARegisteredNonprofit);
app.get('/nonprofits/are-there-people-that-are-already-benefiting-from-your-services', nonprofitController.areTherePeopleThatAreAlreadyBenefitingFromYourServices);
app.get('/nonprofits/in-exchange-we-ask', nonprofitController.inExchangeWeAsk);
app.get('/nonprofits/ok-with-javascript', nonprofitController.okWithJavaScript);
app.get('/nonprofits/how-can-free-code-camp-help-you', nonprofitController.howCanFreeCodeCampHelpYou);
app.get('/nonprofits/what-does-your-nonprofit-do', nonprofitController.whatDoesYourNonprofitDo);
app.get('/nonprofits/link-us-to-your-website', nonprofitController.linkUsToYourWebsite);
app.get('/nonprofits/tell-us-your-name', nonprofitController.tellUsYourName);
app.get('/nonprofits/tell-us-your-email', nonprofitController.tellUsYourEmail);
app.get('/nonprofits/your-nonprofit-project-application-has-been-submitted', nonprofitController.yourNonprofitProjectApplicationHasBeenSubmitted);
app.get('/nonprofits/other-solutions', nonprofitController.otherSolutions);
app.get(
'/done-with-first-100-hours',
@ -437,8 +451,6 @@ app.post('/account/password', userController.postUpdatePassword);
app.post('/account/delete', userController.postDeleteAccount);
app.get('/account/unlink/:provider', userController.getOauthUnlink);
app.get('/sitemap.xml', resourcesController.sitemap);
/**
* OAuth sign-in routes.
*/

21
controllers/basejumps.js Normal file
View File

@ -0,0 +1,21 @@
var async = require('async'),
User = require('../models/User'),
Challenge = require('./../models/Challenge'),
Bonfire = require('./../models/Bonfire'),
Story = require('./../models/Story'),
Comment = require('./../models/Comment'),
resources = require('./resources.json'),
steps = resources.steps,
secrets = require('./../config/secrets'),
moment = require('moment'),
https = require('https'),
debug = require('debug')('freecc:cntr:resources'),
cheerio = require('cheerio'),
request = require('request'),
R = require('ramda');
nonprofitHome: function nonprofitHome(req, res) {
res.render('nonprofits/home', {
title: 'A guide to our Nonprofit Projects'
});
}

101
controllers/nonprofits.js Normal file
View File

@ -0,0 +1,101 @@
var async = require('async'),
User = require('../models/User'),
Challenge = require('./../models/Challenge'),
Bonfire = require('./../models/Bonfire'),
Story = require('./../models/Story'),
Comment = require('./../models/Comment'),
resources = require('./resources.json'),
steps = resources.steps,
secrets = require('./../config/secrets'),
moment = require('moment'),
https = require('https'),
debug = require('debug')('freecc:cntr:resources'),
cheerio = require('cheerio'),
request = require('request'),
R = require('ramda');
exports.nonprofitsHome = function(req, res) {
res.render('nonprofits/home', {
title: 'A guide to our Nonprofit Projects'
});
};
exports.areYouWithARegisteredNonprofit = function(req, res) {
res.render('nonprofits/are-you-with-a-registered-nonprofit', {
title: 'Are you with a with a registered nonprofit',
step: 1
});
};
exports.areTherePeopleThatAreAlreadyBenefitingFromYourServices = function(req, res) {
res.render('nonprofits/are-there-people-that-are-already-benefiting-from-your-services', {
title: 'Are there people already benefiting from your services',
step: 2
});
};
exports.okWithJavaScript = function(req, res) {
res.render('nonprofits/ok-with-javascript', {
title: 'Are you OK with us using JavaScript',
step: 3
});
};
exports.inExchangeWeAsk = function(req, res) {
res.render('nonprofits/in-exchange-we-ask', {
title: 'In exchange we ask that you ...',
step: 4
});
};
exports.howCanFreeCodeCampHelpYou = function(req, res) {
res.render('nonprofits/how-can-free-code-camp-help-you', {
title: 'Are you with a with a registered nonprofit',
step: 5
});
};
exports.whatDoesYourNonprofitDo = function(req, res) {
res.render('nonprofits/what-does-your-nonprofit-do', {
existingParams: req.params,
title: 'What does your nonprofit do?',
step: 6
});
};
exports.linkUsToYourWebsite = function(req, res) {
res.render('nonprofits/link-us-to-your-website', {
title: 'Link us to your website',
step: 7
});
};
exports.tellUsYourEmail = function(req, res) {
res.render('nonprofits/tell-us-your-email', {
title: 'Tell us your name',
step: 8
});
};
exports.tellUsYourName = function(req, res) {
res.render('nonprofits/tell-us-your-name', {
title: 'Tell us your name',
step: 9
});
};
exports.finishApplication = function(req, res) {
};
exports.yourNonprofitProjectApplicationHasBeenSubmitted = function(req, res) {
res.render('nonprofits/your-nonprofit-project-application-has-been-submitted', {
title: 'Your Nonprofit Project application has been submitted!'
});
};
exports.otherSolutions = function(req, res) {
res.render('nonprofits/other-solutions', {
title: 'Here are some other possible solutions for you'
});
};

21
controllers/ziplines.js Normal file
View File

@ -0,0 +1,21 @@
var async = require('async'),
User = require('../models/User'),
Challenge = require('./../models/Challenge'),
Bonfire = require('./../models/Bonfire'),
Story = require('./../models/Story'),
Comment = require('./../models/Comment'),
resources = require('./resources.json'),
steps = resources.steps,
secrets = require('./../config/secrets'),
moment = require('moment'),
https = require('https'),
debug = require('debug')('freecc:cntr:resources'),
cheerio = require('cheerio'),
request = require('request'),
R = require('ramda');
nonprofitHome: function nonprofitHome(req, res) {
res.render('nonprofits/home', {
title: 'A guide to our Nonprofit Projects'
});
}

View File

@ -335,6 +335,10 @@ ul {
margin-bottom: -10px;
}
.nonprofit-landing {
font-size: 50px;
}
.big-text {
font-size: 63px;
}
@ -731,6 +735,11 @@ iframe.iphone {
}
}
.nonprofit-help-select-text-height {
font-size: 40px;
padding-top: 20px;
}
// To adjust right margin, negative values bring the image closer to the edge of the screen
.iphone-position {
position: absolute;
@ -871,6 +880,10 @@ iframe.iphone {
background-color: #EEEEEE;
}
.checkbox-table label {
margin-left: 10px;
}
//uncomment this to see the dimensions of all elements outlined in red
//* {
// border-color: red;

View File

@ -16,4 +16,4 @@
//= require lib/jquery-2.1.1.min
//= require lib/bootstrap.min
//= require lib/moment/moment
//= require main
//= require main

View File

@ -77,7 +77,7 @@ block content
span.ion-arrow-up-b
| Less information
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
#showAllButton.btn.btn-info.btn-big.btn-block Show all coding challenges
#showAllButton.btn.btn-info.btn-big.btn-block Show all bonfires
br
form.code
.form-group.codeMirrorView

View File

@ -25,7 +25,7 @@ block content
a.btn.btn-cta.signup-btn(href="/login") Start learning to code (it's free)
br
br
a.btn.nonprofit-cta.btn-success(href="/nonprofits") I'm with a nonprofit and want help coding something
a.btn.nonprofit-cta.btn-success(href="/nonprofits") Get pro bono help for my nonprofit
.big-break
h2 Campers you'll hang out with:
.row

View File

@ -0,0 +1,12 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 We build solutions for nonprofits who are already serving a need. Are there people who already benefit from your services?
.spacer
.row
.col-xs-6
a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/ok-with-javascript') Yes
.col-xs-6
a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') No

View File

@ -0,0 +1,12 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 Do you represent a nonprofit organization that is registered with your government?
.spacer
.row
.col-xs-6
a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/are-there-people-that-are-already-benefiting-from-your-services') Yes
.col-xs-6
a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') No

View File

@ -0,0 +1,83 @@
extends ../layout
block content
.jumbotron
.text-center
h2.nonprofit-landing.hug-top We'll code for your nonprofit, pro bono
.big-break
h2 Some of our success stories
.row
.col-xs-12.col-sm-12.col-md-4
img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-jen.jpg", alt="@jenthebest's testimonial image")
.testimonial-copy Getting back on track with Free Code Camp and committing to a new career in 2015!
h3 - @jenbestyoga
.col-xs-12.col-sm-12.col-md-4
img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-tate.jpg", alt="@TateThurston's testimonial image")
.testimonial-copy Just built my company's website with skills I've learned from Free Code Camp!
h3 - @TateThurston
.col-xs-12.col-sm-12.col-md-4
img.img-responsive.testimonial-image.img-center(src="https://s3.amazonaws.com/freecodecamp/testimonial-cynthia.jpg", alt="@cynthialanel's testimonial image")
.testimonial-copy I'm currently working through Free Code Camp to improve my JavaScript. The community is very welcoming!
h3 - @cynthialanel
.big-break
a.btn.btn-cta.signup-btn(href="/nonprofits/are-you-with-a-registered-nonprofit") Get pro bono help for my nonprofit
.big-break
h2 Our process
.row
.col-xs-12.col-sm-12.col-md-4
h3.nowrap Your idea
img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_portfolio.svg.gz', title='Get great references and connections to help you get a job')
p.landing-p You tell us how we can help you.
.col-xs-12.col-sm-12.col-md-4
h3.nowrap Our team
img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_nonprofits.svg.gz', title='Build a portfolio of apps for nonprofits')
p.landing-p We'll hand pick developers and a project manager.
.col-xs-12.col-sm-12.col-md-4
h3.nowrap Your solution
img.img-responsive.landing-icon.img-center(src= 'https://s3.amazonaws.com/freecodecamp/landingIcons_connect.svg.gz', title='Help nonprofits')
p.landing-p Together we'll set milestones and complete your project.
.big-break
h2 Solutions we can help you build:
.text-center.negative-35
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-android-globe
h2.black-text Websites
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-card
h2.black-text Donation Systems
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-android-calendar
h2.black-text Volunteer Systems
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-ios-box
h2.black-text Inventory Systems
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-university
h2.black-text E-learning Platforms
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-ios-list
h2.black-text Web Forms
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-ios-people
h2.black-text Community Tools
.col-xs-12.col-sm-12.col-md-3
.landing-skill-icon.ion-settings
h2.black-text ...and other tools
br
br
.big-break
h2 Why you should join our community right now:
h3.col-xs-offset-0.col-sm-offset-1
ul.text-left
li.ion-code   We're thousands of professionals, all learning to code together
li.ion-code   We're building projects for dozens of nonprofits
li.ion-code   Our community is 100% free and open source
li.ion-code   You'll learn Full Stack JavaScript and become a Software Engineer
li.ion-code   You'll work through our focused, interactive courses and tutorials
li.ion-code   You'll learn to code at your own pace, in your browser or on your phone
li.ion-code   You'll become qualified for thousands of jobs currently going unfilled
li.ion-code   You can get help in real time from our community chat rooms and forum
li.ion-code   We all share one common goal: to boost our careers with code
.big-break
a.btn.btn-cta.signup-btn(href="/nonprofits/are-you-with-a-registered-nonprofit") Get pro bono help for my nonprofit
script.
challengeName = 'Home'

View File

@ -0,0 +1,33 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 How can Free Code Camp help you?
.text-left.form-inline
h3.col-xs-12.col-sm-offset-5.checkbox-table
.col-xs-12
input.checkbox(type='checkbox', id='websites')
label.ion-android-globe   Websites
.col-xs-12
input.checkbox(type='checkbox', id='donationSystems')
label.ion-card   Donation Systems
.col-xs-12
input.checkbox(type='checkbox', id='volunteerSystems')
label.ion-android-calendar   Volunteer Systems
.col-xs-12
input.checkbox(type='checkbox', id='inventorySystems')
label.ion-ios-box   Inventory Systems
.col-xs-12
input.checkbox(type='checkbox', id='eLearningPlatforms')
label.ion-university   E-learning Platforms
.col-xs-12
input.checkbox(type='checkbox', id='webForms')
label.ion-ios-list   Web Forms
.col-xs-12
input.checkbox(type='checkbox', id='communityTools')
label.ion-ios-people   Community Tools
.col-xs-12
input.checkbox(type='checkbox', id='otherTools')
label.ion-settings   Other tools
button#next-step.btn.btn-primary.btn-big.btn-block(type='submit') I've selected all that apply and am ready to move on

View File

@ -0,0 +1,17 @@
extends ../layout
block content
.jumbotron
h1.hug-top.text-center Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 Great! In exchange for our help, we ask only that you:
h3
ol
li Appoint one principal stakeholder to serve on behalf of your organization.
li Communicate with our campers on a regular basis, to answer questions and provide them with direction.
li Commit to using the solution that our campers build for your nonprofit.
.spacer
.row
.col-xs-6
a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/how-can-free-code-camp-help-you') Sounds good!
.col-xs-6
a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') This might not be for us.

View File

@ -0,0 +1,14 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 Link us to the website, blog, or social media page that best represents your organization.
.spacer
form(role='form', method='GET', action="/nonprofits/tell-us-your-email/?" + existingParams)
input(type='hidden', name='_csrf', value=_csrf)
.formgroup
.input-group
input.form-control.big-text-field.field-responsive(type='text', name='link', autocomplete='off', maxlength='500', autofocus='')
span.input-group-btn
button.btn.btn-big.btn-primary.btn-responsive Submit

View File

@ -0,0 +1,12 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 Our campers are learning to code using modern full stack JavaScript technologies like Node.js. We do not build or maintain Wordpress, Drupal, or other non-JavaScript based frameworks.
.spacer
.row
.col-xs-6
a.btn.btn-primary.btn-big.btn-block(href='/nonprofits/in-exchange-we-ask') Sounds good!
.col-xs-6
a.btn.btn-warning.btn-big.btn-block(href='/nonprofits/other-solutions') This might not be for us.

View File

@ -0,0 +1,5 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Here are some other solutions we recommend
.spacer

View File

@ -0,0 +1,14 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 Please tell us your email
.spacer
form(role='form', method='GET', novalidate='novalidate', name='nonprofitForm', action="/nonprofits/tell-us-your-name/")
input(type='hidden', name='_csrf', value=_csrf)
.formgroup
.input-group
input.form-control.big-text-field.field-responsive(type='text', name='email', autocomplete='off', maxlength='500', autofocus='')
span.input-group-btn
button.btn.btn-big.btn-primary.btn-responsive Submit

View File

@ -0,0 +1,13 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 Please tell us your name
.spacer
form(role='form', method='POST', novalidate='novalidate', name='nonprofitForm', action="/nonprofits/finish-application/")
.formgroup
.input-group
input.form-control.big-text-field.field-responsive(type='text', name='name', autocomplete='off', maxlength='140', autofocus='')
span.input-group-btn
button.btn.btn-big.btn-primary.btn-responsive Submit

View File

@ -0,0 +1,28 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 In 140 characters or less, what does your nonprofit do? For whom?
.spacer
form(role='form', method='GET', action="/nonprofits/link-us-to-your-website/")
input(type='hidden', name='_csrf', value=_csrf)
.formgroup
.input-group
input.form-control.big-text-field.field-responsive#what-does-the-nonprofit-do(type='text', maxlength='140', autofocus='', autocomplete='off', name='mission')
span.input-group-btn
button.btn.btn-big.btn-primary.btn-responsive(href='/nonprofits/link-us-to-your-website') Submit
.text-left
span#what-does-the-nonprofit-do-feedback
script.
var text_max = 140;
$('#what-does-the-nonprofit-do-feedback').html(text_max + ' characters remaining');
$('#what-does-the-nonprofit-do').keyup(function (e) {
if (e.which === 13 || e === 13) {
$('#submit-comment-to-comment').click();
}
var text_length = $('#what-does-the-nonprofit-do').val().length;
var text_remaining = text_max - text_length;
$('#what-does-the-nonprofit-do-feedback').html(text_remaining + ' characters remaining');
});

View File

@ -0,0 +1,6 @@
extends ../layout
block content
.jumbotron.text-center
h1.hug-top Nonprofit Sign Up
include ../partials/nonprofit-application-progress-bar
h2 Thank you for reaching out to us. Well get back with you before N of next week.

View File

@ -0,0 +1,39 @@
.spacer
.progress
.progress-bar(role='progressbar', aria-valuenow= (step * 10), aria-valuemin='0', aria-valuemax='100', style="width: #{step * 10}%;")
span.sr-only= step * 10
| % Complete
h3.gray-text.text-center Step #{step} of 9
script.
$('#story-url').on('keypress', function (e) {
if (e.which === 13 || e === 13) {
$('#preliminary-story-submit').click();
}
});
var preliminaryStorySubmit = function preliminaryStorySubmit() {
var storyURL = $('#story-url').val();
$('#preliminary-story-submit').attr('disabled', 'disabled');
$.post('/stories/preliminary',
{
data: {
url: storyURL
}
})
.fail(function (xhr, textStatus, errorThrown) {
$('#preliminary-story-submit').attr('disabled', false);
})
.done(function (data, textStatus, xhr) {
if (data.alreadyPosted) {
window.location = data.storyURL;
} else {
window.location = '/stories/submit/new-story?url=' +
encodeURIComponent(data.storyURL) +
'&title=' + encodeURIComponent(data.storyTitle) +
'&image=' + encodeURIComponent(data.storyImage) +
'&description=' + encodeURIComponent(data.storyMetaDescription);
}
});
}
$('#preliminary-story-submit').on('click', preliminaryStorySubmit);

View File

@ -44,4 +44,12 @@
}
});
}
$('#preliminary-story-submit').on('click', preliminaryStorySubmit);
$('#preliminary-story-submit').on('click', preliminaryStorySubmit);
arr = $( "h3 input:checked" )
.map(function() {
return this.id;
})
.get()
.join('&');