Compare commits

..

7 Commits
0.5.3 ... 0.5.5

Author SHA1 Message Date
Stefan Zermatten
89f03c7601 Merge branch 'hotfix-gmail-report' 2015-06-12 08:04:23 +02:00
Stefan Zermatten
9d2eb14c0c Change logs 2015-06-12 08:03:46 +02:00
Stefan Zermatten
7b3cb54983 Added gmail email address senders to the report emails 2015-06-12 08:02:33 +02:00
Stefan Zermatten
a09bad2fed Change logs 2015-06-10 11:13:58 +02:00
Stefan Zermatten
afd897edfe Merge branch 'Hotfix' 2015-06-10 11:05:01 +02:00
Stefan Zermatten
efc79cb6e7 Fixed net value calculation to avoid rounding errors 2015-06-10 11:00:42 +02:00
Stefan Zermatten
35efe39ea7 Made feedback reports send emails "from" their creator's address 2015-06-10 11:00:19 +02:00
3 changed files with 41 additions and 12 deletions

View File

@@ -45,12 +45,25 @@ Meteor.methods({
metaData: Object, metaData: Object,
}); });
report.owner = this.userId; report.owner = this.userId;
Reports.insert(report); var id = Reports.insert(report);
var user = Meteor.users.findOne(this.userId);
var sender = user &&
user.emails &&
user.emails[0] &&
user.emails[0].address ||
user.services &&
user.services.google &&
user.services.google.email ||
"reports@dicecloud.com";
var bodyText = "Report ID: " + id +
"\nSeverity: " + report.severity +
"\nType: " + report.type +
"\n\n" + report.description;
Email.send({ Email.send({
from: "reports@dicecloud.com", from: sender,
to: "stefan.zermatten@gmail.com", to: "stefan.zermatten@gmail.com",
subject: "DiceCloud feedback - " + report.title, subject: "DiceCloud feedback - " + report.title,
text: JSON.stringify(_.omit(report, "metaData"), null, '\t'), text: bodyText,
}); });
}, },
deleteReport: function(id) { deleteReport: function(id) {

View File

@@ -1,25 +1,27 @@
Template.registerHelper("valueString", function(value) { Template.registerHelper("valueString", function(value) {
var intValue = Math.round(value * 100);
var cp = intValue % 10;
intValue -= cp;
cp = Math.round(cp);
sp = intValue % 100;
intValue -= sp;
sp = Math.round(sp / 10)
gp = Math.floor(value);
var resultArray = []; var resultArray = [];
//sp
var gp = Math.floor(value);
if (gp > 0) { if (gp > 0) {
resultArray.push(gp + "gp"); resultArray.push(gp + "gp");
} }
//sp
var sp = Math.floor(10 * (value % 1));
if (sp > 0) { if (sp > 0) {
resultArray.push(sp + "sp"); resultArray.push(sp + "sp");
} }
//cp
var cp = 10 * ((value * 10) % 1);
cp = Math.round(cp * 1000) / 1000;
if (cp > 0) { if (cp > 0) {
resultArray.push(cp + "cp"); resultArray.push(cp + "cp");
} }
//build string with correct spacing //build string with correct spacing
var result = ""; var result = "";
for (var i = 0; i < resultArray.length; i++) { for (var i = 0, l = resultArray.length; i < l; i++) {
//add a space between values //add a space between values
if (i !== 0) { if (i !== 0) {
result += " "; result += " ";

View File

@@ -135,7 +135,7 @@ ChangeLogs.insert({
}); });
ChangeLogs.insert({ ChangeLogs.insert({
version: "0.5.2", version: "0.5.3",
changes: [ changes: [
"Prevented a harmless error caused by effects which have no stat set", "Prevented a harmless error caused by effects which have no stat set",
"Added the ability to hide the spells tab", "Added the ability to hide the spells tab",
@@ -144,3 +144,17 @@ ChangeLogs.insert({
"Overhauled how effects' stats are chosen", "Overhauled how effects' stats are chosen",
], ],
}); });
ChangeLogs.insert({
version: "0.5.4",
changes: [
"Fixed rounding error on net worth calculation",
],
});
ChangeLogs.insert({
version: "0.5.5",
changes: [
"Fixed reports from google users not correctly storing the reply-to email address",
],
});