From a88898729b4930d45f743b05a05fbf3e9a42397f Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Tue, 26 Jun 2012 16:51:47 -0400 Subject: [PATCH] push default tasks, problem with list handling --- src/app/index.coffee | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/app/index.coffee b/src/app/index.coffee index 5acf990d64..0d4e61e07d 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -16,12 +16,6 @@ newUser = (model, userId) -> lvl: 1 hp: 50 - # tasks: - # {type: 'habit', text: 'Take the stairs', notes: 'Test Notes', value: 0, up: true, down: true}, - # {type: 'daily', text: 'Go to the gym', notes: '', value: 0, completed: false }, - # {type: 'todo', text: 'Make a doctor appointment', notes: '', value: 0, completed: false }, - # {type: 'reward', text: '1 TV episode', notes: '', value: 20 } - get '/', (page, model) -> # Render page if a userId is already stored in session data userId = model.get '_session.userId' @@ -43,6 +37,11 @@ get '/', (page, model) -> model.refList "_dailyList", dailys.path(), "_user.dailyIds" model.refList "_todoList", todos.path(), "_user.todoIds" model.refList "_rewardList", rewards.path(), "_user.rewardIds" + unless habits.get() or dailys.get() or todos.get() or rewards.get() + model.push '_habitList', {type: 'habit', text: 'Take the stairs', notes: 'Test Notes', value: 0, up: true, down: true} + model.push '_dailyList', {type: 'daily', text: 'Go to the gym', notes: '', value: 0, completed: false } + model.push '_todoList', {type: 'todo', text: 'Make a doctor appointment', notes: '', value: 0, completed: false } + model.push '_rewardList', {type: 'reward', text: '1 TV episode', notes: '', value: 20 } # http://tibia.wikia.com/wiki/Formula model.fn '_tnl', '_user.lvl', (lvl) -> 50 * Math.pow(lvl, 2) - 150 * lvl + 200