add new branding view
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<div class="content">
|
||||
|
||||
<div class="text-left">
|
||||
<h1>Branding</h1>
|
||||
</div>
|
||||
|
||||
<div class="text-left">
|
||||
<h3>Footer</h3>
|
||||
</div>
|
||||
|
||||
<div class="card" style="margin-bottom: 15px;">
|
||||
<div class="row" ng-hide="config.features.branding">
|
||||
<div class="col-xs-12">
|
||||
<b>Customizing the footer is only available in the business plan.</b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="config.features.branding">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<p>Use <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">markdown</a> to style the footer.</p>
|
||||
|
||||
<textarea class="form-control" ng-model="footer.content" ng-disabled="footer.busy"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-right">
|
||||
<button class="btn btn-outline btn-primary pull-right" ng-click="footer.save()"><i class="fa fa-circle-notch fa-spin" ng-show="footer.busy"></i> Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,45 @@
|
||||
'use strict';
|
||||
|
||||
/* global angular:false */
|
||||
/* global $:false */
|
||||
|
||||
angular.module('Application').controller('BrandingController', ['$scope', '$location', 'Client', function ($scope, $location, Client) {
|
||||
Client.onReady(function () { if (Client.getUserInfo().role !== 'owner') $location.path('/'); });
|
||||
|
||||
$scope.client = Client;
|
||||
$scope.user = Client.getUserInfo();
|
||||
$scope.config = Client.getConfig();
|
||||
|
||||
$scope.footer = {
|
||||
busy: false,
|
||||
content: '',
|
||||
|
||||
save: function () {
|
||||
$scope.footer.busy = true;
|
||||
|
||||
Client.setFooter($scope.footer.content.trim(), function (error) {
|
||||
if (error) return console.error('Failed to set footer.', error);
|
||||
|
||||
Client.refreshConfig(function () {
|
||||
$scope.footer.busy = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function () {
|
||||
$scope.footer.busy = true;
|
||||
Client.getFooter(function (error, result) {
|
||||
if (error) return console.error('Unable to fetch footer content.', error);
|
||||
|
||||
$scope.footer.content = result;
|
||||
$scope.footer.busy = false;
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Client.onReady(function () {
|
||||
$scope.footer.refresh();
|
||||
});
|
||||
|
||||
$('.modal-backdrop').remove();
|
||||
}]);
|
||||
@@ -384,33 +384,4 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="text-left">
|
||||
<h3>Branding</h3>
|
||||
</div>
|
||||
|
||||
<div class="card" style="margin-bottom: 15px;">
|
||||
<div class="row" ng-hide="config.features.branding">
|
||||
<div class="col-xs-12">
|
||||
<b>Customizing the footer is only available in the business plan.</b>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row" ng-show="config.features.branding">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="control-label" style="width: 100%">Footer</label>
|
||||
<p class="text-small">Use <a href="https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet" target="_blank">markdown</a> to style the footer.</p>
|
||||
|
||||
<textarea class="form-control" ng-model="branding.footer.content" ng-disabled="branding.footer.busy"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 text-right">
|
||||
<button class="btn btn-outline btn-primary pull-right" ng-click="branding.footer.save()"><i class="fa fa-circle-notch fa-spin" ng-show="branding.footer.busy"></i> Save</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<br/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -21,39 +21,6 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
}
|
||||
};
|
||||
|
||||
$scope.branding = {
|
||||
footer: {
|
||||
busy: false,
|
||||
content: '',
|
||||
|
||||
save: function () {
|
||||
$scope.branding.footer.busy = true;
|
||||
|
||||
Client.setFooter($scope.branding.footer.content.trim(), function (error) {
|
||||
if (error) return console.error('Failed to set footer.', error);
|
||||
|
||||
Client.refreshConfig(function () {
|
||||
$scope.branding.footer.busy = false;
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
refresh: function () {
|
||||
$scope.branding.footer.busy = true;
|
||||
Client.getFooter(function (error, result) {
|
||||
if (error) return console.error('Unable to fetch footer content.', error);
|
||||
|
||||
$scope.branding.footer.content = result;
|
||||
$scope.branding.footer.busy = false;
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
refresh: function () {
|
||||
$scope.branding.footer.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
$scope.update = {
|
||||
error: {}, // this is for the dialog
|
||||
busy: false,
|
||||
@@ -489,7 +456,6 @@ angular.module('Application').controller('SettingsController', ['$scope', '$loca
|
||||
getTimeZone();
|
||||
|
||||
$scope.update.checkStatus();
|
||||
$scope.branding.refresh();
|
||||
|
||||
if ($scope.user.isAtLeastOwner) getSubscription();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user