Effects
diff --git a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js
index 7a9042c2..01523efa 100644
--- a/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js
+++ b/rpg-docs/client/views/character/effects/effectsViewList/effectsViewList.js
@@ -1,7 +1,7 @@
Template.effectsViewList.helpers({
effects: function(){
if(this.parentId){
- return Effects.find({"parent.id": this.parentId, type: this.type, charId: this.charId}, {fields: {parent: 0}});
+ return Effects.find({"parent.id": this.parentId, charId: this.charId}, {fields: {parent: 0}});
} else if(this.stat){
return Effects.find({charId: this.charId, stat: this.stat});
}
diff --git a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html
index dbf6a32e..f525156b 100644
--- a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html
+++ b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.html
@@ -1,57 +1,98 @@
{{#with item}}
- {{#baseDialog title=name class=colorClass}}
-
-
- {{# if ne1 quantity}}{{/if}}
-
-
-
-
-
-
-
-
-
-
-
Requires Attunement
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{> effectsEditList parentId=_id parentCollection="Items" charId=charId type="equipment" enabled=equipped name=name}}
-
- {{> attackEditList parentId=_id parentCollection="Items" charId=charId type="equipment" enabled=equipped name=name}}
+ {{#baseDialog title=itemHeading class=colorClass showEdit=true editing=editing}}
+ {{#if editing}}
+ {{> itemEdit}}
+ {{else}}
+ {{> itemDetails}}
+ {{/if}}
{{/baseDialog}}
{{/with}}
-
\ No newline at end of file
+
+
+
+
+ {{#if weight}}
{{totalWeight}}lbs
{{/if}}
+ {{#if value}}
{{valueString totalValue}}
{{/if}}
+
+
+ {{#if enabled}}
Equipped
{{/if}}
+ {{#if requiresAttunement}}
Requires Attunement
{{/if}}
+
+ {{#if description}}
+
+ {{description}}
+ {{/if}}
+ {{> effectsViewList charId=charId parentId=_id}}
+ {{> attacksViewList}}
+
+
+
+
+
+
+
+
+ {{# if ne1 quantity}}
{{/if}}
+
+
+
+
+
+
+
Container
+ {{> containerDropdown}}
+
+
+
+
Requires Attunement
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{> effectsEditList parentId=_id parentCollection="Items" charId=charId type="equipment" enabled=equipped name=name}}
+
+ {{> attackEditList parentId=_id parentCollection="Items" charId=charId type="equipment" enabled=equipped name=name}}
+
+
+
+
+
+
+
+
+
diff --git a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js
index 752b9d08..797aa57c 100644
--- a/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js
+++ b/rpg-docs/client/views/character/inventory/itemDialog/itemDialog.js
@@ -1,20 +1,44 @@
var getContainers = function(charId){
- return Containers.find({charId: charId}, {sort: {name: 1, _id: 1}, fields: {name: 1}}).fetch();
+ return Containers.find({charId: charId}, {sort: {name: 1, _id: 1}, fields: {name: 1}});
};
+Template.itemDialog.onCreated(function(){
+ this.editing = new ReactiveVar(false);
+});
+
Template.itemDialog.helpers({
item: function(){
return Items.findOne(this.itemId);
},
- containers: function(){
- return getContainers(this.charId);
+ editing: function(){
+ return Template.instance().editing.get();
},
+ itemHeading: function(){
+ if(this.quantity === 1){
+ return this.name;
+ } else{
+ var pName = this.plural || this.name;
+ return this.quantity + " " + pName;
+ }
+ }
+});
+
+Template.itemDialog.events({
+ "tap #editButton": function(event, instance){
+ instance.editing.set(true);
+ },
+ "tap #doneEditingButton": function(event, instance){
+ instance.editing.set(false);
+ },
+});
+
+Template.itemEdit.helpers({
ne1: function(num){
return num != 1;
}
});
-Template.itemDialog.events({
+Template.itemEdit.events({
"color-change": function(event, instance){
Items.update(instance.data.itemId, {$set: {color: event.color}});
},
@@ -62,12 +86,21 @@ Template.itemDialog.events({
"change #attunementCheckbox": function(event){
var value = event.currentTarget.checked;
Items.update(this._id, {$set: {requiresAttunement: value}});
- },
+ }
+});
+
+Template.containerDropdown.helpers({
+ containers: function(){
+ return getContainers(this.charId);
+ }
+});
+
+Template.containerDropdown.events({
"core-select #containerDropDown": function(event){
var detail = event.originalEvent.detail;
if(!detail.isSelected) return;
var containerId = detail.item.getAttribute("name");
- var item = Items.findOne(Template.currentData().itemId);
+ var item = Items.findOne(Template.currentData()._id);
item.moveToContainer(containerId);
}
});
diff --git a/rpg-docs/client/views/paperTemplates/baseDialog/baseDialog.html b/rpg-docs/client/views/paperTemplates/baseDialog/baseDialog.html
index 20f587ef..20903364 100644
--- a/rpg-docs/client/views/paperTemplates/baseDialog/baseDialog.html
+++ b/rpg-docs/client/views/paperTemplates/baseDialog/baseDialog.html
@@ -3,17 +3,41 @@
{{title}}
- {{#if hideColor}}{{else}}
-
- {{> colorDropdown}}
- {{/if}}
- {{#if hideDelete}}{{else}}
-
+ {{#if showEdit}}
+ {{#if editing}}
+ {{#unless hideDelete}}
+
+ {{/unless}}
+ {{#unless hideColor}}
+ {{> colorDropdown}}
+ {{/unless}}
+
+ {{else}}
+
+ {{/if}}
+ {{else}}
+ {{#unless hideDelete}}
+
+ {{/unless}}
+ {{#unless hideColor}}
+ {{> colorDropdown}}
+ {{/unless}}
{{/if}}