|
1 |
| -import { routes, ng } from 'entcore'; |
2 |
| -import { accountController } from './controllers/account'; |
3 |
| -import { classAdminController } from './admin/controller'; |
4 |
| -import { directoryController } from './controllers/directory'; |
5 |
| -import { adaptiveHeight } from './directives/adaptiveHeight'; |
| 1 | +import { ng, routes } from "entcore"; |
| 2 | +import { classAdminController } from "./admin/controller"; |
| 3 | +import { accountController } from "./controllers/account"; |
| 4 | +import { directoryController } from "./controllers/directory"; |
| 5 | +import { adaptiveHeight } from "./directives/adaptiveHeight"; |
| 6 | +import { intlPhoneInputDirective } from "./directives/intlPhoneInput"; |
6 | 7 |
|
7 | 8 | routes.define(function ($routeProvider) {
|
8 |
| - if (window.location.href.indexOf('mon-compte') !== -1) { |
9 |
| - $routeProvider |
10 |
| - .when('/edit-user/:id', { |
11 |
| - action: 'editUser' |
12 |
| - }) |
13 |
| - .when('/edit-user-infos/:id', { |
14 |
| - action: 'editUserInfos' |
15 |
| - }) |
16 |
| - .when('/edit-me', { |
17 |
| - action: 'editMe' |
18 |
| - }) |
19 |
| - .when('/themes', { |
20 |
| - action: 'themes' |
21 |
| - }) |
22 |
| - .otherwise({ |
23 |
| - redirectTo: 'edit-me' |
24 |
| - }); |
25 |
| - } |
26 |
| - else { |
27 |
| - $routeProvider |
28 |
| - .when('/search', { |
29 |
| - action: 'directory' |
30 |
| - }) |
31 |
| - .when('/myClass', { |
32 |
| - action: 'myClass' |
33 |
| - }) |
34 |
| - .when("/user-view/:userId", { |
35 |
| - action: "viewUser" |
36 |
| - }) |
37 |
| - .when('/:userId', { |
38 |
| - action: 'viewUser' |
39 |
| - }) |
40 |
| - .when('/group-view/:groupId', { |
41 |
| - action: 'viewGroup' |
42 |
| - }) |
43 |
| - .otherwise({ |
44 |
| - redirectTo: '/myClass' |
45 |
| - }); |
46 |
| - } |
| 9 | + if (window.location.href.indexOf("mon-compte") !== -1) { |
| 10 | + $routeProvider |
| 11 | + .when("/edit-user/:id", { |
| 12 | + action: "editUser", |
| 13 | + }) |
| 14 | + .when("/edit-user-infos/:id", { |
| 15 | + action: "editUserInfos", |
| 16 | + }) |
| 17 | + .when("/edit-me", { |
| 18 | + action: "editMe", |
| 19 | + }) |
| 20 | + .when("/themes", { |
| 21 | + action: "themes", |
| 22 | + }) |
| 23 | + .otherwise({ |
| 24 | + redirectTo: "edit-me", |
| 25 | + }); |
| 26 | + } else { |
| 27 | + $routeProvider |
| 28 | + .when("/search", { |
| 29 | + action: "directory", |
| 30 | + }) |
| 31 | + .when("/myClass", { |
| 32 | + action: "myClass", |
| 33 | + }) |
| 34 | + .when("/user-view/:userId", { |
| 35 | + action: "viewUser", |
| 36 | + }) |
| 37 | + .when("/:userId", { |
| 38 | + action: "viewUser", |
| 39 | + }) |
| 40 | + .when("/group-view/:groupId", { |
| 41 | + action: "viewGroup", |
| 42 | + }) |
| 43 | + .otherwise({ |
| 44 | + redirectTo: "/myClass", |
| 45 | + }); |
| 46 | + } |
47 | 47 | });
|
48 | 48 |
|
49 | 49 | ng.controllers.push(accountController);
|
50 | 50 | ng.controllers.push(classAdminController);
|
51 | 51 | ng.controllers.push(directoryController);
|
52 | 52 | ng.directives.push(adaptiveHeight);
|
| 53 | +ng.directives.push(intlPhoneInputDirective); |
0 commit comments