Creates clickable links for default tasks
This commit is contained in:
parent
7b5b4ca898
commit
0eb32aac24
2 changed files with 10 additions and 44 deletions
app
|
@ -2,7 +2,6 @@ mixin task-row(cid)
|
||||||
- var task = view.getTaskByCID(cid)
|
- var task = view.getTaskByCID(cid)
|
||||||
- var taskName = task.get('name');
|
- var taskName = task.get('name');
|
||||||
- var isComplete = task.get('complete')
|
- var isComplete = task.get('complete')
|
||||||
- var taskLink = view.defaultTaskLinks[taskName]
|
|
||||||
tr.task-row(data-task-cid=cid)
|
tr.task-row(data-task-cid=cid)
|
||||||
td.task-check
|
td.task-check
|
||||||
div.checkbox
|
div.checkbox
|
||||||
|
@ -15,11 +14,10 @@ mixin task-row(cid)
|
||||||
td.edit-cell
|
td.edit-cell
|
||||||
span.glyphicon.glyphicon-edit.start-edit
|
span.glyphicon.glyphicon-edit.start-edit
|
||||||
td.task-name
|
td.task-name
|
||||||
if taskLink
|
- var result = view.getTaskURL(taskName)
|
||||||
if taskLink === './'
|
if result !== null
|
||||||
a.no-article(href='https://github.com/codecombat/codecombat/wiki/Artisan-Home', target='blank')= taskName
|
// https://github.com/codecombat/codecombat/wiki/Tasks-Tab#<slug goes here>
|
||||||
else
|
a(href='https://github.com/codecombat/codecombat/wiki/Tasks-Tab#' + result, target='blank')= taskName
|
||||||
a(href=taskLink, target='_blank')= taskName
|
|
||||||
else
|
else
|
||||||
span= taskName
|
span= taskName
|
||||||
|
|
||||||
|
|
|
@ -18,44 +18,6 @@ module.exports = class TasksTabView extends CocoView
|
||||||
subscriptions:
|
subscriptions:
|
||||||
'editor:level-loaded': 'onLevelLoaded'
|
'editor:level-loaded': 'onLevelLoaded'
|
||||||
|
|
||||||
defaultTaskLinks:
|
|
||||||
# Order doesn't matter.
|
|
||||||
'Name the level.':'./'
|
|
||||||
'Create a Referee stub, if needed.':'./'
|
|
||||||
'Build the level.':'./'
|
|
||||||
'Set up goals.':'./'
|
|
||||||
'Choose the Existence System lifespan and frame rate.':'./'
|
|
||||||
'Choose the UI System paths and coordinate hover if needed.':'./'
|
|
||||||
'Choose the AI System pathfinding and Vision System line of sight.':'./'
|
|
||||||
'Write the sample code.':'./'
|
|
||||||
'Do basic set decoration.':'./'
|
|
||||||
'Adjust script camera bounds.':'./'
|
|
||||||
'Choose music file in Introduction script.':'./'
|
|
||||||
'Choose autoplay in Introduction script.':'./'
|
|
||||||
'Add to a campaign.':'./'
|
|
||||||
'Publish.':'./'
|
|
||||||
'Choose level options like required/restricted gear.':'./'
|
|
||||||
'Create achievements, including unlocking next level.':'./'
|
|
||||||
'Choose leaderboard score types.':'./'
|
|
||||||
'Playtest with a slow/tough hero.':'./'
|
|
||||||
'Playtest with a fast/weak hero.':'./'
|
|
||||||
'Playtest with a couple random seeds.':'./'
|
|
||||||
'Make sure the level ends promptly on success and failure.':'./'
|
|
||||||
'Remove/simplify unnecessary doodad collision.':'./'
|
|
||||||
'Release to adventurers via MailChimp.':'./'
|
|
||||||
'Write the description.':'./'
|
|
||||||
'Add i18n field for the sample code comments.':'./'
|
|
||||||
'Add Clojure/Lua/CoffeeScript.':'./'
|
|
||||||
'Write the guide.':'./'
|
|
||||||
'Write a loading tip, if needed.':'./'
|
|
||||||
'Click the Populate i18n button.':'./'
|
|
||||||
'Add programming concepts covered.':'./'
|
|
||||||
'Mark whether it requires a subscription.':'./'
|
|
||||||
'Release to everyone via MailChimp.':'./'
|
|
||||||
'Check completion/engagement/problem analytics.':'./'
|
|
||||||
'Do thorough set decoration.':'./'
|
|
||||||
'Add a walkthrough video.':'./'
|
|
||||||
|
|
||||||
missingDefaults: ->
|
missingDefaults: ->
|
||||||
missingTasks = []
|
missingTasks = []
|
||||||
if @level
|
if @level
|
||||||
|
@ -115,6 +77,7 @@ module.exports = class TasksTabView extends CocoView
|
||||||
|
|
||||||
onLevelLoaded: (e) ->
|
onLevelLoaded: (e) ->
|
||||||
@level = e.level
|
@level = e.level
|
||||||
|
@defaultTasks = @level.schema().properties.tasks.default
|
||||||
Task = Backbone.Model.extend({
|
Task = Backbone.Model.extend({
|
||||||
initialize: ->
|
initialize: ->
|
||||||
# We want to keep track of the revertAttributes easily without digging back into the level every time.
|
# We want to keep track of the revertAttributes easily without digging back into the level every time.
|
||||||
|
@ -181,3 +144,8 @@ module.exports = class TasksTabView extends CocoView
|
||||||
complete: false
|
complete: false
|
||||||
@render()
|
@render()
|
||||||
@focusEditInput()
|
@focusEditInput()
|
||||||
|
|
||||||
|
getTaskURL: (_n) ->
|
||||||
|
if _.find(@defaultTasks, {name:_n})?
|
||||||
|
return _.string.slugify(_n)
|
||||||
|
return null
|
||||||
|
|
Reference in a new issue