fontawesome 4 migration, closes #473

This commit is contained in:
Baris Usakli
2013-11-26 14:25:46 -05:00
parent a5e78aab08
commit 541993c80a
68 changed files with 916 additions and 2997 deletions

View File

@@ -4,6 +4,7 @@ var RDB = require('./redis.js'),
async = require('async'),
winston = require('winston'),
notifications = require('./notifications'),
categories = require('./categories'),
Upgrade = {},
schemaDate, thisSchemaDate;
@@ -174,6 +175,39 @@ Upgrade.upgrade = function(callback) {
winston.info('[2013/11/22] Update to Category colours skipped.');
next();
}
},
function(next) {
thisSchemaDate = new Date(2013, 10, 26).getTime();
if (schemaDate < thisSchemaDate || 1) {
categories.getAllCategories(0, function(err, categories) {
function updateIcon(category, next) {
var icon = '';
if(category.icon === 'icon-lightbulb') {
icon = 'fa-lightbulb-o';
} else if(category.icon === 'icon-plus-sign') {
icon = 'fa-plus';
} else if(category.icon === 'icon-screenshot') {
icon = 'fa-crosshairs';
} else {
icon = category.icon.replace('icon-', 'fa-');
}
RDB.hset('category:' + category.cid, 'icon', icon, next);
}
async.each(categories.categories, updateIcon, function(err) {
if(err) {
return next(err);
}
winston.info('[2013/11/26] Updated Category icons.');
next();
});
});
} else {
winston.info('[2013/11/26] Update to Category icons skipped.');
next();
}
}
// Add new schema updates here
// IMPORTANT: REMEMBER TO UPDATE VALUE OF latestSchema IN LINE 12!!!