add challenge type to beginning of challenge in map

This commit is contained in:
Quincy Larson
2015-08-18 15:21:26 -07:00
parent b667a776ea
commit b4ae49f915
3 changed files with 12 additions and 4 deletions

View File

@ -262,6 +262,10 @@ ul {
font-size: 24px; font-size: 24px;
} }
.capitalize {
text-transform: capitalize;
}
.text-success { .text-success {
color: @brand-success; color: @brand-success;
} }

View File

@ -21,7 +21,7 @@ const debug = debugFactory('freecc:challenges');
const challengeMapWithNames = utils.getChallengeMapWithNames(); const challengeMapWithNames = utils.getChallengeMapWithNames();
const challengeMapWithIds = utils.getChallengeMapWithIds(); const challengeMapWithIds = utils.getChallengeMapWithIds();
const challengeMapWithDashedNames = utils.getChallengeMapWithDashedNames(); const challengeMapWithDashedNames = utils.getChallengeMapWithDashedNames();
const challangesRegex = /^(bonfire|waypoint|zipline|basejump)/i; const challengesRegex = /^(bonfire|waypoint|zipline|basejump)/i;
const firstChallenge = 'waypoint-say-hello-to-html-elements'; const firstChallenge = 'waypoint-say-hello-to-html-elements';
const dasherize = utils.dasherize; const dasherize = utils.dasherize;
@ -232,7 +232,7 @@ module.exports = function(app) {
var origChallengeName = req.params.challengeName; var origChallengeName = req.params.challengeName;
var unDashedName = unDasherize(origChallengeName); var unDashedName = unDasherize(origChallengeName);
var challengeName = challangesRegex.test(unDashedName) ? var challengeName = challengesRegex.test(unDashedName) ?
// remove first word if matches // remove first word if matches
unDashedName.split(' ').slice(1).join(' ') : unDashedName.split(' ').slice(1).join(' ') :
unDashedName; unDashedName;

View File

@ -85,7 +85,9 @@ block content
.hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.large-p.negative-10 .hidden-xs.col-sm-3.col-md-2.text-primary.ion-checkmark-circled.padded-ionic-icon.text-center.large-p.negative-10
.col-xs-12.col-sm-9.col-md-10 .col-xs-12.col-sm-9.col-md-10
li.faded.large-p.negative-10 li.faded.large-p.negative-10
a(href="/challenges/#{challenge.dashedName}")= challenge.title a(href="/challenges/#{challenge.dashedName}")
span.capitalize= challenge.type + ': '
span= challenge.title
else else
.row .row
@ -93,7 +95,9 @@ block content
span.negative-10 span.negative-10
.col-xs-12.col-sm-9.col-md-10 .col-xs-12.col-sm-9.col-md-10
li.large-p.negative-10 li.large-p.negative-10
a(href="/challenges/#{challenge.dashedName}")= challenge.title a(href="/challenges/#{challenge.dashedName}")
span.capitalize= challenge.type + ': '
span= challenge.title
//#announcementModal.modal(tabindex='-1') //#announcementModal.modal(tabindex='-1')
// .modal-dialog.animated.fadeInUp.fast-animation // .modal-dialog.animated.fadeInUp.fast-animation