Fixes level ownership check
This commit is contained in:
parent
bd825d3108
commit
4a2d5c2e59
2 changed files with 9 additions and 5 deletions
app
templates/editor/level/modal
views/editor/level/modals
|
@ -6,7 +6,7 @@ block modal-header-content
|
||||||
block modal-body-content
|
block modal-body-content
|
||||||
p
|
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
|
| 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
|
|, 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:
|
|! If you have any feedback on the Level Editor, please contact us at:
|
||||||
a(href='mailto:artisans@codecombat.com') artisans@codecombat.com
|
a(href='mailto:artisans@codecombat.com') artisans@codecombat.com
|
||||||
|
@ -17,7 +17,7 @@ block modal-body-content
|
||||||
a(href='https://github.com/codecombat/codecombat/wiki/Artisan-How-To-Index', target='_blank') Basic How-tos
|
a(href='https://github.com/codecombat/codecombat/wiki/Artisan-How-To-Index', target='_blank') Basic How-tos
|
||||||
div
|
div
|
||||||
a(href='http://direct.codecombat.com/community', target='_blank') Artisan Rankings
|
a(href='http://direct.codecombat.com/community', target='_blank') Artisan Rankings
|
||||||
if view.creator === view.meID
|
if view.hasOwnership()
|
||||||
h4 Level Submission
|
h4 Level Submission
|
||||||
p
|
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!
|
| 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
|
block modal-footer-content
|
||||||
div
|
div
|
||||||
a(href='#', data-dismiss="modal", aria-hidden="true").btn Close
|
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
|
button.btn.btn-primary#level-submit Submit
|
||||||
|
|
|
@ -28,8 +28,6 @@ module.exports = class ArtisanGuideModal extends ModalView
|
||||||
@options =
|
@options =
|
||||||
level:@level.get('name')
|
level:@level.get('name')
|
||||||
levelSlug:@level.get('slug')
|
levelSlug:@level.get('slug')
|
||||||
@creator = @level.get 'creator'
|
|
||||||
@meID = me.id
|
|
||||||
|
|
||||||
levelSubmit: ->
|
levelSubmit: ->
|
||||||
@playSound 'menu-button-click'
|
@playSound 'menu-button-click'
|
||||||
|
@ -53,3 +51,9 @@ module.exports = class ArtisanGuideModal extends ModalView
|
||||||
context.browser = "#{$.browser.platform} #{$.browser.name} #{$.browser.versionNumber}"
|
context.browser = "#{$.browser.platform} #{$.browser.name} #{$.browser.versionNumber}"
|
||||||
context.screenSize = "#{screen?.width ? $(window).width()} x #{screen?.height ? $(window).height()}"
|
context.screenSize = "#{screen?.width ? $(window).width()} x #{screen?.height ? $(window).height()}"
|
||||||
context.screenshotURL = @screenshotURL
|
context.screenshotURL = @screenshotURL
|
||||||
|
|
||||||
|
hasOwnership: ->
|
||||||
|
for permObj in @level.get('permissions')
|
||||||
|
if permObj.target is me.id and permObj.access is 'owner'
|
||||||
|
return true
|
||||||
|
return false
|
Reference in a new issue