Add branding section in admin panel

This commit is contained in:
RainLoop Team 2014-01-19 00:49:14 +04:00
parent 6ecb7006f8
commit 8890de4a86
19 changed files with 290 additions and 99 deletions

View file

@ -19,9 +19,6 @@ function AdminGeneral()
this.allowAdditionalAccounts = oData.allowAdditionalAccounts;
this.allowIdentities = oData.allowIdentities;
this.title = ko.observable(RL.settingsGet('Title'));
this.loadingDesc = ko.observable(RL.settingsGet('LoadingDescription'));
this.themesOptions = ko.computed(function () {
return _.map(oData.themes(), function (sTheme) {
return {
@ -37,10 +34,8 @@ function AdminGeneral()
this.weakPassword = !!RL.settingsGet('WeakPassword');
this.titleTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.languageTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.themeTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.loadingDescTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
}
Utils.addSettingsViewModel(AdminGeneral, 'AdminSettingsGeneral', 'General', 'general', true);
@ -51,24 +46,10 @@ AdminGeneral.prototype.onBuild = function ()
_.delay(function () {
var
f1 = Utils.settingsSaveHelperSimpleFunction(self.titleTrigger, self),
f2 = Utils.settingsSaveHelperSimpleFunction(self.languageTrigger, self),
f3 = Utils.settingsSaveHelperSimpleFunction(self.themeTrigger, self),
f4 = Utils.settingsSaveHelperSimpleFunction(self.loadingDescTrigger, self)
f3 = Utils.settingsSaveHelperSimpleFunction(self.themeTrigger, self)
;
self.title.subscribe(function (sValue) {
RL.remote().saveAdminConfig(f1, {
'Title': Utils.trim(sValue)
});
});
self.loadingDesc.subscribe(function (sValue) {
RL.remote().saveAdminConfig(f4, {
'LoadingDescription': Utils.trim(sValue)
});
});
self.language.subscribe(function (sValue) {
RL.remote().saveAdminConfig(f2, {
'Language': Utils.trim(sValue)