Show long/short form instructions based on user input

This commit is contained in:
Nathan Leniz
2015-01-24 20:49:59 -05:00
parent 966eb3d073
commit 3c3dc803c5
4 changed files with 38 additions and 9 deletions

View File

@ -77,7 +77,8 @@ exports.returnBonfire = function(req, res, next) {
name: bonfire[bonfireNumber].name, name: bonfire[bonfireNumber].name,
number: bonfire[bonfireNumber].bonfireNumber, number: bonfire[bonfireNumber].bonfireNumber,
difficulty: bonfire[bonfireNumber].difficulty, difficulty: bonfire[bonfireNumber].difficulty,
description: bonfire[bonfireNumber].description, brief: bonfire[bonfireNumber].description[0],
details: bonfire[bonfireNumber].description.slice(1),
tests: bonfire[bonfireNumber].tests, tests: bonfire[bonfireNumber].tests,
challengeSeed: bonfire[bonfireNumber].challengeSeed, challengeSeed: bonfire[bonfireNumber].challengeSeed,
challengeEntryPoint: bonfire[bonfireNumber].challengeEntryPoint, challengeEntryPoint: bonfire[bonfireNumber].challengeEntryPoint,
@ -131,7 +132,8 @@ exports.returnIndividualBonfire = function(req, res, next) {
name: bonfire[bonfireNumber].name, name: bonfire[bonfireNumber].name,
number: bonfire[bonfireNumber].bonfireNumber, number: bonfire[bonfireNumber].bonfireNumber,
difficulty: bonfire[bonfireNumber].difficulty, difficulty: bonfire[bonfireNumber].difficulty,
description: bonfire[bonfireNumber].description, brief: bonfire[bonfireNumber].description[0],
details: bonfire[bonfireNumber].description.slice(1),
tests: bonfire[bonfireNumber].tests, tests: bonfire[bonfireNumber].tests,
challengeSeed: bonfire[bonfireNumber].challengeSeed, challengeSeed: bonfire[bonfireNumber].challengeSeed,
challengeEntryPoint: bonfire[bonfireNumber].challengeEntryPoint, challengeEntryPoint: bonfire[bonfireNumber].challengeEntryPoint,

View File

@ -205,6 +205,11 @@ ul {
animation-duration: 0.5s; animation-duration: 0.5s;
} }
.slow-animation {
-webkit-animation-duration: 1.5s;
animation-duration: 1.5s;
}
.disabled { .disabled {
pointer-events: none; pointer-events: none;
cursor: default; cursor: default;
@ -569,11 +574,8 @@ div.CodeMirror-scroll {
text-size: 250px; text-size: 250px;
} }
.bonfire-instructions p {
padding: 0;
}
.bonfire-instructions { .bonfire-instructions {
margin-bottom: 2px; margin-bottom: 5px;
} }
//uncomment this to see the dimensions of all elements outlined in red //uncomment this to see the dimensions of all elements outlined in red

View File

@ -77,6 +77,17 @@ $(document).ready(function() {
l = location.pathname.split('/'); l = location.pathname.split('/');
window.location = '/bonfires/' + (parseInt(l[l.length - 1]) + 1); window.location = '/bonfires/' + (parseInt(l[l.length - 1]) + 1);
}); });
// Bonfire instructions functions
$('#more-info').on('click', function() {
$('#brief-instructions').hide();
$('#long-instructions').show().removeClass('hide');
});
$('#less-info').on('click', function() {
$('#brief-instructions').show();
$('#long-instructions').hide();
});
}); });
var profileValidation = angular.module('profileValidation',['ui.bootstrap']); var profileValidation = angular.module('profileValidation',['ui.bootstrap']);

View File

@ -23,9 +23,23 @@ block content
.panel-heading.text-center #{name} (Level #{difficulty} bonfire) .panel-heading.text-center #{name} (Level #{difficulty} bonfire)
.panel.panel-body .panel.panel-body
.well .well
.text-left.bonfire-instructions .row.text-center
for sentence in description row.text-center
p.bonfire-instructions!= sentence .col-xs-12
.bonfire-instructions
= brief
#brief-instructions.col-xs-12
button#more-info.btn.btn-info
span.ion-help-circled
| More information
#long-instructions.row.text-center.hide
.col-xs-12
.bonfire-instructions
for sentence in details
p!= sentence
button#less-info.btn.btn-info
span.ion-help-circled
| Less information
form.code form.code
.form-group.codeMirrorView .form-group.codeMirrorView
textarea#codeEditor(autofocus=true) textarea#codeEditor(autofocus=true)