From d1ecf7d772b92615573c2f1adb4336fed30317cd Mon Sep 17 00:00:00 2001 From: Tyler Renelle Date: Sun, 24 Jun 2012 20:51:42 -0400 Subject: [PATCH] Got modal edit working --- src/app/index.coffee | 12 +++++------ views/app/index.html | 51 +++++++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/src/app/index.coffee b/src/app/index.coffee index c533f5360c..533977ae6c 100644 --- a/src/app/index.coffee +++ b/src/app/index.coffee @@ -22,16 +22,16 @@ newUser = (model, userId) -> habitIds: [0] dailys: # I know it's bad pluralization, but codes easier later - 0: {id: 0, type: 'daily', text: 'Go to the gym', notes: '', score: 0, completed: false } - dailyIds: [0] + 1: {id: 1, type: 'daily', text: 'Go to the gym', notes: '', score: 0, completed: false } + dailyIds: [1] todos: - 0: {id: 0, type: 'todo', text: 'Make a doctor appointment', notes: '', score: 0, completed: false } - todoIds: [0] + 2: {id: 2, type: 'todo', text: 'Make a doctor appointment', notes: '', score: 0, completed: false } + todoIds: [2] rewards: - 0: {id: 0, type: 'reward', text: '1 TV episode', notes: '', price: 20 } - rewardIds: [0] + 3: {id: 3, type: 'reward', text: '1 TV episode', notes: '', price: 20 } + rewardIds: [3] get '/', (page, model) -> # Render page if a userId is already stored in session data diff --git a/views/app/index.html b/views/app/index.html index 60f6798f36..90f6239aad 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -2,7 +2,6 @@ HabitRPG - @@ -17,33 +16,55 @@ -
  • +
  • -
    {unescaped .text}
    +
    {unescaped :task.text}
    + + Launch Modal + +
    - {#if .notes} - + {#if :task.notes} + {/}
  • + + +
    @@ -94,21 +115,21 @@
    - {#each _habitList}{/} + {#each _habitList as :task}{/}
    - {#each _dailyList}{/} + {#each _dailyList as :task}{/}
    - {#each _todoList}{/} + {#each _todoList as :task}{/}
    @@ -116,7 +137,7 @@
    {gold(_user.money)} {silver(_user.money)} - {#each _rewardList}{/} + {#each _rewardList as :task}{/}