Hiding some ThangTypes from view in level editor.

This commit is contained in:
Nick Winter 2014-11-29 10:34:04 -08:00
parent 306f599673
commit 891b78eb44
3 changed files with 4 additions and 4 deletions
app/views/editor/level/thangs
server/routes

View file

@ -33,7 +33,7 @@ module.exports = class AddThangsView extends CocoView
models = @supermodel.getModels(ThangType)
thangTypes = _.uniq models, false, (thangType) -> thangType.get('original')
thangTypes = _.reject thangTypes, (thangType) -> thangType.get('kind') in ['Mark', 'Item']
thangTypes = _.reject thangTypes, (thangType) -> thangType.get('kind') in ['Mark', 'Item', undefined]
groupMap = {}
for thangType in thangTypes
kind = thangType.get('kind')

View file

@ -82,7 +82,7 @@ module.exports = class ThangsTabView extends CocoView
return context unless @supermodel.finished()
thangTypes = (thangType.attributes for thangType in @supermodel.getModels(ThangType))
thangTypes = _.uniq thangTypes, false, 'original'
thangTypes = _.reject thangTypes, kind: 'Mark'
thangTypes = _.reject thangTypes, (tt) -> tt.kind in ['Mark', undefined]
groupMap = {}
for thangType in thangTypes
groupMap[thangType.kind] ?= []

View file

@ -15,13 +15,13 @@ module.exports.setup = (app) ->
authentication.use(new LocalStrategy(
(username, password, done) ->
# kind of a hacky way to make it possible for iPads to 'log in' with their unique device id
if username.length is 36 and '@' not in username # must be an identifier for vendor
q = { iosIdentifierForVendor: username }
else
q = { emailLower: username.toLowerCase() }
User.findOne(q).exec((err, user) ->
return done(err) if err
return done(null, false, {message: 'not found', property: 'email'}) if not user