create pair, help, bug modals

This commit is contained in:
Quincy Larson
2015-05-28 14:29:45 -07:00
parent 81fb739794
commit 673a617151
8 changed files with 100 additions and 30 deletions

View File

@ -607,8 +607,8 @@ module.exports = {
var challenge = req.body.payload.challenge; var challenge = req.body.payload.challenge;
slack.send({ slack.send({
text: "*" + userName + "* wants help with " + challenge + ". " + text: "*@" + userName + "* wants help with " + challenge + ". " +
code + "Hey, *" + userName + "*, if no one helps you right " + code + "Hey, *@" + userName + "*, if no one helps you right " +
"away, try typing out your problem in detail to me. Like this: " + "away, try typing out your problem in detail to me. Like this: " +
"http://en.wikipedia.org/wiki/Rubber_duck_debugging", "http://en.wikipedia.org/wiki/Rubber_duck_debugging",
channel: '#help', channel: '#help',
@ -622,11 +622,11 @@ module.exports = {
var userName = req.user.profile.username; var userName = req.user.profile.username;
var challenge = req.body.payload.challenge; var challenge = req.body.payload.challenge;
slack.send({ slack.send({
text: "Anyone want to pair with @" + userName + " on " + challenge + text: "Anyone want to pair with *@" + userName + "* on " + challenge +
"?\nMake sure you install Screen Hero here:" + "?\nMake sure you install Screen Hero here: " +
"http://freecodecamp.com/field-guide/how-do-i-install-screenhero\n" + "http://freecodecamp.com/field-guide/how-do-i-install-screenhero\n" +
"Then start your pair program session with *" + userName + "Then start your pair program session with *" + userName +
"* by typing \"/hero @" + userName + "\" into Slack.\n And *"+ userName + "* by typing \"/hero @" + userName + "\" into Slack.\n And *@"+ userName +
"*, be sure to launch Screen Hero, then keep coding. " + "*, be sure to launch Screen Hero, then keep coding. " +
"Another camper may pair with you soon.", "Another camper may pair with you soon.",
channel: '#letspair', channel: '#letspair',

View File

@ -17,7 +17,7 @@ $(document).ready(function() {
setCSRFToken($('meta[name="csrf-token"]').attr('content')); setCSRFToken($('meta[name="csrf-token"]').attr('content'));
$('#i-want-help').on('click', function() { $('#i-want-help').on('click', function() {
/* $('#help-modal').modal('hide');
var editorValue = editor.getValue(); var editorValue = editor.getValue();
var currentLocation = window.location.href; var currentLocation = window.location.href;
$.post( $.post(
@ -34,11 +34,10 @@ $(document).ready(function() {
} }
} }
); );
*/
}); });
$('#i-want-help-editorless').on('click', function() { $('#i-want-help-editorless').on('click', function() {
/* $('#help-modal-editorless').modal('hide');
var currentLocation = window.location.href; var currentLocation = window.location.href;
$.post( $.post(
'/get-help', '/get-help',
@ -53,14 +52,15 @@ $(document).ready(function() {
} }
} }
); );
*/
}); });
$('#report-issue').on('click', function() { $('#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') $('#issue-modal').modal('hide');
window.open('https://github.com/freecodecamp/freecodecamp/issues/new?&body=Challenge '+ window.location.href +' has an issue. Please describe how to reproduce it, and include links to screen shots if possible.', '_blank')
}); });
$('#i-want-to-pair').on('click', function() { $('#i-want-to-pair').on('click', function() {
$('#pair-modal').modal('hide');
var currentLocation = window.location.href; var currentLocation = window.location.href;
$.post( $.post(
'/get-pair', '/get-pair',
@ -134,8 +134,20 @@ $(document).ready(function() {
$(this).unbind("error").attr("src", "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png"); $(this).unbind("error").attr("src", "https://s3.amazonaws.com/freecodecamp/camper-image-placeholder.png");
}); });
$('#completed-courseware').on('click', function() { $('#trigger-pair-modal').on('click', function() {
$('#complete-courseware-dialog').modal('show'); $('#pair-modal').modal('show');
});
$('#trigger-help-modal').on('click', function() {
$('#help-modal').modal('show');
});
$('#trigger-help-editorless-modal').on('click', function() {
$('#help-editorless-modal').modal('show');
});
$('#trigger-issue-modal').on('click', function() {
$('#issue-modal').modal('show');
}); });
$('#completed-zipline-or-basejump').on('click', function() { $('#completed-zipline-or-basejump').on('click', function() {

View File

@ -94,13 +94,13 @@ block content
if (user && user.sentSlackInvite) if (user && user.sentSlackInvite)
.button-spacer .button-spacer
.btn-group.input-group.btn-group-justified .btn-group.input-group.btn-group-justified
label.btn.btn-success#i-want-help(disabled) label.btn.btn-success#trigger-help-modal
i.fa.fa-medkit i.fa.fa-medkit
|   Help(disabled) |   Help
label.btn.btn-success#i-want-to-pair label.btn.btn-success#trigger-pair-modal
i.fa.fa-user-plus i.fa.fa-user-plus
|   Pair |   Pair
label.btn.btn-success#report-issue label.btn.btn-success#trigger-issue-modal
i.fa.fa-bug i.fa.fa-bug
|   Bug |   Bug
.button-spacer .button-spacer
@ -142,14 +142,15 @@ block content
- if (user.progressTimestamps.length > 2) - if (user.progressTimestamps.length > 2)
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript") a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank", href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/challenges/#{dashedName}&hashtags=LearnToCode, JavaScript")
i.fa.fa-twitter   i.fa.fa-twitter  
= phrase = phrase
- else - else
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
include ../partials/challenge-modals
script. script.
var MDNlinks = !{JSON.stringify(MDNlinks)}; var MDNlinks = !{JSON.stringify(MDNlinks)};
if (!MDNlinks.length) { if (!MDNlinks.length) {
$('#MDN-links').addClass('collapse'); $('#MDN-links').addClass('collapse');
} }

View File

@ -46,10 +46,10 @@ block content
if (user.sentSlackInvite) if (user.sentSlackInvite)
.button-spacer .button-spacer
.btn-group.input-group.btn-group-justified .btn-group.input-group.btn-group-justified
label.btn.btn-success#i-want-help(disabled) label.btn.btn-success#trigger-help-modal
i.fa.fa-medkit i.fa.fa-medkit
|   Help(disabled) |   Help(disabled)
label.btn.btn-success#report-issue label.btn.btn-success#trigger-issue-modal
i.fa.fa-bug i.fa.fa-bug
|   Bug |   Bug
.button-spacer .button-spacer
@ -92,3 +92,5 @@ block content
span.completion-icon.ion-checkmark-circled.text-primary span.completion-icon.ion-checkmark-circled.text-primary
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
script(src="/js/lib/coursewares/coursewaresHCJQFramework_0.1.3.js") script(src="/js/lib/coursewares/coursewaresHCJQFramework_0.1.3.js")
include ../partials/challenge-modals

View File

@ -38,13 +38,13 @@ block content
if (user && user.sentSlackInvite) if (user && user.sentSlackInvite)
.button-spacer .button-spacer
.btn-group.input-group.btn-group-justified .btn-group.input-group.btn-group-justified
label.btn.btn-success#i-want-help label.btn.btn-success#trigger-help-modal
i.fa.fa-medkit i.fa.fa-medkit
|   Help |   Help
label.btn.btn-success#i-want-to-pair label.btn.btn-success#trigger-pair-modal
i.fa.fa-user-plus i.fa.fa-user-plus
|   Pair |   Pair
label.btn.btn-success#report-issue label.btn.btn-success#trigger-issue-modal
i.fa.fa-bug i.fa.fa-bug
|   Bug |   Bug
.spacer .spacer
@ -85,3 +85,4 @@ block content
= phrase = phrase
- else - else
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
include ../partials/challenge-modals

View File

@ -23,10 +23,10 @@ block content
.button-spacer .button-spacer
if (user.sentSlackInvite) if (user.sentSlackInvite)
.btn-group.input-group.btn-group-justified .btn-group.input-group.btn-group-justified
.btn.btn-success.btn-big#i-want-help-editorless(disabled) .btn.btn-success.btn-big#trigger-help-editorless-modal
i.fa.fa-medkit i.fa.fa-medkit
|   Get help(disabled) |   Get help
.btn.btn-success.btn-big#report-issue .btn.btn-success.btn-big#trigger-issue-modal
i.fa.fa-bug i.fa.fa-bug
|   Report a bug |   Report a bug
.button-spacer .button-spacer
@ -84,3 +84,4 @@ block content
var challenge_Id = !{JSON.stringify(challengeId)}; var challenge_Id = !{JSON.stringify(challengeId)};
var challenge_Name = !{JSON.stringify(name)}; var challenge_Name = !{JSON.stringify(name)};
var challengeType = !{JSON.stringify(challengeType)}; var challengeType = !{JSON.stringify(challengeType)};
include ../partials/challenge-modals

View File

@ -21,13 +21,13 @@ block content
if (user.sentSlackInvite) if (user.sentSlackInvite)
.button-spacer .button-spacer
.btn-group.input-group.btn-group-justified .btn-group.input-group.btn-group-justified
.btn.btn-success.btn-big#i-want-help-editorless(disabled) .btn.btn-success.btn-big#trigger-help-editorless-modal
i.fa.fa-medkit i.fa.fa-medkit
|   Help(disabled) |   Help
.btn.btn-success.btn-big#i-want-to-pair .btn.btn-success.btn-big#trigger-pair-modal
i.fa.fa-user-plus i.fa.fa-user-plus
|   Pair |   Pair
.btn.btn-success.btn-big#report-issue .btn.btn-success.btn-big#trigger-issue-modal
i.fa.fa-bug i.fa.fa-bug
|   Bug |   Bug
.button-spacer .button-spacer
@ -101,3 +101,4 @@ block content
a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress a.animated.fadeIn.btn.btn-lg.signup-btn.btn-block(href='/login') Sign in so you can save your progress
script. script.
$('body').on('keypress', controlEnterHandler); $('body').on('keypress', controlEnterHandler);
include ../partials/challenge-modals

View File

@ -0,0 +1,52 @@
#pair-modal.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
.modal-header.challenge-list-header Ready to pair program?
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body.text-center
h3 This will create a pair programming request.
h3 You'll need  
a(href='/field-guide/how-do-i-install-screenhero' target='_blank') Screen Hero
| .
h3 Other campers may then message you about pair programming.
a.btn.btn-lg.btn-primary.btn-block#i-want-to-pair(name='_csrf', value=_csrf) Create my pair request
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
#issue-modal.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
.modal-header.challenge-list-header Did you find a bug?
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body.text-center
h3 This will open our GitHub Issues page.
h3 Please tell us how to reproduce the bug and link us to screen shots if possible.
a.btn.btn-lg.btn-primary.btn-block#report-issue(name='_csrf', value=_csrf) Create my GitHub issue
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
#help-modal.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
.modal-header.challenge-list-header Need some help?
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body.text-center
h3 Remember to use  
a('/field-guide/how-do-i-get-help-when-i-get-stuck') RSAP
| .
h3 If you've already read the errors and searched Google, you should ask for help.
h3 This will open a help request in our Help chat room.
a.btn.btn-lg.btn-primary.btn-block#i-want-help(name='_csrf', value=_csrf) Ask for help
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel
#help-editorless-modal.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
.modal-header.challenge-list-header Need some help?
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body.text-center
h3 Remember to use  
a('/field-guide/how-do-i-get-help-when-i-get-stuck') RSAP
| .
h3 If you've already read the errors and searched Google, you should ask for help.
h3 This will open a help request in our Help chat room.
a.btn.btn-lg.btn-primary.btn-block#i-want-help-editorless(name='_csrf', value=_csrf) Ask for help
a.btn.btn-lg.btn-info.btn-block(href='#', data-dismiss='modal', aria-hidden='true') Cancel