Item plural now shows whenever quantity is not 1

This commit is contained in:
Thaum
2015-02-06 08:58:32 +00:00
parent d6a2fff851
commit 3bde7a5e97
3 changed files with 6 additions and 3 deletions

View File

@@ -27,7 +27,7 @@ Items.helpers({
return this.weight * this.quantity;
},
pluralName: function(){
if(this.plural && this.quantity > 1){
if(this.plural && this.quantity !== 1){
return this.plural;
} else{
return this.name;

View File

@@ -14,7 +14,7 @@
<div class="detailContent">
<!--Name and plural name-->
<paper-input id="itemNameInput" label="Name" floatinglabel value={{name}}></paper-input>
{{# if quantity}}<paper-input id="itemPluralInput" label="Plural Name" floatinglabel value={{plural}}></paper-input>{{/if}}
{{# if ne1 quantity}}<paper-input id="itemPluralInput" label="Plural Name" floatinglabel value={{plural}}></paper-input>{{/if}}
<!--Equipped-->
{{# if canEquip}}
<div center horizontal layout>

View File

@@ -116,5 +116,8 @@ Template.itemDialog.helpers({
},
canEquip: function(){
return this.equipmentSlot !== "none";
},
ne1: function(num){
return num != 1;
}
});
});