From c0e3d9ff9019fc3af9791bd20e1430724b2a043a Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 8 Jul 2022 10:32:33 +0200 Subject: Rename not fount page to error page --- .../page-not-found-routing.module.ts | 24 --------- .../+page-not-found/page-not-found.component.html | 61 ---------------------- .../+page-not-found/page-not-found.component.scss | 57 -------------------- .../+page-not-found/page-not-found.component.ts | 46 ---------------- .../app/+page-not-found/page-not-found.module.ts | 23 -------- 5 files changed, 211 deletions(-) delete mode 100644 client/src/app/+page-not-found/page-not-found-routing.module.ts delete mode 100644 client/src/app/+page-not-found/page-not-found.component.html delete mode 100644 client/src/app/+page-not-found/page-not-found.component.scss delete mode 100644 client/src/app/+page-not-found/page-not-found.component.ts delete mode 100644 client/src/app/+page-not-found/page-not-found.module.ts (limited to 'client/src/app/+page-not-found') diff --git a/client/src/app/+page-not-found/page-not-found-routing.module.ts b/client/src/app/+page-not-found/page-not-found-routing.module.ts deleted file mode 100644 index 84f400bb6..000000000 --- a/client/src/app/+page-not-found/page-not-found-routing.module.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { NgModule } from '@angular/core' -import { RouterModule, Routes } from '@angular/router' -import { PageNotFoundComponent } from './page-not-found.component' -import { MenuGuards } from '@app/core' - -const pageNotFoundRoutes: Routes = [ - { - path: '', - component: PageNotFoundComponent, - canActivate: [ MenuGuards.close(true) ], - canDeactivate: [ MenuGuards.open(true) ], - data: { - meta: { - title: $localize`Not found` - } - } - } -] - -@NgModule({ - imports: [ RouterModule.forChild(pageNotFoundRoutes) ], - exports: [ RouterModule ] -}) -export class PageNotFoundRoutingModule {} diff --git a/client/src/app/+page-not-found/page-not-found.component.html b/client/src/app/+page-not-found/page-not-found.component.html deleted file mode 100644 index b950b8640..000000000 --- a/client/src/app/+page-not-found/page-not-found.component.html +++ /dev/null @@ -1,61 +0,0 @@ -
-
- {{ status }}. - That's an error. - -
- We couldn't find any video tied to the URL {{ pathname }} you were looking for. - We couldn't find any resource tied to the URL {{ pathname }} you were looking for. -
- -
- Possible reasons: - -
    -
  • You may have used an outdated or broken link
  • -
  • - The video may have been moved or deleted - The resource may have been moved or deleted -
  • -
  • You may have typed the address or URL incorrectly
  • -
-
-
- -
- {{ status }}. - You are not authorized here. - -
- You might need to login to see the video. - You might need to login to see the resource. -
- - - Login - - -
- -
- {{ status }}. - You are not authorized here. - -
- You might need to check your account is allowed by the video or instance owner. - You might need to check your account is allowed by the resource or instance owner. -
-
- -
- {{ status }}. - I'm a teapot. - -
- The requested entity body blends sweet bits with a mellow earthiness. -
-
Sepia seems to like it.
-
- - {{ status }} mascot -
diff --git a/client/src/app/+page-not-found/page-not-found.component.scss b/client/src/app/+page-not-found/page-not-found.component.scss deleted file mode 100644 index efb81ff00..000000000 --- a/client/src/app/+page-not-found/page-not-found.component.scss +++ /dev/null @@ -1,57 +0,0 @@ -@use '_variables' as *; -@use '_mixins' as *; - -.root { - @include margin-left(auto); - @include margin-right(auto); - - height: 100%; - text-align: center; - padding-top: 150px; - display: flex; - justify-content: center; - flex-direction: column-reverse; - - .box { - text-align: start; - font-size: 120%; - padding: 0 15px; - } - - img { - @include margin-left(auto); - - width: 220px; - height: auto; - } - - @media screen and (max-width: $mobile-view) { - img { - @include margin-right(auto); - } - } - - @media screen and (min-width: $mobile-view) { - width: 400px; - } - - @media screen and (min-width: #{breakpoint(lg)}) { - width: 600px; - } - - @media screen and (min-width: #{breakpoint(xl)}) { - width: 700px; - } - - @media screen and (min-width: #{breakpoint(xxl)}) { - width: 800px; - } - - @media screen and (max-height: 600px) { - padding-top: 50px; - - img { - width: 160px; - } - } -} diff --git a/client/src/app/+page-not-found/page-not-found.component.ts b/client/src/app/+page-not-found/page-not-found.component.ts deleted file mode 100644 index 10645a634..000000000 --- a/client/src/app/+page-not-found/page-not-found.component.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { Component, OnInit } from '@angular/core' -import { Title } from '@angular/platform-browser' -import { Router } from '@angular/router' -import { HttpStatusCode } from '@shared/models' - -@Component({ - selector: 'my-page-not-found', - templateUrl: './page-not-found.component.html', - styleUrls: [ './page-not-found.component.scss' ] -}) -export class PageNotFoundComponent implements OnInit { - status = HttpStatusCode.NOT_FOUND_404 - type: 'video' | 'other' = 'other' - - public constructor ( - private titleService: Title, - private router: Router - ) { - const state = this.router.getCurrentNavigation()?.extras.state - this.type = state?.type || this.type - this.status = state?.obj.status || this.status - } - - ngOnInit () { - if (this.pathname.includes('teapot')) { - this.status = HttpStatusCode.I_AM_A_TEAPOT_418 - this.titleService.setTitle($localize`I'm a teapot` + ' - PeerTube') - } - } - - get pathname () { - return window.location.pathname - } - - getMascotName () { - switch (this.status) { - case HttpStatusCode.I_AM_A_TEAPOT_418: - return 'happy' - case HttpStatusCode.FORBIDDEN_403: - return 'arguing' - case HttpStatusCode.NOT_FOUND_404: - default: - return 'defeated' - } - } -} 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 @@ -import { CommonModule } from '@angular/common' -import { NgModule } from '@angular/core' -import { PageNotFoundRoutingModule } from './page-not-found-routing.module' -import { PageNotFoundComponent } from './page-not-found.component' - -@NgModule({ - imports: [ - CommonModule, - - PageNotFoundRoutingModule - ], - - declarations: [ - PageNotFoundComponent - ], - - exports: [ - PageNotFoundComponent - ], - - providers: [] -}) -export class PageNotFoundModule { } -- cgit v1.2.3