worked on video challenge superblock

fixed rebase merge errors

Fix videos route

Fix hikes broken true/false

fixed component name
This commit is contained in:
Akira Laine
2016-02-02 21:00:48 +11:00
parent 0f15798550
commit a7bd7e3729
8 changed files with 18 additions and 9 deletions

View File

@ -37,7 +37,7 @@ export default contain(
componentWillMount() {
const { appActions } = this.props;
appActions.setTitle('Hikes');
appActions.setTitle('Videos');
},
renderMap(hikes) {

View File

@ -314,8 +314,8 @@ export default Actions({
location: {
action: 'PUSH',
pathname: currentHike && currentHike.dashedName ?
`/hikes/${ currentHike.dashedName }` :
'/hikes'
`/videos/${ currentHike.dashedName }` :
'/videos'
}
};
}

View File

@ -7,7 +7,7 @@ import Hike from './components/Hike.jsx';
*/
export default {
path: 'hikes',
path: 'videos',
component: Hikes,
childRoutes: [{
path: ':dashedName',

View File

@ -15,8 +15,8 @@ const debug = debugFactory('freecc:react-server');
const routes = [
'/jobs',
'/jobs/*',
'/hikes',
'/hikes/*'
'/videos',
'/videos/*'
];
const devRoutes = [];

View File

@ -223,6 +223,15 @@ function getSuperBlocks$(challenge$, completedChallenges) {
const isComingSoon = _.every(blockArray, 'isComingSoon');
const isRequired = _.every(blockArray, 'isRequired');
blockArray = blockArray.map(challenge => {
if (challenge.challengeType == 6 && challenge.type === 'hike') {
challenge.url = '/videos/' + challenge.dashedName;
} else {
challenge.url = '/challenges/' + challenge.dashedName;
}
return challenge;
});
return {
isBeta,
isComingSoon,

View File

@ -31,12 +31,12 @@ block content
for challenge in challengeBlock.challenges
if challenge.completed
p.challenge-title.faded.text-primary.ion-checkmark-circled.padded-ionic-icon.negative-15(name="#{challenge.dashedName}")
a(href="/challenges/#{challenge.dashedName}" target='_parent')
a(href="#{challenge.url}" target='_parent')
= challenge.title
span.sr-only= " Complete"
else if challenge.isRequired
p.challenge-title.ion-ios-circle-outline.padded-ionic-icon.negative-15(name="#{challenge.dashedName}")
a(name="#{challenge.dashedName}" target='_parent' href="/challenges/#{challenge.dashedName}" class=challenge.isComingSoon ? 'disabled' : '')
a(name="#{challenge.dashedName}" target='_parent' href="#{challenge.url}" class=challenge.isComingSoon ? 'disabled' : '')
span= challenge.title
span.sr-only= " Incomplete"
if challenge.markNew
@ -51,7 +51,7 @@ block content
strong *
else
p.challenge-title.ion-ios-circle-outline.padded-ionic-icon.negative-15(name="#{challenge.dashedName}")
a(name="#{challenge.dashedName}" target='_parent' href="/challenges/#{challenge.dashedName}" class=challenge.isComingSoon ? 'disabled' : '')
a(name="#{challenge.dashedName}" target='_parent' href="#{challenge.url}" class=challenge.isComingSoon ? 'disabled' : '')
span= challenge.title
span.sr-only= " Incomplete"
if challenge.markNew