Sha256: 46375898accbffc53857b6a935fc98f41658f2f8d1a29101a7d1be1c98733aad

Contents?: true

Size: 1.35 KB

Versions: 197

Compression:

Stored size: 1.35 KB

Contents

/**
 * @ngdoc object
 * @name  Bastion.host-collections.controller:NewHostCollectionController
 *
 * @requires $scope
 * @requires HostCollection
 * @requires CurrentOrganization
 *
 * @description
 *   Controls the creation of an empty HostCollection object for use by sub-controllers.
 */
angular.module('Bastion.host-collections').controller('NewHostCollectionController',
    ['$scope', 'HostCollection', 'CurrentOrganization',
    function ($scope, HostCollection, CurrentOrganization) {

        $scope.hostCollection = new HostCollection();
        $scope.panel = {loading: false};

        function success() {
            $scope.transitionTo('host-collection.info', {hostCollectionId: $scope.hostCollection.id});
        }

        function error(response) {
            $scope.working = false;
            angular.forEach(response.data.errors, function (errors, field) {
                $scope.hostCollectionForm[field].$setValidity('', false);
                $scope.hostCollectionForm[field].$error.messages = errors;
            });
        }

        $scope.hostCollection = $scope.hostCollection || new HostCollection();
        $scope.hostCollection['unlimited_hosts'] = true;

        $scope.save = function (hostCollection) {
            hostCollection['organization_id'] = CurrentOrganization;
            hostCollection.$save(success, error);
        };
    }]
);

Version data entries

197 entries across 197 versions & 1 rubygems

Version Path
katello-4.10.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.9.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.10.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.10.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.8.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.9.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.8.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.9.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.7.6 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.8.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.9.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.9.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.8.1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.7.5 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.8.0 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.8.0.rc2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.7.4 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.8.0.rc1 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.7.3 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js
katello-4.7.2 engines/bastion_katello/app/assets/javascripts/bastion_katello/host-collections/new/new-host-collection.controller.js