diff --git a/app/templates/editor/level/component/new.jade b/app/templates/editor/level/component/new.jade index 6af6f987c..139ecb616 100644 --- a/app/templates/editor/level/component/new.jade +++ b/app/templates/editor/level/component/new.jade @@ -7,7 +7,10 @@ block modal-body-content form.form .form-group label(for="level-component-system", data-i18n="editor.new_component_field_system").control-label System - input.form-control#level-component-system(name="system", type="text") + select.form-control#level-component-system(name='system') + for system in systems + option(value=system)= system + //input.form-control#level-component-system(name="system", type="text") .form-group label(for="level-component-name", data-i18n="general.name").control-label Name input.form-control#level-component-name(name="name", type="text") diff --git a/app/templates/editor/level/components_tab.jade b/app/templates/editor/level/components_tab.jade index d457ade2a..235cb9f71 100644 --- a/app/templates/editor/level/components_tab.jade +++ b/app/templates/editor/level/components_tab.jade @@ -6,7 +6,7 @@ #components-treema.nano-content .edit-component-container - if me.isAdmin() + if !me.get('anonymous') button.btn.btn-primary#create-new-component-button-no-select span.icon-plus span.text(data-i18n="editor.level_component_btn_new") Create New Component diff --git a/app/views/editor/level/component/new.coffee b/app/views/editor/level/component/new.coffee index 072a69df6..a1f2985ce 100644 --- a/app/views/editor/level/component/new.coffee +++ b/app/views/editor/level/component/new.coffee @@ -13,7 +13,12 @@ module.exports = class LevelComponentNewView extends View events: 'click #new-level-component-submit': 'makeNewLevelComponent' 'submit form': 'makeNewLevelComponent' - + + getRenderData: -> + c = super() + c.systems = LevelComponent.schema.properties.system.enum + c + makeNewLevelComponent: (e) -> e.preventDefault() system = @$el.find('#level-component-system').val() diff --git a/server/levels/components/level_component_handler.coffee b/server/levels/components/level_component_handler.coffee index 889619d8d..0dd44ec4a 100644 --- a/server/levels/components/level_component_handler.coffee +++ b/server/levels/components/level_component_handler.coffee @@ -21,8 +21,4 @@ LevelComponentHandler = class LevelComponentHandler extends Handler props.push('official') if req.user?.isAdmin() props - hasAccess: (req) -> - req.method in ['GET', 'PUT'] or req.user?.isAdmin() - - module.exports = new LevelComponentHandler()