Added a settings feature to set the website name

pull/427/head
tduncan7191 2019-05-26 16:16:40 -05:00
parent 7f2596f4ab
commit a3552512b2
11 changed files with 10962 additions and 3 deletions

1
.gitignore vendored
View File

@ -53,3 +53,4 @@ build
/src/release
/release
/bower_components
/.vs

10842
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -45,5 +45,10 @@
},
"scripts": {
"postinstall": "bower install"
},
"dependencies": {
"bootstrap-toggle": "^2.2.2",
"eslint-config-defaults": "^9.0.0",
"eslint-plugin-react": "^7.13.0"
}
}

View File

@ -16,6 +16,7 @@
'BlurAdmin.pages.charts',
'BlurAdmin.pages.maps',
'BlurAdmin.pages.profile',
'BlurAdmin.pages.settings'
])
.config(routeConfig);

View File

@ -0,0 +1,23 @@
/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.settings')
.controller('SettingsPageCtrl', SettingsPageCtrl);
/** @ngInject */
function SettingsPageCtrl($scope, settings, $rootScope) {
$scope.site = {
name: settings.getSiteName()
};
$scope.update = function () {
settings.setSiteName($scope.site.name);
$rootScope.$emit('updateSettings', { siteName: $scope.site.name });
};
}
})();

View File

@ -0,0 +1,22 @@
<div ba-panel ba-panel-class="settings-page">
<div class="panel-content">
<h3 class="with-line">Site Settings</h3>
<div class="row">
<div class="col-md-6">
<div class="form-group row clearfix">
<label for="inputSiteName" class="col-sm-3 control-label">Site Name</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="inputSiteName" placeholder="{{site.name}}" ng-model="site.name">
</div>
</div>
</div>
</div>
<button type="button" ng-click="update()" class="btn btn-primary btn-with-icon save-profile">
<i class="ion-android-checkmark-circle"></i>Update Settings
</button>
</div>
</div>

View File

@ -0,0 +1,18 @@
(function () {
'use strict';
angular.module('BlurAdmin.pages.settings', [])
.config(routeConfig);
/** @ngInject */
function routeConfig($stateProvider) {
$stateProvider
.state('settings', {
url: '/settings',
title: 'Settings',
templateUrl: 'app/pages/settings/settings.html',
controller: 'SettingsPageCtrl'
});
}
})();

View File

@ -12,7 +12,9 @@
function pageTop() {
return {
restrict: 'E',
templateUrl: 'app/theme/components/pageTop/pageTop.html'
templateUrl: 'app/theme/components/pageTop/pageTop.html',
controllerAs: '$pageTopController',
controller: 'pageTopCtrl'
};
}

View File

@ -1,5 +1,5 @@
<div class="page-top clearfix" scroll-position="scrolled" max-height="50" ng-class="{'scrolled': scrolled}">
<a href="#/dashboard" class="al-logo clearfix"><span>Blur</span>Admin</a>
<a href="#/dashboard" class="al-logo clearfix"><span>{{ pageTop.siteName }}</span></a>
<a href class="collapse-menu-link ion-navicon" ba-sidebar-toggle-menu></a>
<div class="search">
@ -15,7 +15,7 @@
<ul class="top-dropdown-menu profile-dropdown" uib-dropdown-menu>
<li><i class="dropdown-arr"></i></li>
<li><a href="#/profile"><i class="fa fa-user"></i>Profile</a></li>
<li><a href><i class="fa fa-cog"></i>Settings</a></li>
<li><a href="#/settings"><i class="fa fa-cog"></i>Settings</a></li>
<li><a href class="signout"><i class="fa fa-power-off"></i>Sign out</a></li>
</ul>
</div>

View File

@ -0,0 +1,22 @@
/**
* @author v.lugovsky
* created on 16.12.2015
*/
(function () {
'use strict';
angular.module('BlurAdmin.pages.settings')
.controller('pageTopCtrl', pageTopCtrl);
/** @ngInject */
function pageTopCtrl($scope, settings, $rootScope) {
$scope.pageTop = {
siteName: settings.getSiteName()
};
$rootScope.$on('updateSettings', function (event, message) {
$scope.pageTop.siteName = message.siteName;
});
}
})();

View File

@ -0,0 +1,23 @@
/**
* @author v.lugovsky
* created on 03.05.2016
*/
(function () {
'use strict';
angular.module('BlurAdmin.theme')
.service('settings', settings);
/** @ngInject */
function settings() {
var siteName = "BlurAdmin";
return {
getSiteName: function () {
return siteName;
},
setSiteName: function (value) {
siteName = value;
}
};
}
})();