Compare commits

...

4 Commits

Author SHA1 Message Date
Stefan Zermatten
d9368b06d0 Merge branch 'bugfix-0.6.8' 2015-08-27 12:07:42 +02:00
Stefan Zermatten
2703367681 Proficiencies now get disabled when their features are disabled 2015-08-27 12:05:56 +02:00
Stefan Zermatten
d419442549 Fixed share dialog not finding usernames or email addresses 2015-08-27 11:59:38 +02:00
Stefan Zermatten
99df01c950 Prevented negative temporary hitpoints being added 2015-08-27 11:43:34 +02:00
5 changed files with 21 additions and 14 deletions

View File

@@ -30,7 +30,7 @@ Schemas.Proficiency = new SimpleSchema({
Proficiencies.attachSchema(Schemas.Proficiency); Proficiencies.attachSchema(Schemas.Proficiency);
Proficiencies.attachBehaviour("softRemovable"); Proficiencies.attachBehaviour("softRemovable");
makeChild(Proficiencies); makeChild(Proficiencies, ["enabled"]);
Proficiencies.allow(CHARACTER_SUBSCHEMA_ALLOW); Proficiencies.allow(CHARACTER_SUBSCHEMA_ALLOW);
Proficiencies.deny(CHARACTER_SUBSCHEMA_DENY); Proficiencies.deny(CHARACTER_SUBSCHEMA_DENY);

View File

@@ -3,8 +3,8 @@ TemporaryHitPoints = new Mongo.Collection("temporaryHitPoints");
Schemas.TemporaryHitPoints = new SimpleSchema({ Schemas.TemporaryHitPoints = new SimpleSchema({
charId: {type: String, regEx: SimpleSchema.RegEx.Id}, charId: {type: String, regEx: SimpleSchema.RegEx.Id},
name: {type: String, optional: true}, name: {type: String, optional: true},
maximum: {type: Number, defaultValue: 0}, maximum: {type: Number, defaultValue: 0, min: 0, max: 500},
used: {type: Number, defaultValue: 0}, used: {type: Number, defaultValue: 0, min: 0, max: 500},
deleteOnZero:{type: Boolean, defaultValue: false}, deleteOnZero:{type: Boolean, defaultValue: false},
dateAdded: { dateAdded: {
type: Date, type: Date,

View File

@@ -1,9 +1,11 @@
Template.addTHPDialog.events({ Template.addTHPDialog.events({
"tap #addButton": function(event, instance){ "tap #addButton": function(event, instance){
var max = +instance.find("#quantityInput").value;
if (!max || max < 0) max = 0;
TemporaryHitPoints.insert({ TemporaryHitPoints.insert({
charId: this.charId, charId: this.charId,
name: instance.find("#nameInput").value, name: instance.find("#nameInput").value,
maximum: +instance.find("#quantityInput").value, maximum: max,
deleteOnZero: !!instance.find("#deleteWhenZeroCheckbox").checked, deleteOnZero: !!instance.find("#deleteWhenZeroCheckbox").checked,
}); });
} }

View File

@@ -33,9 +33,9 @@
role="slider" role="slider"
flex flex
></paper-diff-slider> ></paper-diff-slider>
{{#unless left}}{{#unless deleteOnZero}} {{#unless left}}
<paper-icon-button class="deleteTHP" icon="delete"></paper-icon-button> <paper-icon-button class="deleteTHP" icon="delete"></paper-icon-button>
{{/unless}}{{/unless}} {{/unless}}
</div> </div>
</div> </div>
{{/each}} {{/each}}

View File

@@ -1,8 +1,13 @@
Meteor.methods({ Meteor.methods({
"getUserId": function(username){ "getUserId": function(username){
if (!username) return; if (!username) return;
regex = new RegExp("^" + username + "$", "i")
var user = Meteor.users.findOne( var user = Meteor.users.findOne(
{$or: [{username: username}, {"emails.address": username}]} {$or: [
{username: username},
{"emails.address": regex},
{"services.google.email": regex},
]}
); );
return user && user._id; return user && user._id;
} }