forked from Archives/Athou_commafeed
added a way to display an announcement
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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;
|
||||
}]);
|
||||
@@ -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>
|
||||
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user