Got repeatables working flawlessly and improved the achievement popup by a great deal

This commit is contained in:
Ruben Vereecken 2014-05-31 23:19:55 +02:00
parent 2c04025a5a
commit 5aa211cabd
6 changed files with 18 additions and 5 deletions

View file

@ -57,12 +57,17 @@ _.extend(AchievementSchema.properties,
type: 'object'
properties:
a: {type: 'number', default: 1},
required: ['a']
description: 'f(x) = a * x'
logarithmic:
type:'object'
properties:
a: {type: 'number', default: 1}
b: {type: 'number', default: 1}
required: ['a', 'b']
description: 'f(x) = a * ln(1/b * (x + b))'
]
default: linear: a: 1
)
AchievementSchema.definitions = {}

View file

@ -127,6 +127,4 @@ c.definitions =
lastSent: c.date()
count: {type: 'integer'}
UserSchema.additionalProperties = true # TODO Ruben seriously remove this
module.exports = UserSchema

View file

@ -45,3 +45,6 @@
font-family: Bangers
font-size: 16px
float: right
.progress-bar-white
background-color: white

View file

@ -46,6 +46,7 @@ module.exports = class AchievementEditView extends View
@treema = @$el.find('#achievement-treema').treema(options)
@treema.build()
console.log @treema
pushChangesToPreview: =>
'TODO' # TODO might want some intrinsic preview thing

View file

@ -8,6 +8,13 @@ module.exports = class AchievementSearchView extends SearchView
tableTemplate: require 'templates/editor/achievement/table'
projection: ['name', 'description', 'collection', 'slug']
initialize: ->
console.log me.isAdmin()
unless me.isAdmin()
NotFoundView = require '../../not_found'
return new NotFoundView
else super()
getRenderData: ->
context = super()
context.currentEditor = 'editor.achievement_title'

View file

@ -38,9 +38,8 @@ module.exports = class RootView extends CocoView
me.set(val, me.get(val) + 1)
console.debug me.get(val)
me.save()
#test = new Achievement(_id:'537ce4855c91b8d1dda7fda8')
#test.fetch(success:@showNewAchievement)
test = new Achievement(_id:'537ce4855c91b8d1dda7fda8')
test.fetch(success:@showNewAchievement)
showNewAchievement: (achievement) ->
currentLevel = me.level()