1
0
Fork 0

Client: add titles to all pages

This commit is contained in:
Chocobozzz 2016-11-04 17:25:26 +01:00
parent 3154f38219
commit b58c69a1ed
9 changed files with 80 additions and 10 deletions

View File

@ -53,6 +53,7 @@
"json-loader": "^0.5.4",
"ng2-bootstrap": "1.1.16",
"ng2-file-upload": "^1.1.0",
"ng2-meta": "github:chocobozzz/ng2-meta",
"node-sass": "^3.10.0",
"normalize.css": "^5.0.0",
"raw-loader": "^0.5.1",

View File

@ -1,5 +1,13 @@
import { AccountComponent } from './account.component';
export const AccountRoutes = [
{ path: 'account', component: AccountComponent }
{
path: 'account',
component: AccountComponent,
data: {
meta: {
titleSuffix: ' - My account'
}
}
}
];

View File

@ -16,11 +16,21 @@ export const FriendsRoutes: Routes = [
},
{
path: 'list',
component: FriendListComponent
component: FriendListComponent,
data: {
meta: {
titleSuffix: ' - Friends list'
}
}
},
{
path: 'add',
component: FriendAddComponent
component: FriendAddComponent,
data: {
meta: {
titleSuffix: ' - Add friends'
}
}
}
]
}

View File

@ -15,7 +15,12 @@ export const RequestsRoutes: Routes = [
},
{
path: 'stats',
component: RequestStatsComponent
component: RequestStatsComponent,
data: {
meta: {
titleSuffix: ' - Request stats'
}
}
}
]
}

View File

@ -16,11 +16,21 @@ export const UsersRoutes: Routes = [
},
{
path: 'list',
component: UserListComponent
component: UserListComponent,
data: {
meta: {
titleSuffix: ' - Users list'
}
}
},
{
path: 'add',
component: UserAddComponent
component: UserAddComponent,
data: {
meta: {
titleSuffix: ' - Add a user'
}
}
}
]
}

View File

@ -1,6 +1,7 @@
import { Component, ViewContainerRef } from '@angular/core';
import { Router } from '@angular/router';
import { MetaService } from 'ng2-meta';
@Component({
selector: 'my-app',
templateUrl: './app.component.html',
@ -10,6 +11,7 @@ import { Router } from '@angular/router';
export class AppComponent {
constructor(
private router: Router,
private metaService: MetaService,
viewContainerRef: ViewContainerRef
) {}

View File

@ -6,12 +6,16 @@ import { RouterModule } from '@angular/router';
import { removeNgStyles, createNewHosts } from '@angularclass/hmr';
import { BytesPipe } from 'angular-pipes/src/math/bytes.pipe';
import { DropdownModule } from 'ng2-bootstrap/components/dropdown';
import { ProgressbarModule } from 'ng2-bootstrap/components/progressbar';
import { PaginationModule } from 'ng2-bootstrap/components/pagination';
import { ModalModule } from 'ng2-bootstrap/components/modal';
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
import { MetaConfig, MetaModule } from 'ng2-meta';
/*
* Platform and Environment providers/directives/pipes
*/
@ -52,6 +56,15 @@ import {
WebTorrentService
} from './videos';
const metaConfig: MetaConfig = {
//Append a title suffix such as a site name to all titles
//Defaults to false
useTitleSuffix: true,
defaults: {
title: 'PeerTube'
}
};
// Application wide providers
const APP_PROVIDERS = [
AppState,
@ -117,7 +130,10 @@ const APP_PROVIDERS = [
ProgressbarModule,
PaginationModule,
ModalModule,
FileUploadModule
FileUploadModule,
MetaModule.forRoot(metaConfig)
],
providers: [ // expose our Services and Providers into Angular's dependency injection
ENV_PROVIDERS,

View File

@ -1,5 +1,13 @@
import { LoginComponent } from './login.component';
export const LoginRoutes = [
{ path: 'login', component: LoginComponent }
{
path: 'login',
component: LoginComponent,
data: {
meta: {
titleSuffix: ' - Login'
}
}
}
];

View File

@ -12,11 +12,21 @@ export const VideosRoutes: Routes = [
children: [
{
path: 'list',
component: VideoListComponent
component: VideoListComponent,
data: {
meta: {
titleSuffix: ' - Videos list'
}
}
},
{
path: 'add',
component: VideoAddComponent
component: VideoAddComponent,
data: {
meta: {
titleSuffix: ' - Add a video'
}
}
},
{
path: 'watch/:id',