95 lines
4.1 KiB
Plaintext
95 lines
4.1 KiB
Plaintext
extends ../layout-wide
|
||
block content
|
||
include ../partials/flyer
|
||
.row
|
||
.col-xs-12.col-sm-12.col-md-4
|
||
h4.text-center.challenge-instructions-title= name
|
||
if (isCompleted)
|
||
|
|
||
i.ion-checkmark-circled.text-primary(title="Completed")
|
||
hr
|
||
ol
|
||
for step, index in description
|
||
.row.checklist-element(id="#{dashedName + index}")
|
||
.col-xs-2.col-sm-1.col-md-2.padded-ionic-icon.text-right
|
||
input(type='checkbox' class='challenge-list-checkbox')
|
||
.col-xs-10.col-sm-11.col-md-10
|
||
li.step-text.wrappable!= step
|
||
.col-xs-12.col-sm-12.col-md-8
|
||
.embed-responsive.embed-responsive-16by9
|
||
iframe.embed-responsive-item(src='//www.youtube.com/embed/#{video}?rel=0&showinfo=0')
|
||
.spacer
|
||
if (user)
|
||
a.btn.btn-primary.btn-big.btn-block#completed-courseware-editorless I've completed this challenge (ctrl + enter)
|
||
else
|
||
a.btn.btn-big.btn-primary.btn-block(href='/challenges/next-challenge?id=' + id) I've completed this challenge (ctrl + enter)
|
||
script.
|
||
var userLoggedIn = true;
|
||
.button-spacer
|
||
.btn-group.input-group.btn-group-justified
|
||
.btn.btn-primary.btn-big#challenge-help-btn Get help
|
||
.btn.btn-primary.btn-big#trigger-issue-modal Report a bug
|
||
if (!user)
|
||
.button-spacer
|
||
a.btn.btn-big.signup-btn.btn-block(href='/signin') Sign in so you can save your progress
|
||
script.
|
||
var userLoggedIn = false;
|
||
br
|
||
|
||
script(type="text/javascript").
|
||
|
||
#complete-courseware-editorless-dialog.modal(tabindex='-1')
|
||
.modal-dialog.animated.fadeIn.fast-animation
|
||
.modal-content
|
||
.modal-header.challenge-list-header= compliment
|
||
a.close.closing-x(href='#', data-dismiss='modal', aria-hidden='true') ×
|
||
.modal-body
|
||
.text-center
|
||
.animated.zoomInDown
|
||
span.completion-icon.ion-checkmark-circled.text-primary
|
||
if (user)
|
||
a.btn.btn-lg.btn-primary.btn-block#next-courseware-button(name='_csrf', value=_csrf) I've completed this challenge (ctrl + enter)
|
||
else
|
||
a.animated.fadeIn.btn.btn-lg.btn-primary.btn-block(href='/challenges/next-challenge?id=' + id) I've completed this challenge (ctrl + enter)
|
||
|
||
include ../partials/challenge-modals
|
||
script.
|
||
var common = window.common || { init: [] };
|
||
|
||
common.challengeId = !{JSON.stringify(id)};
|
||
common.challengeName = !{JSON.stringify(name)};
|
||
common.challengeType = !{JSON.stringify(challengeType)};
|
||
common.dashedName = !{JSON.stringify(dashedName)};
|
||
common.gaName = !{JSON.stringify(gaName)};
|
||
common.init.push(function($) {
|
||
function controlEnterHandler(e) {
|
||
if (
|
||
e.keyCode === 13 &&
|
||
(e.ctrlKey || e.metaKey)
|
||
) {
|
||
$('body').unbind('keydown');
|
||
$('#complete-courseware-editorless-dialog').modal('show');
|
||
}
|
||
};
|
||
|
||
function modalControlEnterHandler(e) {
|
||
if (
|
||
e.keyCode === 13 &&
|
||
(e.ctrlKey || e.metaKey)
|
||
) {
|
||
$('#complete-courseware-editorless-dialog').unbind('keydown');
|
||
$('#next-courseware-button').click();
|
||
}
|
||
};
|
||
if (!{JSON.stringify(user && user.username ? true : false)}) {
|
||
$('#complete-courseware-editorless-dialog').bind('keydown', modalControlEnterHandler);
|
||
}
|
||
$('body').bind('keydown', controlEnterHandler);
|
||
|
||
$('#completed-courseware-editorless').on('click', function() {
|
||
$('#complete-courseware-editorless-dialog').modal('show');
|
||
});
|
||
});
|
||
|
||
include ../partials/challenge-footer
|