<commit_before>/*
 * Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

/**
 * The StoryBoard project group submodule handles most activity involving
 * searching for and reviewing project groups. Administration of project groups
 * has moved from the admin module.
 */
angular.module('sb.project_group',
    ['ui.router', 'sb.services', 'sb.util', 'sb.auth'])
    .config(function ($stateProvider, $urlRouterProvider, PermissionResolver) {
        'use strict';

        // Routing Defaults.
        $urlRouterProvider.when('/project_group', '/project_group/list');

        // Set our page routes.
        $stateProvider
            .state('sb.project_group', {
                abstract: true,
                url: '/project_group',
                templateUrl: 'app/project_group/template/project_group.html',
                controller: 'ProjectGroupAdminController',
                resolve: {
                    isSuperuser: PermissionResolver
                        .resolvePermission('is_superuser', true)
                }
            })
            .state('sb.project_group.list', {
                url: '/list',
                templateUrl: 'app/project_group/template/list.html',
                controller: 'ProjectGroupListController'
            })
            .state('sb.project_group_detail', {
                url: '/project_group/detail/:id',
                templateUrl: 'app/project_group/template/detail.html',
                controller: 'ProjectGroupDetailController',
                resolve: {
                    projectGroup: function ($stateParams, ProjectGroup, $q) {
                        var deferred = $q.defer();

                        ProjectGroup.get({id: $stateParams.id},
                            function (result) {
                                deferred.resolve(result);
                            }, function (error) {
                                deferred.reject(error);
                            });
                        return deferred.promise;
                    }
                }
            })
            .state('sb.project_group_edit', {
                url: '/project_group/edit/:id',
                templateUrl: 'app/project_group/template/edit.html',
                controller: 'ProjectGroupEditController',
                resolve: {
                    projectGroup: function ($stateParams, ProjectGroup) {
                        return ProjectGroup.get({id: $stateParams.id}).$promise;
                    },
                    projects: function ($stateParams, ProjectGroupItem) {
                        return ProjectGroupItem.browse(
                            {projectGroupId: $stateParams.id}
                        ).$promise;
                    },
                    isSuperuser: PermissionResolver
                        .requirePermission('is_superuser', true)
                }
        });
    });<commit_msg>List id for url consistently<commit_after>/*
 * Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 * 	http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 */

/**
 * The StoryBoard project group submodule handles most activity involving
 * searching for and reviewing project groups. Administration of project groups
 * has moved from the admin module.
 */
angular.module('sb.project_group',
    ['ui.router', 'sb.services', 'sb.util', 'sb.auth'])
    .config(function ($stateProvider, $urlRouterProvider, PermissionResolver) {
        'use strict';

        // Routing Defaults.
        $urlRouterProvider.when('/project_group', '/project_group/list');

        // Set our page routes.
        $stateProvider
            .state('sb.project_group', {
                abstract: true,
                url: '/project_group',
                templateUrl: 'app/project_group/template/project_group.html',
                controller: 'ProjectGroupAdminController',
                resolve: {
                    isSuperuser: PermissionResolver
                        .resolvePermission('is_superuser', true)
                }
            })
            .state('sb.project_group.list', {
                url: '/list',
                templateUrl: 'app/project_group/template/list.html',
                controller: 'ProjectGroupListController'
            })
            .state('sb.project_group_detail', {
                url: '/project_group/detail/{id:[0-9]+}',
                templateUrl: 'app/project_group/template/detail.html',
                controller: 'ProjectGroupDetailController',
                resolve: {
                    projectGroup: function ($stateParams, ProjectGroup, $q) {
                        var deferred = $q.defer();

                        ProjectGroup.get({id: $stateParams.id},
                            function (result) {
                                deferred.resolve(result);
                            }, function (error) {
                                deferred.reject(error);
                            });
                        return deferred.promise;
                    }
                }
            })
            .state('sb.project_group_edit', {
                url: '/project_group/edit/{id:[0-9]+}',
                templateUrl: 'app/project_group/template/edit.html',
                controller: 'ProjectGroupEditController',
                resolve: {
                    projectGroup: function ($stateParams, ProjectGroup) {
                        return ProjectGroup.get({id: $stateParams.id}).$promise;
                    },
                    projects: function ($stateParams, ProjectGroupItem) {
                        return ProjectGroupItem.browse(
                            {projectGroupId: $stateParams.id}
                        ).$promise;
                    },
                    isSuperuser: PermissionResolver
                        .requirePermission('is_superuser', true)
                }
        });
    });
{'fraction_non_alphanumeric': 0.09821045096635647, 'fraction_numerical': 0.002863278453829635, 'mean_word_length': 1.6057441253263707, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5606295', 'n_tokens_mistral': 1677, 'n_tokens_neox': 1570, 'n_words': 416}