aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-07-08 10:32:33 +0200
committerChocobozzz <me@florianbigard.com>2022-07-08 10:58:05 +0200
commitc0e3d9ff9019fc3af9791bd20e1430724b2a043a (patch)
treec43204bf44440eda4775fd1c3355f69bfeecb76e /client/src
parentc482d2b7a6c59867973291f3ea3eca7d2db87d2a (diff)
downloadPeerTube-c0e3d9ff9019fc3af9791bd20e1430724b2a043a.tar.gz
PeerTube-c0e3d9ff9019fc3af9791bd20e1430724b2a043a.tar.zst
PeerTube-c0e3d9ff9019fc3af9791bd20e1430724b2a043a.zip
Rename not fount page to error page
Diffstat (limited to 'client/src')
-rw-r--r--client/src/app/+error-page/error-page-routing.module.ts (renamed from client/src/app/+page-not-found/page-not-found-routing.module.ts)10
-rw-r--r--client/src/app/+error-page/error-page.component.html (renamed from client/src/app/+page-not-found/page-not-found.component.html)2
-rw-r--r--client/src/app/+error-page/error-page.component.scss (renamed from client/src/app/+page-not-found/page-not-found.component.scss)12
-rw-r--r--client/src/app/+error-page/error-page.component.ts (renamed from client/src/app/+page-not-found/page-not-found.component.ts)8
-rw-r--r--client/src/app/+error-page/error-page.module.ts23
-rw-r--r--client/src/app/+page-not-found/page-not-found.module.ts23
-rw-r--r--client/src/app/app-routing.module.ts2
-rw-r--r--client/src/app/core/routing/redirect.service.ts2
-rw-r--r--client/src/app/shared/shared-main/auth/auth-interceptor.service.ts2
-rw-r--r--client/src/sass/class-helpers.scss8
-rw-r--r--client/src/sass/include/_mixins.scss7
11 files changed, 51 insertions, 48 deletions
diff --git a/client/src/app/+page-not-found/page-not-found-routing.module.ts b/client/src/app/+error-page/error-page-routing.module.ts
index 84f400bb6..a81f6c756 100644
--- a/client/src/app/+page-not-found/page-not-found-routing.module.ts
+++ b/client/src/app/+error-page/error-page-routing.module.ts
@@ -1,12 +1,12 @@
1import { NgModule } from '@angular/core' 1import { NgModule } from '@angular/core'
2import { RouterModule, Routes } from '@angular/router' 2import { RouterModule, Routes } from '@angular/router'
3import { PageNotFoundComponent } from './page-not-found.component' 3import { ErrorPageComponent } from './error-page.component'
4import { MenuGuards } from '@app/core' 4import { MenuGuards } from '@app/core'
5 5
6const pageNotFoundRoutes: Routes = [ 6const errorPageRoutes: Routes = [
7 { 7 {
8 path: '', 8 path: '',
9 component: PageNotFoundComponent, 9 component: ErrorPageComponent,
10 canActivate: [ MenuGuards.close(true) ], 10 canActivate: [ MenuGuards.close(true) ],
11 canDeactivate: [ MenuGuards.open(true) ], 11 canDeactivate: [ MenuGuards.open(true) ],
12 data: { 12 data: {
@@ -18,7 +18,7 @@ const pageNotFoundRoutes: Routes = [
18] 18]
19 19
20@NgModule({ 20@NgModule({
21 imports: [ RouterModule.forChild(pageNotFoundRoutes) ], 21 imports: [ RouterModule.forChild(errorPageRoutes) ],
22 exports: [ RouterModule ] 22 exports: [ RouterModule ]
23}) 23})
24export class PageNotFoundRoutingModule {} 24export class ErrorPageRoutingModule {}
diff --git a/client/src/app/+page-not-found/page-not-found.component.html b/client/src/app/+error-page/error-page.component.html
index b950b8640..070985d3c 100644
--- a/client/src/app/+page-not-found/page-not-found.component.html
+++ b/client/src/app/+error-page/error-page.component.html
@@ -31,7 +31,7 @@
31 <ng-container *ngIf="type !== 'video'" i18n>You might need to login to see the resource.</ng-container> 31 <ng-container *ngIf="type !== 'video'" i18n>You might need to login to see the resource.</ng-container>
32 </div> 32 </div>
33 33
34 <a class="peertube-button-link orange-button mt-5" i18n routerLink="/login"> 34 <a class="peertube-button-big-link orange-button mt-5" i18n routerLink="/login">
35 Login 35 Login
36 </a> 36 </a>
37 37
diff --git a/client/src/app/+page-not-found/page-not-found.component.scss b/client/src/app/+error-page/error-page.component.scss
index efb81ff00..4e12e8c78 100644
--- a/client/src/app/+page-not-found/page-not-found.component.scss
+++ b/client/src/app/+error-page/error-page.component.scss
@@ -35,18 +35,6 @@
35 width: 400px; 35 width: 400px;
36 } 36 }
37 37
38 @media screen and (min-width: #{breakpoint(lg)}) {
39 width: 600px;
40 }
41
42 @media screen and (min-width: #{breakpoint(xl)}) {
43 width: 700px;
44 }
45
46 @media screen and (min-width: #{breakpoint(xxl)}) {
47 width: 800px;
48 }
49
50 @media screen and (max-height: 600px) { 38 @media screen and (max-height: 600px) {
51 padding-top: 50px; 39 padding-top: 50px;
52 40
diff --git a/client/src/app/+page-not-found/page-not-found.component.ts b/client/src/app/+error-page/error-page.component.ts
index 10645a634..4fee01350 100644
--- a/client/src/app/+page-not-found/page-not-found.component.ts
+++ b/client/src/app/+error-page/error-page.component.ts
@@ -4,11 +4,11 @@ import { Router } from '@angular/router'
4import { HttpStatusCode } from '@shared/models' 4import { HttpStatusCode } from '@shared/models'
5 5
6@Component({ 6@Component({
7 selector: 'my-page-not-found', 7 selector: 'my-error-page',
8 templateUrl: './page-not-found.component.html', 8 templateUrl: './error-page.component.html',
9 styleUrls: [ './page-not-found.component.scss' ] 9 styleUrls: [ './error-page.component.scss' ]
10}) 10})
11export class PageNotFoundComponent implements OnInit { 11export class ErrorPageComponent implements OnInit {
12 status = HttpStatusCode.NOT_FOUND_404 12 status = HttpStatusCode.NOT_FOUND_404
13 type: 'video' | 'other' = 'other' 13 type: 'video' | 'other' = 'other'
14 14
diff --git a/client/src/app/+error-page/error-page.module.ts b/client/src/app/+error-page/error-page.module.ts
new file mode 100644
index 000000000..807c6f5a9
--- /dev/null
+++ b/client/src/app/+error-page/error-page.module.ts
@@ -0,0 +1,23 @@
1import { CommonModule } from '@angular/common'
2import { NgModule } from '@angular/core'
3import { ErrorPageRoutingModule } from './error-page-routing.module'
4import { ErrorPageComponent } from './error-page.component'
5
6@NgModule({
7 imports: [
8 CommonModule,
9
10 ErrorPageRoutingModule
11 ],
12
13 declarations: [
14 ErrorPageComponent
15 ],
16
17 exports: [
18 ErrorPageComponent
19 ],
20
21 providers: []
22})
23export class ErrorPageModule { }
diff --git a/client/src/app/+page-not-found/page-not-found.module.ts b/client/src/app/+page-not-found/page-not-found.module.ts
deleted file mode 100644
index 2e09ab299..000000000
--- a/client/src/app/+page-not-found/page-not-found.module.ts
+++ /dev/null
@@ -1,23 +0,0 @@
1import { CommonModule } from '@angular/common'
2import { NgModule } from '@angular/core'
3import { PageNotFoundRoutingModule } from './page-not-found-routing.module'
4import { PageNotFoundComponent } from './page-not-found.component'
5
6@NgModule({
7 imports: [
8 CommonModule,
9
10 PageNotFoundRoutingModule
11 ],
12
13 declarations: [
14 PageNotFoundComponent
15 ],
16
17 exports: [
18 PageNotFoundComponent
19 ],
20
21 providers: []
22})
23export class PageNotFoundModule { }
diff --git a/client/src/app/app-routing.module.ts b/client/src/app/app-routing.module.ts
index a9d9c723a..40e4ec35d 100644
--- a/client/src/app/app-routing.module.ts
+++ b/client/src/app/app-routing.module.ts
@@ -194,7 +194,7 @@ for (const locale of POSSIBLE_LOCALES) {
194 194
195routes.push({ 195routes.push({
196 path: '**', 196 path: '**',
197 loadChildren: () => import('./+page-not-found/page-not-found.module').then(m => m.PageNotFoundModule) 197 loadChildren: () => import('./+error-page/error-page.module').then(m => m.ErrorPageModule)
198}) 198})
199 199
200@NgModule({ 200@NgModule({
diff --git a/client/src/app/core/routing/redirect.service.ts b/client/src/app/core/routing/redirect.service.ts
index db4b35018..567fd432b 100644
--- a/client/src/app/core/routing/redirect.service.ts
+++ b/client/src/app/core/routing/redirect.service.ts
@@ -46,7 +46,7 @@ export class RedirectService {
46 this.currentUrl = this.router.url 46 this.currentUrl = this.router.url
47 router.events.subscribe(event => { 47 router.events.subscribe(event => {
48 if (event instanceof NavigationEnd || event instanceof NavigationCancel) { 48 if (event instanceof NavigationEnd || event instanceof NavigationCancel) {
49 if (event.url === '/404') return 49 if ([ '/401', '/404' ].includes(event.url)) return
50 50
51 this.previousUrl = this.currentUrl 51 this.previousUrl = this.currentUrl
52 this.currentUrl = event.url 52 this.currentUrl = event.url
diff --git a/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts
index 7daf31a98..e4b74f3ad 100644
--- a/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts
+++ b/client/src/app/shared/shared-main/auth/auth-interceptor.service.ts
@@ -62,7 +62,7 @@ export class AuthInterceptor implements HttpInterceptor {
62 } 62 }
63 63
64 private handleNotAuthenticated (err: HttpErrorResponse): Observable<any> { 64 private handleNotAuthenticated (err: HttpErrorResponse): Observable<any> {
65 this.router.navigate([ '/404' ], { state: { obj: err }, skipLocationChange: true }) 65 this.router.navigate([ '/401' ], { state: { obj: err }, skipLocationChange: true })
66 return of(err.message) 66 return of(err.message)
67 } 67 }
68} 68}
diff --git a/client/src/sass/class-helpers.scss b/client/src/sass/class-helpers.scss
index c67179ccb..72381d1a8 100644
--- a/client/src/sass/class-helpers.scss
+++ b/client/src/sass/class-helpers.scss
@@ -27,10 +27,18 @@
27 @include peertube-button; 27 @include peertube-button;
28} 28}
29 29
30.peertube-button-big {
31 @include peertube-button-big;
32}
33
30.peertube-button-link { 34.peertube-button-link {
31 @include peertube-button-link; 35 @include peertube-button-link;
32} 36}
33 37
38.peertube-button-big-link {
39 @include peertube-button-big-link;
40}
41
34.orange-button { 42.orange-button {
35 @include orange-button; 43 @include orange-button;
36} 44}
diff --git a/client/src/sass/include/_mixins.scss b/client/src/sass/include/_mixins.scss
index 6b93a5728..9d3700e15 100644
--- a/client/src/sass/include/_mixins.scss
+++ b/client/src/sass/include/_mixins.scss
@@ -284,6 +284,13 @@
284 display: inline-block; 284 display: inline-block;
285} 285}
286 286
287@mixin peertube-button-big-link {
288 @include disable-default-a-behaviour;
289 @include peertube-button-big;
290
291 display: inline-block;
292}
293
287@mixin peertube-button-outline { 294@mixin peertube-button-outline {
288 @include disable-default-a-behaviour; 295 @include disable-default-a-behaviour;
289 @include peertube-button; 296 @include peertube-button;