Sha256: 72b84abbf1ad0ed69da0d26931a7bab475a8b32e65b2a3a8a7ac660bc3aa7cde

Contents?: true

Size: 991 Bytes

Versions: 248

Compression:

Stored size: 991 Bytes

Contents

/**
 * @ngdoc directive
 * @name  Bastion.tasks.directive:taskInputPart
 *
 * @description
 *   Converts part of task humanized structure into a link if possible
 */
angular.module('Bastion.tasks').directive('taskInputPart',
    function () {
        return {
            restrict: 'A',
            template: '<span ng-if="!link()">{{text()}}</span>' +
                      '<a ng-if="link()" href="{{link()}}">{{text()}}</a>',
            scope: {
                data: '='
            },
            link: function (scope) {
                scope.text = function () {
                    if (_.isString(scope.data)) {
                        return scope.data;
                    }

                    return scope.data[1].text;
                };

                scope.link = function () {
                    if (!_.isString(scope.data) && scope.data[1]) {
                        return scope.data[1].link;
                    }
                };
            }
        };
    }
);

Version data entries

248 entries across 248 versions & 1 rubygems

Version Path
katello-4.14.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.15.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.15.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.15.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.14.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.14.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.14.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.14.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.14.0.rc1.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.14.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.13.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.13.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.12.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.13.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.12.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.12.0.rc3 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.12.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.12.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.11.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js
katello-4.11.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/task-input-part.directive.js