Skip to content

Commit

Permalink
Звание Советник
Browse files Browse the repository at this point in the history
  • Loading branch information
klimashkin committed Mar 23, 2014
1 parent 44ffcfa commit b251ad3
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ async.waterfall([
require('./controllers/registerRoutes.js').loadController(app);
require('./controllers/systemjs.js').loadController(app, db);
require('./controllers/errors.js').registerErrorHandling(app);
require('./basepatch/v1.0.1.js').loadController(app, db);
require('./basepatch/v1.1.0.js').loadController(app, db);

regionController.fillCache(callback);
}
Expand Down
40 changes: 40 additions & 0 deletions basepatch/v1.1.0.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*global, print: true, printjson: true*/
'use strict';

var log4js = require('log4js'),
mongoose = require('mongoose'),
logger;

module.exports.loadController = function (app, db) {
logger = log4js.getLogger("systemjs.js");

saveSystemJSFunc(function pastvuPatch() {
var startTime = Date.now();

//Добавляем звание Советник
db.user_settings.update({key: 'ranks'}, {$push: {vars: 'adviser'}});

return {message: 'FINISH in total ' + (Date.now() - startTime) / 1000 + 's'};
});

/**
* Save function to db.system.js
* @param func
*/
function saveSystemJSFunc(func) {
if (!func || !func.name) {
logger.error('saveSystemJSFunc: function name is not defined');
}
db.db.collection('system.js').save(
{
_id: func.name,
value: new mongoose.mongo.Code(func.toString())
},
function saveCallback(err) {
if (err) {
logger.error(err);
}
}
);
}
};
3 changes: 2 additions & 1 deletion public/history.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
1.1.0 / 2014-03-21
1.1.0 / 2014-03-23
==================

* (added) Комментарии не удаляются физически. Они остаются видны пользователям, которые участвовали в удалённой ветке и модераторам
Expand All @@ -7,6 +7,7 @@
* (added) Комментариями новостей могут управлять только администраторы, комменатирями фотографий - также медераторы регионов, которым принадлежит фотография
* (added) Если у фотографии нет координаты, карта устанавливается в домашнее положение этого региона
* (added) Анонимным пользователям над помментариями показывается кнопка "Войдите, чтобы поделиться мнением"
* (added) Звание Советник
* (fixed) Регистрируемым пользователям по умолчанию присваивается регион Москва
* (fixed) Ближайшие фотографии должны показывать только бубличные фото
* (tech) Логирование удаления/восстановления комментария в новой общей модели логирования
Expand Down
Binary file added public/img/rank/adviser.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 3 additions & 4 deletions public/js/globalVM.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
define(['jquery', 'Browser', 'Utils', 'underscore', 'Params', 'i18n', 'knockout', 'lib/PubSub'], function ($, Browser, Utils, _, P, i18n, ko, ps) {
"use strict";

var globalVM = {
return {
P: P,
pb: ps,
i18n: i18n,
Expand All @@ -17,7 +17,8 @@ define(['jquery', 'Browser', 'Utils', 'underscore', 'Params', 'i18n', 'knockout'
ranks: {
mec: {src: '/img/rank/bronse.jpg', title: 'Меценат'},
mec_silv: {src: '/img/rank/silver.jpg', title: 'Серебряный меценат'},
mec_gold: {src: '/img/rank/gold.jpg', title: 'Золотой меценат'}
mec_gold: {src: '/img/rank/gold.jpg', title: 'Золотой меценат'},
adviser: {src: '/img/rank/adviser.jpg', title: 'Советник'}
},

func: {
Expand Down Expand Up @@ -60,6 +61,4 @@ define(['jquery', 'Browser', 'Utils', 'underscore', 'Params', 'i18n', 'knockout'
}
}
};

return globalVM;
});
3 changes: 2 additions & 1 deletion public/js/module/user/manage.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ define(['underscore', 'Utils', 'socket!', 'Params', 'knockout', 'knockout.mappin
var ranksLang = {
mec: 'Меценат',
mec_silv: 'Серебряный меценат',
mec_gold: 'Золотой меценат'
mec_gold: 'Золотой меценат',
adviser: 'Советник'
};

return Cliche.extend({
Expand Down

0 comments on commit b251ad3

Please sign in to comment.