From 781e9e1cd04a9ef0208dfae2e1b87aca2ecdfad9 Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Sat, 23 Dec 2023 10:00:15 +0100 Subject: [PATCH] fix /video 404 page - closes #14262 still not looking great, but no longer broken. it will do --- app/controllers/Video.scala | 3 +-- app/views/video/bits.scala | 17 ++++++++--------- app/views/video/layout.scala | 3 +-- ui/site/css/_video.scss | 5 ----- 4 files changed, 10 insertions(+), 18 deletions(-) diff --git a/app/controllers/Video.scala b/app/controllers/Video.scala index b2c3b3d27045c..debf9ec83a5f3 100644 --- a/app/controllers/Video.scala +++ b/app/controllers/Video.scala @@ -37,7 +37,7 @@ final class Video(env: Env) extends LilaController(env): def show(id: String) = Open: WithUserControl: control => - api.video.find(id) flatMap { + api.video.find(id) flatMap: case None => NotFound.page(html.video.bits.notFound(control)) case Some(video) => api.video.similar(ctx.me, video, 9) zip @@ -46,7 +46,6 @@ final class Video(env: Env) extends LilaController(env): } flatMap { (similar, _) => Ok.page(html.video.show(video, similar, control)) } - } def author(author: String) = Open: WithUserControl: control => diff --git a/app/views/video/bits.scala b/app/views/video/bits.scala index d4ad1c85d56a0..87f9b330d4d7f 100644 --- a/app/views/video/bits.scala +++ b/app/views/video/bits.scala @@ -57,15 +57,14 @@ object bits: def notFound(control: lila.video.UserControl)(using PageContext) = layout(title = "Video not found", control = control)( - div(cls := "content_box_top")( - a(cls := "is4 text", dataIcon := licon.Back, href := routes.Video.index)("Video library") - ), - div(cls := "not_found")( - h1("Video Not Found!"), - br, - br, - a(cls := "big button text", dataIcon := licon.Back, href := routes.Video.index)( - "Return to the video library" + boxTop( + h1( + a( + cls := "is4 text", + dataIcon := licon.Back, + href := s"${routes.Video.index}" + ), + "Video Not Found!" ) ) ) diff --git a/app/views/video/layout.scala b/app/views/video/layout.scala index 234a88570cc29..d049f09b6fe30 100644 --- a/app/views/video/layout.scala +++ b/app/views/video/layout.scala @@ -18,7 +18,7 @@ object layout: moreJs = infiniteScrollTag, wrapClass = "full-screen-force", openGraph = openGraph - ) { + ): main(cls := "video page-menu force-ltr")( st.aside(cls := "page-menu__menu")( views.html.site.bits.subnav( @@ -44,4 +44,3 @@ object layout: ), div(cls := "page-menu__content box")(body) ) - } diff --git a/ui/site/css/_video.scss b/ui/site/css/_video.scss index c6d3a847ca0e6..7739ea66ff206 100644 --- a/ui/site/css/_video.scss +++ b/ui/site/css/_video.scss @@ -257,11 +257,6 @@ } #video { - .not_found { - margin-top: 200px; - text-align: center; - } - .not_much { margin-top: 100px; text-align: center;