Sha256: a27beabbb8deb79aaca109df5c3b64204f9c31bf0ecc7c27174c7ab930e2642f

Contents?: true

Size: 1.39 KB

Versions: 7

Compression:

Stored size: 1.39 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.content-views.controller:ContentViewHistoryController
 *
 * @requires $scope
 * @requires ContentView
 * @requires Nutupane
 *
 * @description
 *   A controller for showing the history of a content view
 */
angular.module('Bastion.content-views').controller('ContentViewHistoryController',
    ['$scope', 'translate', 'ContentViewHistory', 'Nutupane',
    function ($scope, translate, ContentViewHistory, Nutupane) {
        var nutupane;

        nutupane = new Nutupane(ContentViewHistory, {
            contentViewId: $scope.$stateParams.contentViewId,
            'sort_by': 'created_at',
            'sort_order': 'DESC'
        });

        nutupane.table.closeItem = function () {};
        $scope.detailsTable = nutupane.table;

        $scope.actionText = function (history) {
            var message,
                taskType = history.task.label,
                taskTypes = $scope.taskTypes;

            if (taskType === taskTypes.deletion) {
                message = translate("Deleted from %s").replace('%s', history.environment.name);
            } else if (taskType === taskTypes.promotion) {
                message = translate("Promoted to %s").replace('%s', history.environment.name);
            } else if (taskType === taskTypes.publish) {
                message = translate("Published new version");
            }

            return message;
        };
    }]
);

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
katello-2.4.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js
katello-2.4.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js
katello-2.4.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js
katello-2.4.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js
katello-2.4.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js
katello-2.4.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js
katello-2.4.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/histories/content-view-history.controller.js