diff --git a/controllers/resources.js b/controllers/resources.js index ff1205aa94..8a9fa041c1 100644 --- a/controllers/resources.js +++ b/controllers/resources.js @@ -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); - } }; diff --git a/public/js/main.js b/public/js/main.js index 3a3e6e4359..ef692b4d42 100644 --- a/public/js/main.js +++ b/public/js/main.js @@ -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( diff --git a/views/coursewares/showBonfire.jade b/views/coursewares/showBonfire.jade index a47ba56402..6fc6e0ed2b 100644 --- a/views/coursewares/showBonfire.jade +++ b/views/coursewares/showBonfire.jade @@ -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 diff --git a/views/coursewares/showHTML.jade b/views/coursewares/showHTML.jade index 05dd0cbaa9..ad9481e868 100644 --- a/views/coursewares/showHTML.jade +++ b/views/coursewares/showHTML.jade @@ -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 diff --git a/views/coursewares/showJS.jade b/views/coursewares/showJS.jade index f881f8f9cf..d7b914005e 100644 --- a/views/coursewares/showJS.jade +++ b/views/coursewares/showJS.jade @@ -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 diff --git a/views/coursewares/showVideo.jade b/views/coursewares/showVideo.jade index f61701be28..0bbb9ee6be 100644 --- a/views/coursewares/showVideo.jade +++ b/views/coursewares/showVideo.jade @@ -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)}; \ No newline at end of file + var challengeType = !{JSON.stringify(challengeType)}; diff --git a/views/coursewares/showZiplineOrBasejump.jade b/views/coursewares/showZiplineOrBasejump.jade index e9dda03e15..f18409c78d 100644 --- a/views/coursewares/showZiplineOrBasejump.jade +++ b/views/coursewares/showZiplineOrBasejump.jade @@ -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