start creating partials and views
This commit is contained in:
26
app.js
26
app.js
@ -122,14 +122,14 @@ app.use(express.static(path.join(__dirname, 'public'), { maxAge: week }));
|
||||
|
||||
app.get('/', homeController.index);
|
||||
app.get('/curriculum', curriculumController.index);
|
||||
app.get('/courses/:id', courseController.view);
|
||||
app.get('/course/:id', courseController.view);
|
||||
app.get('/courses', courseController.index);
|
||||
app.get('/challenges/:id', challengeController.view);
|
||||
app.get('/challenges', challengeController.index);
|
||||
//app.get('/challenges/first_website', challengeController.firstWebsite)
|
||||
app.get('/challenges/first_pair_programming_session', challengeController.firstPairProgrammingSession)
|
||||
//app.get('/challenges/first_dynamic_website', challengeController.firstDynamicWebsite)
|
||||
//app.get('/challenges/first_codepen', challengeController.firstCodePen)
|
||||
//app.get('/challenges/:id', challengeController.view);
|
||||
//app.get('/challenges', challengeController.index);
|
||||
app.get('/challenges/create-and-deploy-a-website', challengeController.createAndDeployAWebsite)
|
||||
app.get('/challenges/challenges/add-dynamic-content-to-your-website', challengeController.experimentWithHtmlAndCssInCodepen)
|
||||
app.get('/challenges/experiment-with-html-and-css-in-codepen', challengeController.addDynamicContentToYourWebsite)
|
||||
app.get('/challenges/start-a-pair-programming-session', challengeController.startAPairProgrammingSession)
|
||||
app.get('/login', userController.getLogin);
|
||||
app.post('/login', userController.postLogin);
|
||||
app.get('/logout', userController.logout);
|
||||
@ -179,27 +179,27 @@ app.get('/api/yahoo', apiController.getYahoo);
|
||||
*/
|
||||
|
||||
app.get('/auth/instagram', passport.authenticate('instagram'));
|
||||
app.get('/auth/instagram/callback', passport.authenticate('instagram', { failureRedirect: '/login' }), function(req, res) {
|
||||
app.get('/auth/instagram/callback', passport.authenticate('instagram', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) {
|
||||
res.redirect(req.session.returnTo || '/');
|
||||
});
|
||||
app.get('/auth/facebook', passport.authenticate('facebook', { scope: ['email', 'user_location'] }));
|
||||
app.get('/auth/facebook/callback', passport.authenticate('facebook', { failureRedirect: '/login' }), function(req, res) {
|
||||
app.get('/auth/facebook/callback', passport.authenticate('facebook', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) {
|
||||
res.redirect(req.session.returnTo || '/');
|
||||
});
|
||||
app.get('/auth/github', passport.authenticate('github'));
|
||||
app.get('/auth/github/callback', passport.authenticate('github', { failureRedirect: '/login' }), function(req, res) {
|
||||
app.get('/auth/github/callback', passport.authenticate('github', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) {
|
||||
res.redirect(req.session.returnTo || '/');
|
||||
});
|
||||
app.get('/auth/google', passport.authenticate('google', { scope: 'profile email' }));
|
||||
app.get('/auth/google/callback', passport.authenticate('google', { failureRedirect: '/login' }), function(req, res) {
|
||||
app.get('/auth/google/callback', passport.authenticate('google', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) {
|
||||
res.redirect(req.session.returnTo || '/');
|
||||
});
|
||||
app.get('/auth/twitter', passport.authenticate('twitter'));
|
||||
app.get('/auth/twitter/callback', passport.authenticate('twitter', { failureRedirect: '/login' }), function(req, res) {
|
||||
app.get('/auth/twitter/callback', passport.authenticate('twitter', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) {
|
||||
res.redirect(req.session.returnTo || '/');
|
||||
});
|
||||
app.get('/auth/linkedin', passport.authenticate('linkedin', { state: 'SOME STATE' }));
|
||||
app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { failureRedirect: '/login' }), function(req, res) {
|
||||
app.get('/auth/linkedin/callback', passport.authenticate('linkedin', { successRedirect: '/curriculum',failureRedirect: '/login' }), function(req, res) {
|
||||
res.redirect(req.session.returnTo || '/');
|
||||
});
|
||||
|
||||
|
@ -20,16 +20,30 @@ exports.view = function(req, res) {
|
||||
});
|
||||
});
|
||||
};
|
||||
exports.firstPairProgrammingSession = function(req, res) {
|
||||
Challenge.findOne({ name: "Start Your First Pair Programming Session" }).exec (function(err, challenge) {
|
||||
res.render('challenge/first_pair_programming_session', {
|
||||
title: 'Challenge',
|
||||
challenge: challenge
|
||||
});
|
||||
exports.createAndDeployAWebsite = function(req, res) {
|
||||
res.render('challenge/create-and-deploy-a-website', {
|
||||
name: 'Create and Deploy a Website',
|
||||
image: 'http://startbootstrap.com/assets/img/templates/landing-page.jpg',
|
||||
video: '',
|
||||
directions: "In the next 5 minutes, you'll create a website and deploy it to the internet!",
|
||||
links: ["http://startbootstrap.com/template-overviews/freelancer/", "www.bitballoon.com", "https://atom.io/"]
|
||||
});
|
||||
};
|
||||
|
||||
//firstPairProgrammingSession
|
||||
//firstCodePen
|
||||
//firstDynamicWebsite
|
||||
//firstWebsite
|
||||
exports.addDynamicContentToYourWebsite = function(req, res) {
|
||||
res.render('challenge/add-dynamic-content-to-your-website', {
|
||||
name: 'Add dynamic content to your website'
|
||||
});
|
||||
};
|
||||
|
||||
exports.experimentWithHtmlAndCssInCodepen = function(req, res) {
|
||||
res.render('challenge/experiment-with-html-and-css-in-codepen', {
|
||||
name: 'Experiment with HTML and CSS in Codepen'
|
||||
});
|
||||
};
|
||||
|
||||
exports.startAPairProgrammingSession = function(req, res) {
|
||||
res.render('challenge/start-a-pair-programming-session', {
|
||||
name: 'Start a pair programming session'
|
||||
});
|
||||
};
|
@ -8,8 +8,7 @@ var Course = require('./../models/Course')
|
||||
exports.index = function(req, res) {
|
||||
Course.find(function(err, courses){
|
||||
res.render('curriculum/curriculum', {
|
||||
title: 'Curriculum',
|
||||
courses: courses
|
||||
title: 'Curriculum'
|
||||
});
|
||||
});
|
||||
};
|
@ -1,8 +1,8 @@
|
||||
[
|
||||
{
|
||||
"name": "Build and Deploy Your First Website",
|
||||
"name": "Create and Deploy a Website",
|
||||
"source": "Free Code Camp",
|
||||
"link": "http://www.freecodecamp.com/first_website",
|
||||
"link": "http://www.freecodecamp.com/create-and-deploy-a-website",
|
||||
"image": "http://startbootstrap.com/assets/img/templates/landing-page.jpg",
|
||||
"time": 1,
|
||||
"directions": [
|
||||
|
9
views/challenge/add-dynamic-content-to-your-website.jade
Normal file
9
views/challenge/add-dynamic-content-to-your-website.jade
Normal file
@ -0,0 +1,9 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.row
|
||||
.col-sm-8.col-xs-12
|
||||
include ./partials/challenge
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/challenges
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/courses
|
9
views/challenge/create-and-deploy-a-website.jade
Normal file
9
views/challenge/create-and-deploy-a-website.jade
Normal file
@ -0,0 +1,9 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.row
|
||||
.col-sm-8.col-xs-12
|
||||
include ./partials/challenge
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/challenges
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/courses
|
@ -0,0 +1,9 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.row
|
||||
.col-sm-8.col-xs-12
|
||||
include ./partials/challenge
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/challenges
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/courses
|
@ -1,3 +0,0 @@
|
||||
extends ../layout
|
||||
block content
|
||||
li= challenge.name
|
2
views/challenge/partials/challenge.jade
Normal file
2
views/challenge/partials/challenge.jade
Normal file
@ -0,0 +1,2 @@
|
||||
h1 Challenge
|
||||
h2= name
|
9
views/challenge/start-a-pair-programming-session.jade
Normal file
9
views/challenge/start-a-pair-programming-session.jade
Normal file
@ -0,0 +1,9 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.row
|
||||
.col-sm-8.col-xs-12
|
||||
include ./partials/challenge
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/challenges
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/courses
|
@ -1,12 +1,24 @@
|
||||
extends ../layout
|
||||
|
||||
block content
|
||||
.page-header
|
||||
h3 Your Curriculum
|
||||
h1= title
|
||||
ul
|
||||
each course in courses
|
||||
a(href="/courses/#{course.id}")
|
||||
=course.name
|
||||
br
|
||||
|
||||
.row
|
||||
.col-sm-8.col-xs-12
|
||||
h1 Welcome to Free Code Camp!
|
||||
ol
|
||||
li
|
||||
a(href="challenges/create-and-deploy-a-website") Learn how to create a website and deploy it to the internet
|
||||
|   (takes 10 minutes)
|
||||
li
|
||||
a(href="challenges/start-a-pair-programming-session") Learn how to start Pair Programming session
|
||||
|   (takes 10 minutes)
|
||||
li
|
||||
a(href="challenges/add-dynamic-content-to-your-website") Learn how to add dynamic content to your website
|
||||
|   (takes 10 minutes)
|
||||
li
|
||||
a(href="challenges/experiment-with-html-and-css-in-codepen") Learn how to experiment with HTML and CSS in Codepen
|
||||
|   (takes 10 minutes)
|
||||
li
|
||||
a(href="challenges") Start the HTML and CSS challenges!
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/challenges
|
||||
.col-sm-4.col-xs-12
|
||||
include ./../partials/courses
|
1
views/partials/challenges.jade
Normal file
1
views/partials/challenges.jade
Normal file
@ -0,0 +1 @@
|
||||
h1 Challenges Partial
|
5
views/partials/courses.jade
Normal file
5
views/partials/courses.jade
Normal file
@ -0,0 +1,5 @@
|
||||
h1 Courses Partial
|
||||
|
||||
//ul
|
||||
// li
|
||||
// a(href="courses/codecademy-html-and-css-track") Codecademy HTML & CSS Track
|
Reference in New Issue
Block a user