@ -1,4 +1,4 @@
|
||||
import { isAlphanumeric, isHexadecimal } from 'validator';
|
||||
import { isAlphanumeric, isMongoId } from 'validator';
|
||||
import debug from 'debug';
|
||||
|
||||
const log = debug('fcc:models:promo');
|
||||
@ -6,16 +6,16 @@ const log = debug('fcc:models:promo');
|
||||
export default function promo(Promo) {
|
||||
Promo.getButton = function getButton(id, code, type = 'isNot') {
|
||||
const Job = Promo.app.models.Job;
|
||||
if (!id || !isHexadecimal(id)) {
|
||||
if (!id || !isMongoId('' + id)) {
|
||||
return Promise.reject(new Error(
|
||||
'Must include job id'
|
||||
));
|
||||
}
|
||||
|
||||
if (
|
||||
!isAlphanumeric(code) &&
|
||||
!isAlphanumeric('' + code) &&
|
||||
type &&
|
||||
!isAlphanumeric(type)
|
||||
!isAlphanumeric('' + type)
|
||||
) {
|
||||
return Promise.reject(new Error(
|
||||
'Code or Type should be an alphanumeric'
|
||||
|
@ -127,6 +127,7 @@
|
||||
"<strong>User Story:</strong> I can edit these recipes.",
|
||||
"<strong>User Story:</strong> I can delete these recipes.",
|
||||
"<strong>User Story:</strong> All new recipes I add are saved in my browser's local storage. If I refresh the page, these recipes will still be there.",
|
||||
"<strong>Hint: </strong> You should prefix your local storage keys on CodePen, i.e. <code>_username_recipes</code>",
|
||||
"Remember to use <a href='//github.com/FreeCodeCamp/freecodecamp/wiki/How-to-get-help-when-you-get-stuck' target='_blank'>Read-Search-Ask</a> if you get stuck.",
|
||||
"When you are finished, click the \"I've completed this challenge\" button and include a link to your CodePen.",
|
||||
"You can get feedback on your project from fellow campers by sharing it in our <a href='//gitter.im/freecodecamp/codereview' target='_blank'>Code Review Chatroom</a>. You can also share it on Twitter and your city's Campsite (on Facebook)."
|
||||
|
@ -431,7 +431,7 @@ module.exports = function(app) {
|
||||
challengeId = badIdMap[challengeId];
|
||||
}
|
||||
|
||||
if (!isMongoId(challengeId)) {
|
||||
if (!isMongoId('' + challengeId)) {
|
||||
challengeId = null;
|
||||
}
|
||||
|
||||
@ -456,7 +456,7 @@ module.exports = function(app) {
|
||||
challengeId = badIdMap[challengeId];
|
||||
}
|
||||
|
||||
if (!isMongoId(challengeId)) {
|
||||
if (!isMongoId('' + challengeId)) {
|
||||
challengeId = null;
|
||||
}
|
||||
|
||||
|
@ -276,9 +276,7 @@ module.exports = function(app) {
|
||||
}
|
||||
|
||||
function twitch(req, res) {
|
||||
res.render('resources/twitch', {
|
||||
title: 'Watch us code on Twitch.tv and LiveCoding.tv'
|
||||
});
|
||||
res.redirect('https://twitch.tv/freecodecamp');
|
||||
}
|
||||
|
||||
function unsubscribe(req, res, next) {
|
||||
|
@ -343,7 +343,7 @@ module.exports = function(app) {
|
||||
}
|
||||
var url = req.body.data.url;
|
||||
|
||||
if (!validator.isURL(url)) {
|
||||
if (!validator.isURL('' + url)) {
|
||||
req.flash('errors', {
|
||||
msg: "The URL you submitted doesn't appear valid"
|
||||
});
|
||||
|
@ -1,68 +0,0 @@
|
||||
extends ../layout
|
||||
block content
|
||||
.col-xs-12
|
||||
.panel.panel-info
|
||||
.panel-heading.text-center Watch us code on our Twitch.tv channel
|
||||
.panel-body.text-center
|
||||
.row
|
||||
.col-xs-12
|
||||
h2 Watch the live stream below or on our  
|
||||
a(href="http://twitch.tv/freecodecamp", target='_blank') Twitch.tv channel
|
||||
| .
|
||||
.spacer
|
||||
.row
|
||||
.col-md-8.col-xs-12
|
||||
.embed-responsive.embed-responsive-16by9
|
||||
iframe(src='http://www.twitch.tv/freecodecamp/embed', frameborder='0', scrolling='no')
|
||||
.col-md-4.col-xs-12
|
||||
.visible-sm.visible-xs
|
||||
.embed-responsive.embed-responsive-16by9
|
||||
iframe(src='http://www.twitch.tv/freecodecamp/chat?popout=', frameborder='0', scrolling='no')
|
||||
.visible-md.visible-lg
|
||||
.embed-responsive.embed-responsive-twitch-chat
|
||||
iframe(src='http://www.twitch.tv/freecodecamp/chat?popout=', frameborder='0', scrolling='no')
|
||||
.row
|
||||
.col-xs-12
|
||||
h2 Check out our scheduled shows. You can add them to your calendar.
|
||||
.embed-responsive.embed-responsive-16by9
|
||||
iframe.embed-responsive-item(src="https://www.google.com/calendar/embed?src=freecodecamp.com_r06116ile3o6ucpif7s0g281tc%40group.calendar.google.com&ctz=America/New_York&mode=AGENDA" style="border: 0" width="800" height="600" frameborder="0" scrolling="no")
|
||||
br
|
||||
.row
|
||||
.col-xs-12
|
||||
h2 Here are some of our previous shows (you can full-screen them):
|
||||
.row.negative-20
|
||||
.col-xs-12.col-sm-12.col-md-6
|
||||
.embed-responsive.embed-responsive-16by9.big-break
|
||||
iframe.embed-responsive-item(src='//www.youtube.com/embed/Z_43xApGB9Y')
|
||||
p.wrappable.negative-30 link:  
|
||||
a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/Z_43xApGB9Y
|
||||
.col-xs-12.col-sm-12.col-md-6
|
||||
.embed-responsive.embed-responsive-16by9.big-break
|
||||
iframe.embed-responsive-item(src='//www.youtube.com/embed/PvWHzcebjjQ')
|
||||
p.wrappable.negative-30 link:  
|
||||
a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/PvWHzcebjjQ
|
||||
.col-xs-12.col-sm-12.col-md-6
|
||||
.embed-responsive.embed-responsive-16by9.big-break
|
||||
iframe.embed-responsive-item(src='//www.youtube.com/embed/yHL6mEr-LGY')
|
||||
p.wrappable.negative-30 link:  
|
||||
a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/yHL6mEr-LGY
|
||||
.col-xs-12.col-sm-12.col-md-6
|
||||
.embed-responsive.embed-responsive-16by9.big-break
|
||||
iframe.embed-responsive-item(src='//www.youtube.com/embed/dolG-yRMcPs')
|
||||
p.wrappable.negative-30 link:  
|
||||
a(href="http://www.youtube.com/watch/Fn9HMn79KH0") http://www.youtube.com/watch/dolG-yRMcPs
|
||||
.col-xs-12.col-sm-12.col-md-6
|
||||
.embed-responsive.embed-responsive-16by9.big-break
|
||||
iframe.embed-responsive-item(src='//www.youtube.com/embed/YMz_vrK_KlQ')
|
||||
p.wrappable.negative-30 link:  
|
||||
a(href="http://www.youtube.com/watch/_BErpDdmBOw") http://www.youtube.com/watch/YMz_vrK_KlQ
|
||||
.col-xs-12.col-sm-12.col-md-6
|
||||
.embed-responsive.embed-responsive-16by9.big-break
|
||||
iframe.embed-responsive-item(src='//www.youtube.com/embed/bbFVxaza8Ik')
|
||||
p.wrappable.negative-30 link:  
|
||||
a(href="http://www.youtube.com/watch/S7iRBZJwOAs") http://www.youtube.com/watch/bbFVxaza8Ik
|
||||
br
|
||||
br
|
||||
br
|
||||
if !user
|
||||
a.btn.btn-cta.signup-btn.btn-primary(href="/login") Start learning to code (it's free)
|
Reference in New Issue
Block a user