Project

General

Profile

« Previous | Next » 

Revision 7e643b36

Added by Ivan Necas about 10 years ago

Reload versions after publishing

Fixes computing the version numbers for content view publishing.
Also show errors when something goes wrong.

View differences:

engines/bastion/app/assets/javascripts/bastion/content-views/details/content-view-publish.controller.js
* within the table.
*/
angular.module('Bastion.content-views').controller('ContentViewPublishController',
['$scope', 'gettext', 'ContentView', function ($scope, gettext, ContentView) {
['$scope', 'gettext', 'ContentView', function ($scope, gettext, ContentView) {
$scope.version = {};
$scope.publish = function (contentView) {
$scope.working = true;
ContentView.publish(contentView, function () {
$scope.working = false;
$scope.transitionTo('content-views.details.versions', {contentViewId: contentView.id});
});
ContentView.publish(contentView, success, failure);
};
function success() {
$scope.reloadVersions();
$scope.transitionTo('content-views.details.versions',
{contentViewId: $scope.contentView.id});
$scope.working = false;
}
function failure(response) {
$scope.$parent.errorMessages = [response.data.displayMessage];
$scope.working = false;
}
}]
);

Also available in: Unified diff