style changes

This commit is contained in:
Barış Soner Uşaklı
2017-06-22 19:03:49 -04:00
parent 78005d6124
commit 0f234601f1
20 changed files with 429 additions and 462 deletions

View File

@@ -36,32 +36,30 @@ function renderEmail(req, res, next) {
async.map(emails, function (email, next) {
var path = email.replace(emailsPath, '').substr(1).replace('.tpl', '');
fs.readFile(email, function (err, original) {
if (err) {
return next(err);
}
async.waterfall([
function (next) {
fs.readFile(email, next);
},
function (original, next) {
var text = meta.config['email:custom:' + path] ? meta.config['email:custom:' + path] : original.toString();
var text = meta.config['email:custom:' + path] ? meta.config['email:custom:' + path] : original.toString();
next(null, {
path: path,
fullpath: email,
text: text,
original: original.toString(),
});
});
next(null, {
path: path,
fullpath: email,
text: text,
original: original.toString(),
});
},
], next);
}, next);
},
], function (err, emails) {
if (err) {
return next(err);
}
res.render('admin/settings/email', {
emails: emails,
sendable: emails.filter(function (email) {
return email.path.indexOf('_plaintext') === -1 && email.path.indexOf('partials') === -1;
}),
});
});
function (emails) {
res.render('admin/settings/email', {
emails: emails,
sendable: emails.filter(function (email) {
return email.path.indexOf('_plaintext') === -1 && email.path.indexOf('partials') === -1;
}),
});
},
], next);
}