Implements a 'releasedOn' flag and marks challenges less than 30 days old as NEW https://www.dropbox.com/s/43un2a908ldktpl/Screenshot%202015-11-01%2017.06.53.png
This commit is contained in:
@ -86,6 +86,9 @@
|
|||||||
"solutions": {
|
"solutions": {
|
||||||
"type": "array",
|
"type": "array",
|
||||||
"default": []
|
"default": []
|
||||||
|
},
|
||||||
|
"releasedOn": {
|
||||||
|
"type": "string"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"validations": [],
|
"validations": [],
|
||||||
|
@ -537,6 +537,11 @@ module.exports = function(app) {
|
|||||||
if (completedChallenges.indexOf(challenge.id) !== -1) {
|
if (completedChallenges.indexOf(challenge.id) !== -1) {
|
||||||
challenge.completed = true;
|
challenge.completed = true;
|
||||||
}
|
}
|
||||||
|
if (typeof(challenge.releasedOn) !== 'undefined'
|
||||||
|
&& moment(challenge.releasedOn, 'MMM MMMM DD, YYYY').diff(moment(),
|
||||||
|
'days') >= -30) {
|
||||||
|
challenge.markNew = true;
|
||||||
|
}
|
||||||
return challenge;
|
return challenge;
|
||||||
})
|
})
|
||||||
// group challenges by block | returns a stream of observables
|
// group challenges by block | returns a stream of observables
|
||||||
|
@ -129,6 +129,10 @@ block content
|
|||||||
span.capitalize= challenge.type + ': '
|
span.capitalize= challenge.type + ': '
|
||||||
span= challenge.title
|
span= challenge.title
|
||||||
span.sr-only= " Incomplete"
|
span.sr-only= " Incomplete"
|
||||||
|
if challenge.markNew
|
||||||
|
span.text-danger.small    
|
||||||
|
strong
|
||||||
|
em NEW
|
||||||
|
|
||||||
if (challengeBlock.completed === 100)
|
if (challengeBlock.completed === 100)
|
||||||
.button-spacer
|
.button-spacer
|
||||||
|
Reference in New Issue
Block a user