mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-26 14:03:28 -04:00
Merge pull request #3380 from Zerrien/editorChanges
Style fixes and fixes level submission emails
This commit is contained in:
commit
7db678e63f
4 changed files with 40 additions and 64 deletions
app
templates/editor/level
views/editor/level
|
@ -6,7 +6,7 @@ block modal-header-content
|
|||
block modal-body-content
|
||||
p
|
||||
| Welcome to the Artisan Compendium. Below you will find a series of helpful guides and tutorials for getting your levels to Master Artisan quality
|
||||
if view.creator === view.meID
|
||||
if view.hasOwnership()
|
||||
|, as well as a way to submit your level for official Artisan review
|
||||
|! If you have any feedback on the Level Editor, please contact us at:
|
||||
a(href='mailto:artisans@codecombat.com') artisans@codecombat.com
|
||||
|
@ -16,8 +16,8 @@ block modal-body-content
|
|||
div
|
||||
a(href='https://github.com/codecombat/codecombat/wiki/Artisan-How-To-Index', target='_blank') Basic How-tos
|
||||
div
|
||||
a(href='http://direct.codecombat.com/community', target='_blank') Artisan Rankings
|
||||
if view.creator === view.meID
|
||||
a(href='http://www.codecombat.com/community', target='_blank') Artisan Rankings
|
||||
if view.hasOwnership()
|
||||
h4 Level Submission
|
||||
p
|
||||
| Do you want your level to be added to the campaign? Please take a moment to fill out the questions below! Don’t worry, this isn’t a timed quiz. It is just a way for the artisans at CodeCombat HQ to get a feel for the purpose of this level. If it doesn’t quite yet meet our standards for release we will give you feedback to help polish it further!
|
||||
|
@ -38,5 +38,5 @@ block modal-body-content
|
|||
block modal-footer-content
|
||||
div
|
||||
a(href='#', data-dismiss="modal", aria-hidden="true").btn Close
|
||||
if view.creator === view.meID
|
||||
if view.hasOwnership()
|
||||
button.btn.btn-primary#level-submit Submit
|
||||
|
|
|
@ -2,7 +2,6 @@ mixin task-row(cid)
|
|||
- var task = view.getTaskByCID(cid)
|
||||
- var taskName = task.get('name');
|
||||
- var isComplete = task.get('complete')
|
||||
- var taskLink = view.defaultTaskLinks[taskName]
|
||||
tr.task-row(data-task-cid=cid)
|
||||
td.task-check
|
||||
div.checkbox
|
||||
|
@ -15,11 +14,10 @@ mixin task-row(cid)
|
|||
td.edit-cell
|
||||
span.glyphicon.glyphicon-edit.start-edit
|
||||
td.task-name
|
||||
if taskLink
|
||||
if taskLink === './'
|
||||
a.no-article(href='https://github.com/codecombat/codecombat/wiki/Artisan-Home', target='blank')= taskName
|
||||
else
|
||||
a(href=taskLink, target='_blank')= taskName
|
||||
- var result = view.getTaskURL(taskName)
|
||||
if result !== null
|
||||
// https://github.com/codecombat/codecombat/wiki/Tasks-Tab#<slug goes here>
|
||||
a(href='https://github.com/codecombat/codecombat/wiki/Tasks-Tab#' + result, target='blank')= taskName
|
||||
else
|
||||
span= taskName
|
||||
|
||||
|
|
|
@ -25,16 +25,21 @@ module.exports = class ArtisanGuideModal extends ModalView
|
|||
|
||||
initialize: (options) ->
|
||||
@level = options.level
|
||||
@options = level: @level.get 'name'
|
||||
@creator = @level.get 'creator'
|
||||
@meID = me.id
|
||||
@options =
|
||||
level:@level.get('name')
|
||||
levelSlug:@level.get('slug')
|
||||
|
||||
levelSubmit: ->
|
||||
@playSound 'menu-button-click'
|
||||
forms.clearFormAlerts @$el
|
||||
contactMessage = forms.formToObject @$el
|
||||
res = tv4.validateMultiple contactMessage, contactSchema
|
||||
results = forms.formToObject @$el
|
||||
res = tv4.validateMultiple results, contactSchema
|
||||
return forms.applyErrorsToForm @$el, res.errors unless res.valid
|
||||
contactMessage = {message:"""User Name: #{results.creditName}
|
||||
Level: <a href="http://codecombat.com/editor/level/#{@options.levelSlug}">#{@options.level}</a>
|
||||
Purpose: #{results.levelPurpose}
|
||||
Inspiration: #{results.levelInspiration}
|
||||
Location: #{results.levelLocation}"""}
|
||||
@populateBrowserData contactMessage
|
||||
contactMessage = _.merge contactMessage, @options
|
||||
contactMessage.country = me.get('country')
|
||||
|
@ -46,3 +51,8 @@ module.exports = class ArtisanGuideModal extends ModalView
|
|||
context.browser = "#{$.browser.platform} #{$.browser.name} #{$.browser.versionNumber}"
|
||||
context.screenSize = "#{screen?.width ? $(window).width()} x #{screen?.height ? $(window).height()}"
|
||||
context.screenshotURL = @screenshotURL
|
||||
|
||||
hasOwnership: ->
|
||||
if @level.getOwner() is me.id
|
||||
return true
|
||||
return false
|
|
@ -18,44 +18,6 @@ module.exports = class TasksTabView extends CocoView
|
|||
subscriptions:
|
||||
'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: ->
|
||||
missingTasks = []
|
||||
if @level
|
||||
|
@ -98,7 +60,7 @@ module.exports = class TasksTabView extends CocoView
|
|||
@render()
|
||||
|
||||
focusEditInput: ->
|
||||
editInput = @$el.find('#cur-edit')[0]
|
||||
editInput = @$('#cur-edit')[0]
|
||||
if editInput
|
||||
editInput.focus()
|
||||
len = editInput.value.length * 2
|
||||
|
@ -115,6 +77,7 @@ module.exports = class TasksTabView extends CocoView
|
|||
|
||||
onLevelLoaded: (e) ->
|
||||
@level = e.level
|
||||
@defaultTasks = @level.schema().properties.tasks.default
|
||||
Task = Backbone.Model.extend({
|
||||
initialize: ->
|
||||
# We want to keep track of the revertAttributes easily without digging back into the level every time.
|
||||
|
@ -138,9 +101,9 @@ module.exports = class TasksTabView extends CocoView
|
|||
@level.set 'tasks', @taskMap()
|
||||
|
||||
onClickTaskRow: (e) ->
|
||||
if not @$el.find(e.target).is('input') and not @$el.find(e.target).is('a') and not @$el.find(e.target).hasClass('start-edit') and @$el.find('#cur-edit').length is 0
|
||||
task = @tasks.get @$el.find(e.target).closest('tr').data('task-cid')
|
||||
checkbox = @$el.find(e.currentTarget).find('.task-input')[0]
|
||||
if not $(e.target).is('input') and not $(e.target).is('a') and not $(e.target).hasClass('start-edit') and @$('#cur-edit').length is 0
|
||||
task = @tasks.get $(e.target).closest('tr').data('task-cid')
|
||||
checkbox = $(e.currentTarget).find('.task-input')[0]
|
||||
if task.get 'complete'
|
||||
task.set 'complete', false
|
||||
else
|
||||
|
@ -149,29 +112,29 @@ module.exports = class TasksTabView extends CocoView
|
|||
@pushTasks()
|
||||
|
||||
onClickTaskInput: (e) ->
|
||||
task = @tasks.get @$el.find(e.target).closest('tr').data('task-cid')
|
||||
task = @tasks.get $(e.target).closest('tr').data('task-cid')
|
||||
task.set 'complete', e.currentTarget.checked
|
||||
@pushTasks()
|
||||
|
||||
onClickStartEdit: (e) ->
|
||||
if @$el.find('#cur-edit').length is 0
|
||||
task = @tasks.get @$el.find(e.target).closest('tr').data('task-cid')
|
||||
if @$('#cur-edit').length is 0
|
||||
task = @tasks.get $(e.target).closest('tr').data('task-cid')
|
||||
task.set 'curEdit', true
|
||||
@render()
|
||||
@focusEditInput()
|
||||
|
||||
onKeyDownCurEdit: (e) ->
|
||||
if e.keyCode is 13
|
||||
editInput = @$el.find('#cur-edit')[0]
|
||||
editInput = @$('#cur-edit')[0]
|
||||
editInput.blur()
|
||||
|
||||
onBlurCurEdit: (e) ->
|
||||
editInput = @$el.find('#cur-edit')[0]
|
||||
task = @tasks.get @$el.find(e.target).closest('tr').data('task-cid')
|
||||
editInput = @$('#cur-edit')[0]
|
||||
task = @tasks.get $(e.target).closest('tr').data('task-cid')
|
||||
@applyTaskName(task, editInput)
|
||||
|
||||
onClickCreateTask: (e) ->
|
||||
if @$el.find('#cur-edit').length is 0
|
||||
if @$('#cur-edit').length is 0
|
||||
@tasks.add
|
||||
name: ''
|
||||
complete: false
|
||||
|
@ -181,3 +144,8 @@ module.exports = class TasksTabView extends CocoView
|
|||
complete: false
|
||||
@render()
|
||||
@focusEditInput()
|
||||
|
||||
getTaskURL: (_n) ->
|
||||
if _.find(@defaultTasks, {name:_n})?
|
||||
return _.string.slugify(_n)
|
||||
return null
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue