aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-11-04 17:25:26 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-11-04 17:25:26 +0100
commitb58c69a1edcf63b6339576b5b431dbf7dea2c625 (patch)
tree98f4fb17351db9bd737aabfe56c1ddbcf8b29ad3 /client/src/app
parent3154f38219ea6eb55532f38fee43d46821a020ee (diff)
downloadPeerTube-b58c69a1edcf63b6339576b5b431dbf7dea2c625.tar.gz
PeerTube-b58c69a1edcf63b6339576b5b431dbf7dea2c625.tar.zst
PeerTube-b58c69a1edcf63b6339576b5b431dbf7dea2c625.zip
Client: add titles to all pages
Diffstat (limited to 'client/src/app')
-rw-r--r--client/src/app/account/account.routes.ts10
-rw-r--r--client/src/app/admin/friends/friends.routes.ts14
-rw-r--r--client/src/app/admin/requests/requests.routes.ts7
-rw-r--r--client/src/app/admin/users/users.routes.ts14
-rw-r--r--client/src/app/app.component.ts2
-rw-r--r--client/src/app/app.module.ts18
-rw-r--r--client/src/app/login/login.routes.ts10
-rw-r--r--client/src/app/videos/videos.routes.ts14
8 files changed, 79 insertions, 10 deletions
diff --git a/client/src/app/account/account.routes.ts b/client/src/app/account/account.routes.ts
index e348c6ebe..c382a6deb 100644
--- a/client/src/app/account/account.routes.ts
+++ b/client/src/app/account/account.routes.ts
@@ -1,5 +1,13 @@
1import { AccountComponent } from './account.component'; 1import { AccountComponent } from './account.component';
2 2
3export const AccountRoutes = [ 3export const AccountRoutes = [
4 { path: 'account', component: AccountComponent } 4 {
5 path: 'account',
6 component: AccountComponent,
7 data: {
8 meta: {
9 titleSuffix: ' - My account'
10 }
11 }
12 }
5]; 13];
diff --git a/client/src/app/admin/friends/friends.routes.ts b/client/src/app/admin/friends/friends.routes.ts
index 7fdef68f9..a9a06539b 100644
--- a/client/src/app/admin/friends/friends.routes.ts
+++ b/client/src/app/admin/friends/friends.routes.ts
@@ -16,11 +16,21 @@ export const FriendsRoutes: Routes = [
16 }, 16 },
17 { 17 {
18 path: 'list', 18 path: 'list',
19 component: FriendListComponent 19 component: FriendListComponent,
20 data: {
21 meta: {
22 titleSuffix: ' - Friends list'
23 }
24 }
20 }, 25 },
21 { 26 {
22 path: 'add', 27 path: 'add',
23 component: FriendAddComponent 28 component: FriendAddComponent,
29 data: {
30 meta: {
31 titleSuffix: ' - Add friends'
32 }
33 }
24 } 34 }
25 ] 35 ]
26 } 36 }
diff --git a/client/src/app/admin/requests/requests.routes.ts b/client/src/app/admin/requests/requests.routes.ts
index 78221a9ff..70fbf41c3 100644
--- a/client/src/app/admin/requests/requests.routes.ts
+++ b/client/src/app/admin/requests/requests.routes.ts
@@ -15,7 +15,12 @@ export const RequestsRoutes: Routes = [
15 }, 15 },
16 { 16 {
17 path: 'stats', 17 path: 'stats',
18 component: RequestStatsComponent 18 component: RequestStatsComponent,
19 data: {
20 meta: {
21 titleSuffix: ' - Request stats'
22 }
23 }
19 } 24 }
20 ] 25 ]
21 } 26 }
diff --git a/client/src/app/admin/users/users.routes.ts b/client/src/app/admin/users/users.routes.ts
index eb71bd0ae..92e3e43e3 100644
--- a/client/src/app/admin/users/users.routes.ts
+++ b/client/src/app/admin/users/users.routes.ts
@@ -16,11 +16,21 @@ export const UsersRoutes: Routes = [
16 }, 16 },
17 { 17 {
18 path: 'list', 18 path: 'list',
19 component: UserListComponent 19 component: UserListComponent,
20 data: {
21 meta: {
22 titleSuffix: ' - Users list'
23 }
24 }
20 }, 25 },
21 { 26 {
22 path: 'add', 27 path: 'add',
23 component: UserAddComponent 28 component: UserAddComponent,
29 data: {
30 meta: {
31 titleSuffix: ' - Add a user'
32 }
33 }
24 } 34 }
25 ] 35 ]
26 } 36 }
diff --git a/client/src/app/app.component.ts b/client/src/app/app.component.ts
index 01d3f5deb..ce4fc04ff 100644
--- a/client/src/app/app.component.ts
+++ b/client/src/app/app.component.ts
@@ -1,6 +1,7 @@
1import { Component, ViewContainerRef } from '@angular/core'; 1import { Component, ViewContainerRef } from '@angular/core';
2import { Router } from '@angular/router'; 2import { Router } from '@angular/router';
3 3
4import { MetaService } from 'ng2-meta';
4@Component({ 5@Component({
5 selector: 'my-app', 6 selector: 'my-app',
6 templateUrl: './app.component.html', 7 templateUrl: './app.component.html',
@@ -10,6 +11,7 @@ import { Router } from '@angular/router';
10export class AppComponent { 11export class AppComponent {
11 constructor( 12 constructor(
12 private router: Router, 13 private router: Router,
14 private metaService: MetaService,
13 viewContainerRef: ViewContainerRef 15 viewContainerRef: ViewContainerRef
14 ) {} 16 ) {}
15 17
diff --git a/client/src/app/app.module.ts b/client/src/app/app.module.ts
index 939af6309..e40b66c5f 100644
--- a/client/src/app/app.module.ts
+++ b/client/src/app/app.module.ts
@@ -6,12 +6,16 @@ import { RouterModule } from '@angular/router';
6import { removeNgStyles, createNewHosts } from '@angularclass/hmr'; 6import { removeNgStyles, createNewHosts } from '@angularclass/hmr';
7 7
8import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe'; 8import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
9
9import { DropdownModule } from 'ng2-bootstrap/components/dropdown'; 10import { DropdownModule } from 'ng2-bootstrap/components/dropdown';
10import { ProgressbarModule } from 'ng2-bootstrap/components/progressbar'; 11import { ProgressbarModule } from 'ng2-bootstrap/components/progressbar';
11import { PaginationModule } from 'ng2-bootstrap/components/pagination'; 12import { PaginationModule } from 'ng2-bootstrap/components/pagination';
12import { ModalModule } from 'ng2-bootstrap/components/modal'; 13import { ModalModule } from 'ng2-bootstrap/components/modal';
14
13import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload'; 15import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
14 16
17import { MetaConfig, MetaModule } from 'ng2-meta';
18
15/* 19/*
16 * Platform and Environment providers/directives/pipes 20 * Platform and Environment providers/directives/pipes
17 */ 21 */
@@ -52,6 +56,15 @@ import {
52 WebTorrentService 56 WebTorrentService
53} from './videos'; 57} from './videos';
54 58
59const metaConfig: MetaConfig = {
60 //Append a title suffix such as a site name to all titles
61 //Defaults to false
62 useTitleSuffix: true,
63 defaults: {
64 title: 'PeerTube'
65 }
66};
67
55// Application wide providers 68// Application wide providers
56const APP_PROVIDERS = [ 69const APP_PROVIDERS = [
57 AppState, 70 AppState,
@@ -117,7 +130,10 @@ const APP_PROVIDERS = [
117 ProgressbarModule, 130 ProgressbarModule,
118 PaginationModule, 131 PaginationModule,
119 ModalModule, 132 ModalModule,
120 FileUploadModule 133
134 FileUploadModule,
135
136 MetaModule.forRoot(metaConfig)
121 ], 137 ],
122 providers: [ // expose our Services and Providers into Angular's dependency injection 138 providers: [ // expose our Services and Providers into Angular's dependency injection
123 ENV_PROVIDERS, 139 ENV_PROVIDERS,
diff --git a/client/src/app/login/login.routes.ts b/client/src/app/login/login.routes.ts
index 4f56d5eb2..2f63af5e2 100644
--- a/client/src/app/login/login.routes.ts
+++ b/client/src/app/login/login.routes.ts
@@ -1,5 +1,13 @@
1import { LoginComponent } from './login.component'; 1import { LoginComponent } from './login.component';
2 2
3export const LoginRoutes = [ 3export const LoginRoutes = [
4 { path: 'login', component: LoginComponent } 4 {
5 path: 'login',
6 component: LoginComponent,
7 data: {
8 meta: {
9 titleSuffix: ' - Login'
10 }
11 }
12 }
5]; 13];
diff --git a/client/src/app/videos/videos.routes.ts b/client/src/app/videos/videos.routes.ts
index 074f96596..ab68fbe0c 100644
--- a/client/src/app/videos/videos.routes.ts
+++ b/client/src/app/videos/videos.routes.ts
@@ -12,11 +12,21 @@ export const VideosRoutes: Routes = [
12 children: [ 12 children: [
13 { 13 {
14 path: 'list', 14 path: 'list',
15 component: VideoListComponent 15 component: VideoListComponent,
16 data: {
17 meta: {
18 titleSuffix: ' - Videos list'
19 }
20 }
16 }, 21 },
17 { 22 {
18 path: 'add', 23 path: 'add',
19 component: VideoAddComponent 24 component: VideoAddComponent,
25 data: {
26 meta: {
27 titleSuffix: ' - Add a video'
28 }
29 }
20 }, 30 },
21 { 31 {
22 path: 'watch/:id', 32 path: 'watch/:id',