diff --git a/index.html b/index.html index 7f7d200..be12efd 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,7 @@
@@ -141,9 +141,25 @@
-

{{ static.bundles[active_bundle].name }}

- +
+
+

{{ static.bundles[active_bundle].name }}

+
{{ static.bundles[active_bundle].reward }}
+ +
+
+

{{ static.rooms[static.bundles[active_bundle].room].name }}

+
{{ static.rooms[static.bundles[active_bundle].room].reward }}
+ + + +
+
diff --git a/main.js b/main.js index 0574481..10fc5d6 100644 --- a/main.js +++ b/main.js @@ -116,6 +116,22 @@ var v = new Vue({ } } return ""; + }, + getRoomItemsRequired: function(roomId) { + return this.static.bundles.reduce(function(previousValue, nextValue){ + if(nextValue.room === roomId){ + return previousValue + nextValue.items_required; + } + else{ + return previousValue; + } + }, 0) + }, + getRoomItemsChecked: function(roomId){ + return this.static.bundles + .filter(function(b){ return b.room === roomId; }) + .map(function(b){ return b.id; }) + .reduce(function(p, c){ return p + v.user_data[c].length; }, 0); } } });