Merge branch 'ux-improvements' of https://github.com/FreeCodeCamp/freecodecamp into ux-improvements

This commit is contained in:
Michael Q Larson
2015-02-22 18:16:42 -08:00
4 changed files with 43 additions and 21 deletions

View File

@@ -44,12 +44,12 @@ exports.returnNextCourseware = function(req, res) {
if (err) {
next(err);
}
debug('This is the courseware object returned from mongo', courseware);
courseware = courseware.pop();
if (courseware === undefined) {
req.flash('errors', {
msg: "It looks like you've completed all the courses we have available. Good job!"
})
});
return res.redirect('../coursewares/start-our-challenges');
}
nameString = courseware.name.toLowerCase().replace(/\s/g, '-');

View File

@@ -66,7 +66,7 @@ $(document).ready(function() {
completedBonfire(didCompleteWith, bonfireSolution, thisBonfireHash);
});
$('#completed-courseware').on('click', function() {
$('#complete-courseware').on('click', function() {
$('#complete-courseware-dialog').modal('show');
});

View File

@@ -45,7 +45,7 @@ block content
.btn.btn-info#showAllCoursewares
- if (cc)
a.btn.btn-primary.btn-lg.btn-block#next-courseware-button
a.btn.btn-primary.btn-lg.btn-block#complete-courseware
| Go to my next challenge
br
| (ctrl + enter)
@@ -68,29 +68,40 @@ block content
var challengeName = !{JSON.stringify(name)};
var prodOrDev = !{JSON.stringify(environment)};
var started = Math.floor(Date.now() / 1000);
var url = '';
var dashed = !{JSON.stringify(dashedName)};
console.log(dashed);
.col-xs-12.col-sm-12.col-md-5.col-lg-6
#mainEditorPanel
form.code
.form-group.codeMirrorView
textarea#codeEditor(autofocus=true)
script(src='/js/lib/coursewares/coursewaresHCJQFramework_v0.1.1.js')
.col-md-4.col-lg-3
.hidden-xs.hidden-sm
img.iphone-position(src="https://s3.amazonaws.com/freecodecamp/iphone6-frame.png")
iframe.iphone#preview
#complete-courseware-dialog.modal(tabindex='-1')
.modal-dialog.animated.zoomIn.fast-animation
.modal-content
.modal-header.challenge-list-header
= compliment
.modal-header.challenge-list-header= compliment
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
.text-center
.animated.zoomInDown.delay-half
span.completion-icon.ion-checkmark-circled.text-primary
- if (cc)
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid && existingUser.length > 0') Go to my next challenge (ctrl + enter)
- if (points && points > 2)
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(target="_blank")
i.fa.fa-twitter  
= phrase
- else
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_v0.1.1.js")
#all-coursewares-dialog.modal(tabindex='-1')
.modal-dialog.animated.fadeInUp.fast-animation
@@ -99,3 +110,14 @@ block content
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
.modal-body
include ../partials/coursewares
script.
$.ajax({
url: 'https://api-ssl.bitly.com/v3/shorten?access_token=75e7931a19befaafcf108021b6d597e554b2c5c3&longUrl=http%3A%2F%2Ffreecodecamp.com%2Fchallenges%2F' + dashed + '&format=txt'
})
.success(
function(data) {
console.log(data);
url = "https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Challenge:%20#{name}&url=" + data + "&hashtags=LearnToCode, JavaScript";
$('.btn-twitter').attr('href', url);
}
);

View File

@@ -13,7 +13,7 @@ block content
iframe.embed-responsive-item(src='//player.vimeo.com/video/#{video}')
br
- if (cc)
a.btn.btn-primary.btn-lg.btn-block#next-courseware-button Go to my next challenge (ctrl + enter)
a.btn.btn-primary.btn-lg.btn-block#completed-courseware I've completed this challenge (ctrl + enter)
script.
var userLoggedIn = true;
- else
@@ -36,7 +36,7 @@ block content
.animated.zoomInDown.delay-half
span.completion-icon.ion-checkmark-circled.text-primary
- if (cc)
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block.next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid && existingUser.length > 0') Go to my next challenge (ctrl + enter)
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf, ng-disabled='completedWithForm.$invalid && existingUser.length > 0') Go to my next challenge (ctrl + enter)
- if (points && points > 2)
a.animated.fadeIn.btn.btn-lg.btn-block.btn-twitter(href="https://twitter.com/intent/tweet?text=I%20just%20#{verb}%20%40FreeCodeCamp%20Bonfire:%20#{name}&url=http%3A%2F%2Ffreecodecamp.com/bonfires/#{dashedName}&hashtags=LearnToCode, JavaScript" target="_blank")
i.fa.fa-twitter