-
Notifications
You must be signed in to change notification settings - Fork 61
Allow dojos to have a facebook #1091
Allow dojos to have a facebook #1091
Conversation
<div class="col-lg-8"> | ||
<input type="text" class="form-control" ng-model="dojo.facebook" | ||
cd-input-prefix="https://facebook.com/" | ||
name="dojoFacebook" id="dojoTwitter" placeholder="{@i18n key="e.g. @CoderDojo"/}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/Twitter/Facebook
. Also, example should be a Facebook URL, since that's what we're looking for.
lib/dojos.js
Outdated
@@ -27,6 +27,9 @@ var joiValidator = { | |||
twitter: function () { | |||
return Joi.string().allow(''); | |||
}, | |||
facebook: function () { | |||
return Joi.string().regex(/^https:\/\/facebook.com\//).allow(''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/^https?:\/\/facebook\.com\//
lrn2regex 😛
lib/dojos.js
Outdated
@@ -406,6 +410,7 @@ exports.register = function (server, options, next) { | |||
expectedAttendees: Joi.number().allow(null), | |||
website: joiValidator.optionalUri(), | |||
twitter: Joi.alternatives().try(joiValidator.twitter(), Joi.string().valid(null).valid('')), | |||
facebook: Joi.alternatives().try(joiValidator.facebook(), Joi.string().valid(null).valid('')), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've already allowed ''
in the facebook validator, so probably don't need .valid('')
here.
cd-input-prefix="https://facebook.com/" | ||
name="dojoFacebook" id="dojoTwitter" placeholder="{@i18n key="e.g. @CoderDojo"/}" | ||
cd-input-prefix="https://www.facebook.com/" | ||
name="dojoFacebook" id="dojoFacebook" placeholder="{@i18n key="e.g. @CoderDojo"/}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still haven't fixed the placeholder
d995be1
to
ebdb314
Compare
Fixes CoderDojo/community-platform#1029