added a way to display an announcement

This commit is contained in:
Athou
2013-04-26 07:40:39 +02:00
parent 51f11e48b5
commit e3682ac844
8 changed files with 81 additions and 3 deletions

View File

@@ -162,15 +162,16 @@ function($scope, $timeout, $stateParams, $window, $location, $state, $route, Cat
}]);
module.controller('ToolbarCtrl', ['$scope', '$http', '$state', '$stateParams',
'$route', '$location', 'SettingsService', 'EntryService', 'ProfileService', 'AnalyticsService',
'$route', '$location', 'SettingsService', 'EntryService', 'ProfileService', 'AnalyticsService', 'ServerService',
function($scope, $http, $state, $stateParams, $route, $location,
SettingsService, EntryService, ProfileService, AnalyticsService) {
SettingsService, EntryService, ProfileService, AnalyticsService, ServerService) {
function totalActiveAjaxRequests() {
return ($http.pendingRequests.length + $.active);
}
$scope.session = ProfileService.get();
$scope.ServerService = ServerService.get();
$scope.loading = true;
$scope.$watch(totalActiveAjaxRequests, function() {

View File

@@ -198,4 +198,9 @@ module.factory('AdminUsersService', ['$resource', function($resource) {
module.factory('AdminSettingsService', ['$resource', function($resource) {
var res = $resource('rest/admin/settings/');
return res;
}]);
module.factory('ServerService', ['$resource', function($resource) {
var res = $resource('rest/server/get');
return res;
}]);

View File

@@ -33,5 +33,7 @@
<button class="btn btn-success" type="button" ng-click="toDonate()">Donate</button>
</div>
<div spinner shown="loading"></div>
<span>{{ServerService.announcement}}</span>
</div>
</div>

View File

@@ -57,7 +57,13 @@
ng-model="settings.backgroundThreads" />
<span class="help-inline">Requires restart</span>
</div>
</div>
<div class="control-group">
<label class="control-label" for="announcement">Announcement</label>
<div class="controls">
<input type="text" name="announcement"
ng-model="settings.announcement" />
</div>
</div>
<div class="control-group">
<div class="controls">