Sha256: e416e11b1010d3d4f955bd91835858db5e4af25add08f838470e8f8976f5e08f

Contents?: true

Size: 1.37 KB

Versions: 2

Compression:

Stored size: 1.37 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', 'ContentView', 'Nutupane',
    function ($scope, translate, ContentView, Nutupane) {
        var nutupane;

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

        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

2 entries across 2 versions & 1 rubygems

Version Path
katello-2.4.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details-history.controller.js
katello-2.4.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/content-views/details/content-view-details-history.controller.js