add the bug, pair and help buttons to challenge views
This commit is contained in:
@ -594,13 +594,13 @@ module.exports = {
|
||||
var challenge = req.body.payload.challenge;
|
||||
|
||||
slack.send({
|
||||
text: "*" + userName + "* wants help with " + challenge + " " +
|
||||
text: "*" + userName + "* wants help with " + challenge + ". " +
|
||||
code + "Hey, *" + userName + "*, if no one helps you right " +
|
||||
"away, try typing out your problem in detail to me. Like this: " +
|
||||
"http://en.wikipedia.org/wiki/Rubber_duck_debugging",
|
||||
channel: '#help',
|
||||
username: "Debuggy the Rubber Duck",
|
||||
icon_emoji: ":hatched_chick:"
|
||||
icon_url: "https://pbs.twimg.com/profile_images/3609875545/569237541c920fa78d78902069615caf.jpeg"
|
||||
});
|
||||
return res.sendStatus(200);
|
||||
},
|
||||
@ -608,15 +608,18 @@ module.exports = {
|
||||
getPair: function(req, res, next) {
|
||||
var userName = req.user.profile.username;
|
||||
var challenge = req.body.payload.challenge;
|
||||
console.log('test');
|
||||
|
||||
slack.send({
|
||||
text: "Anyone want to pair with *" + userName + "* on " + challenge + "? (In the meantime, keep coding, *" + userName + "*)",
|
||||
text: "Anyone want to pair with *" + userName + "* on " + challenge +
|
||||
"?\nMake sure you install Screen Hero here:" +
|
||||
"http://freecodecamp.com/field-guide/how-do-i-install-screenhero\n" +
|
||||
"Then start your pair program session with *" + userName +
|
||||
"* by typing \"/hero @" + userName + "\" into Slack.\n* And"+ userName +
|
||||
"*, be sure to launch Screen Hero, then keep coding." +
|
||||
"Another camper may pair with you soon.",
|
||||
channel: '#letspair',
|
||||
username: "Perry the Matchmaker",
|
||||
icon_emoji: ":dancers:"
|
||||
username: "Companion Cube",
|
||||
icon_url: "https://lh3.googleusercontent.com/-f6xDPDV2rPE/AAAAAAAAAAI/AAAAAAAAAAA/mdlESXQu11Q/photo.jpg"
|
||||
});
|
||||
return res.sendStatus(200);
|
||||
|
||||
}
|
||||
};
|
||||
|
@ -24,7 +24,7 @@ $(document).ready(function() {
|
||||
{
|
||||
payload: {
|
||||
code: editorValue,
|
||||
challenge: currentLocation,
|
||||
challenge: currentLocation
|
||||
}
|
||||
},
|
||||
function(res) {
|
||||
@ -35,6 +35,27 @@ $(document).ready(function() {
|
||||
);
|
||||
});
|
||||
|
||||
$('#i-want-help-editorless').on('click', function() {
|
||||
var currentLocation = window.location.href;
|
||||
$.post(
|
||||
'/get-help',
|
||||
{
|
||||
payload: {
|
||||
challenge: currentLocation
|
||||
}
|
||||
},
|
||||
function(res) {
|
||||
if (res) {
|
||||
window.open('https://freecode.slack.com/messages/help/', '_blank')
|
||||
}
|
||||
}
|
||||
);
|
||||
});
|
||||
|
||||
$('#report-issue').on('click', function() {
|
||||
window.open('https://github.com/freecodecamp/freecodecamp/issues/new?title=Challenge '+ window.location.href +' has an issue &body=Please%20tell%20us%20in%20detail%20here%20how%20we%20can%20make%20this%20challenge%20better.', '_blank')
|
||||
});
|
||||
|
||||
$('#i-want-to-pair').on('click', function() {
|
||||
var currentLocation = window.location.href;
|
||||
$.post(
|
||||
|
@ -84,11 +84,17 @@ block content
|
||||
|
||||
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
|
||||
.button-spacer
|
||||
a.btn.btn-warning.btn-big.btn-block#i-want-help Help
|
||||
.btn-group.input-group.btn-group-justified
|
||||
label.btn.btn-success#i-want-help
|
||||
i.fa.fa-medkit
|
||||
| Help
|
||||
label.btn.btn-success#i-want-to-pair
|
||||
i.fa.fa-user-plus
|
||||
| Pair
|
||||
label.btn.btn-success#report-issue
|
||||
i.fa.fa-bug
|
||||
| Bug
|
||||
.button-spacer
|
||||
a.btn.btn-success.btn-big.btn-block#i-want-to-pair Pair
|
||||
.button-spacer
|
||||
a.btn.btn-success.btn-big.btn-block#i-found-a-bug Report Bug
|
||||
br
|
||||
form.code
|
||||
.form-group.codeMirrorView
|
||||
|
@ -44,9 +44,14 @@ block content
|
||||
br
|
||||
| (ctrl + enter)
|
||||
.button-spacer
|
||||
a.btn.btn-warning.btn-big.btn-block#i-want-help Get help
|
||||
.btn-group.input-group.btn-group-justified
|
||||
label.btn.btn-success#i-want-help
|
||||
i.fa.fa-medkit
|
||||
| Help
|
||||
label.btn.btn-success#report-issue
|
||||
i.fa.fa-bug
|
||||
| Bug
|
||||
.button-spacer
|
||||
a.btn.btn-success.btn-big.btn-block#i-want-to-pair Find a Pair
|
||||
script.
|
||||
var userLoggedIn = true;
|
||||
- else
|
||||
|
@ -35,6 +35,17 @@ block content
|
||||
span.ion-arrow-up-b
|
||||
| Less information
|
||||
#submitButton.btn.btn-primary.btn-big.btn-block Run code (ctrl + enter)
|
||||
.button-spacer
|
||||
.btn-group.input-group.btn-group-justified
|
||||
label.btn.btn-success#i-want-help
|
||||
i.fa.fa-medkit
|
||||
| Help
|
||||
label.btn.btn-success#i-want-to-pair
|
||||
i.fa.fa-user-plus
|
||||
| Pair
|
||||
label.btn.btn-success#report-issue
|
||||
i.fa.fa-bug
|
||||
| Bug
|
||||
br
|
||||
form.code
|
||||
.form-group.codeMirrorView
|
||||
|
@ -27,6 +27,14 @@ block content
|
||||
var userLoggedIn = false;
|
||||
br
|
||||
.button-spacer
|
||||
.btn-group.input-group.btn-group-justified
|
||||
.btn.btn-success#i-want-help-editorless
|
||||
i.fa.fa-medkit
|
||||
| Get help from our community
|
||||
.btn.btn-success#report-issue
|
||||
i.fa.fa-bug
|
||||
| Report a bug or typo in this challenge
|
||||
.button-spacer
|
||||
script(type="text/javascript").
|
||||
|
||||
var controlEnterHandler = function(e) {
|
||||
@ -74,4 +82,4 @@ block content
|
||||
script.
|
||||
var challenge_Id = !{JSON.stringify(challengeId)};
|
||||
var challenge_Name = !{JSON.stringify(name)};
|
||||
var challengeType = !{JSON.stringify(challengeType)};
|
||||
var challengeType = !{JSON.stringify(challengeType)};
|
||||
|
@ -24,6 +24,18 @@ block content
|
||||
br
|
||||
- if (user)
|
||||
a.btn.btn-primary.btn-lg.btn-block#completed-zipline-or-basejump I've completed this challenge (ctrl + enter)
|
||||
.button-spacer
|
||||
.btn-group.input-group.btn-group-justified
|
||||
label.btn.btn-success#i-want-help-editorless
|
||||
i.fa.fa-medkit
|
||||
| Help
|
||||
label.btn.btn-success#i-want-to-pair
|
||||
i.fa.fa-user-plus
|
||||
| Pair
|
||||
label.btn.btn-success#report-issue
|
||||
i.fa.fa-bug
|
||||
| Bug
|
||||
.button-spacer
|
||||
script.
|
||||
var userLoggedIn = true;
|
||||
- else
|
||||
|
Reference in New Issue
Block a user