<?php
$this->angular([
    'angular-route.js',
    'ui-bootstrap-custom-tpls-0.7.0.js',
    'ui-bootstrap-custom-tpls-0.7.0.bs4.js',
    'pi.js',
    'i18n',
]);
?>
<script>
    angular
        .module('<?php echo $module; ?>', ['ngRoute', 'ui.bootstrap', 'pi'])
        .constant('config', {
            urlRoot: '<?php echo $this->url('', ['controller' => 'index', 'action' => 'var']); ?>'.replace(/var\/?$/, ''),
            editUrlRoot: '<?php echo $this->url('', ['controller' => 'edit']); ?>',
            viewUrlRoot: '<?php echo $this->url('', ['controller' => 'view']); ?>',
            assetRoot: '<?php echo $this->assetModule('ng-template/admin/', '', false); ?>',
            t: {
                ACTIVE_STATUS: '<?php echo _a('Active State'); ?>',
                ENABLE_STATUS: '<?php echo _a('Enable State'); ?>',
                SELECT_ROLES: '<?php echo _a('Select roles'); ?>',
                APPLY: '<?php echo _a('Apply'); ?>',
                USERNAME: '<?php echo _a('Username'); ?>',
                DISPLAYNAME: '<?php echo _a('Display name'); ?>',
                ENABLED: '<?php echo _a('Enabled'); ?>',
                DISABLED: '<?php echo _a('Disabled'); ?>',
                ACTIVATED: '<?php echo _a('Activated'); ?>',
                ACTIVE: '<?php echo _a('Active'); ?>',
                INACTIVE: '<?php echo _a('Inactive'); ?>',
                PENDING: '<?php echo _a('Pending'); ?>',
                ROLE: '<?php echo _a('Role'); ?>',
                REGISTER_TIME: '<?php echo _a('Register time'); ?>',
                REGISTER_TIME_FROM: '<?php echo _a('Register time from'); ?>',
                REGISTER_TIME_TO: '<?php echo _a('Register time to'); ?>',
                ACTION: '<?php echo _a('Action'); ?>',
                EDIT: '<?php echo _a('Edit'); ?>',
                DELETE: '<?php echo _a('Delete'); ?>',
                ADD_TITLE: '<?php echo _a('Add user'); ?>',
                PASSWORD_MATCH: '<?php echo _a("Passwords don\'t match."); ?>',
                USERNAME_TAKEN: '<?php echo _a('Username is already taken.'); ?>',
                EMAIL_TAKEN: '<?php echo _a('Email is already taken.'); ?>',
                DISPLAYNAME_TAKEN: '<?php echo _a('Display name is already taken.'); ?>',
                RETURN: '<?php echo _a('Back to users list'); ?>',
                REQUIRED: '<?php echo _a('Required'); ?>',
                USERNAME: '<?php echo _a('Username'); ?>',
                EMAIL: '<?php echo _a('Email'); ?>',
                INVALID_EMAIL: '<?php echo _a('Email invalid'); ?>',
                PASSWORD: '<?php echo _a('Password'); ?>',
                CONFIRM_PASSWORD: '<?php echo _a('Password confirm'); ?>',
                ACTIVATE: '<?php echo _a('Active'); ?>',
                ENABLE: '<?php echo _a('Enable'); ?>',
                DISABLE: '<?php echo _a('Disable'); ?>',
                FRONT_ROLE: '<?php echo _a('Front role'); ?>',
                ADMIN_ROLE: '<?php echo _a('Admin role'); ?>',
                TODAY: '<?php echo _a('Today'); ?>',
                LAST_WEEK: '<?php echo _a('Last week'); ?>',
                LAST_MONTH: '<?php echo _a('Last month'); ?>',
                LAST_3_MONTH: '<?php echo _a('Last three months'); ?>',
                LAST_6_MONTH: '<?php echo _a('Last six months'); ?>',
                LAST_YEAR: '<?php echo _a('Last year'); ?>',
                ASSIGN_ROLE: '<?php echo _a('Assign role'); ?>',
                UNASSIGN_ROLE: '<?php echo _a('Remove role'); ?>',
                ASSIGN_FRONT_ROLE: '<?php echo _a('Front role'); ?>',
                ASSIGN_ADMIN_ROLE: '<?php echo _a('Admin role'); ?>',
                CONFIRM: '<?php echo _a('Are you sure to delete this user?'); ?>',
                CONFIRMS: '<?php echo _a('Are you sure to delete these users?'); ?>',
                ACTIVE_STATE: '<?php echo _a('Active State'); ?>',
                TITLE: '<?php echo _a('Add user'); ?>',
                USERNAME: '<?php echo _a('Username'); ?>',
                CONFIRM_ACTIVATED: '<?php echo _a('Are you sure to activate this account? It can not be reverted.'); ?>',
                CONFIRM_ACTIVATED_BATCH: '<?php echo _a('Are you sure to activate these accounts? It can not be reverted.'); ?>',
                BATCH_CHECKED: '<?php echo _a('Choose at least one item before submission.'); ?>',
                EMAIL: '<?php echo _a('Email'); ?>',
                PASSWORD: '<?php echo _a('Password'); ?>',
                CONFIRM_PASSWORD: '<?php echo _a('Confirm password'); ?>',
                ACTIVATE: '<?php echo _a('Activate'); ?>',
                SUBMIT: '<?php echo _a('Submit'); ?>',
                REQUIRED: '<?php echo _a('Required'); ?>',
                //INVALID_EMAIL: '<?php echo _a('Invalid email.'); ?>',
                //REGISTER_IP: '<?php echo _a('Register IP'); ?>',
                ACTIVATION_STATUS: '<?php echo _a('Activation state'); ?>',
                USER_ID: '<?php echo _a('User ID'); ?>',
                NONE_USER: '<?php echo _a('No user matched your request.'); ?>',
                SEARCH_TITLE: '<?php echo _a('Advanced search'); ?>',
                REGISTER_IP: '<?php echo _a('Register IP'); ?>',
                SEARCH_RESULT: '<?php echo _a('Search result'); ?>',
                VIEW_LOG: '<?php echo _a('View log'); ?>',
                NONE_PENDING_USERS: '<?php echo _a('No pending user.'); ?>',
                EDIT_TITLE: '<?php echo _a('Edit user'); ?>',
                REPLACE_AVATAR: '<?php echo _a('Replace with default avatar.'); ?>',
                COMPOUND_CONFIRM: '<?php echo _a('Are you sure to delete this group?'); ?>',
                VIEW: '<?php echo _a('View'); ?>'
            },
            roles: <?php echo json_encode($roles); ?>,
            today: '<?php echo date("Y-m-d"); ?>'
        });
</script>
<script src="<?php echo $this->assetModule('admin/user.js'); ?>"></script>