Hiding some ThangTypes from view in level editor.
This commit is contained in:
parent
306f599673
commit
891b78eb44
3 changed files with 4 additions and 4 deletions
|
@ -33,7 +33,7 @@ module.exports = class AddThangsView extends CocoView
|
||||||
models = @supermodel.getModels(ThangType)
|
models = @supermodel.getModels(ThangType)
|
||||||
|
|
||||||
thangTypes = _.uniq models, false, (thangType) -> thangType.get('original')
|
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 = {}
|
groupMap = {}
|
||||||
for thangType in thangTypes
|
for thangType in thangTypes
|
||||||
kind = thangType.get('kind')
|
kind = thangType.get('kind')
|
||||||
|
|
|
@ -82,7 +82,7 @@ module.exports = class ThangsTabView extends CocoView
|
||||||
return context unless @supermodel.finished()
|
return context unless @supermodel.finished()
|
||||||
thangTypes = (thangType.attributes for thangType in @supermodel.getModels(ThangType))
|
thangTypes = (thangType.attributes for thangType in @supermodel.getModels(ThangType))
|
||||||
thangTypes = _.uniq thangTypes, false, 'original'
|
thangTypes = _.uniq thangTypes, false, 'original'
|
||||||
thangTypes = _.reject thangTypes, kind: 'Mark'
|
thangTypes = _.reject thangTypes, (tt) -> tt.kind in ['Mark', undefined]
|
||||||
groupMap = {}
|
groupMap = {}
|
||||||
for thangType in thangTypes
|
for thangType in thangTypes
|
||||||
groupMap[thangType.kind] ?= []
|
groupMap[thangType.kind] ?= []
|
||||||
|
|
|
@ -15,13 +15,13 @@ module.exports.setup = (app) ->
|
||||||
|
|
||||||
authentication.use(new LocalStrategy(
|
authentication.use(new LocalStrategy(
|
||||||
(username, password, done) ->
|
(username, password, done) ->
|
||||||
|
|
||||||
# kind of a hacky way to make it possible for iPads to 'log in' with their unique device id
|
# 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
|
if username.length is 36 and '@' not in username # must be an identifier for vendor
|
||||||
q = { iosIdentifierForVendor: username }
|
q = { iosIdentifierForVendor: username }
|
||||||
else
|
else
|
||||||
q = { emailLower: username.toLowerCase() }
|
q = { emailLower: username.toLowerCase() }
|
||||||
|
|
||||||
User.findOne(q).exec((err, user) ->
|
User.findOne(q).exec((err, user) ->
|
||||||
return done(err) if err
|
return done(err) if err
|
||||||
return done(null, false, {message: 'not found', property: 'email'}) if not user
|
return done(null, false, {message: 'not found', property: 'email'}) if not user
|
||||||
|
|
Reference in a new issue