Skip to content

Commit

Permalink
fix /video 404 page - closes lichess-org#14262
Browse files Browse the repository at this point in the history
still not looking great, but no longer broken. it will do
  • Loading branch information
ornicar committed Dec 23, 2023
1 parent 51e0256 commit 781e9e1
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 18 deletions.
3 changes: 1 addition & 2 deletions app/controllers/Video.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 =>
Expand Down
17 changes: 8 additions & 9 deletions app/views/video/bits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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!"
)
)
)
Expand Down
3 changes: 1 addition & 2 deletions app/views/video/layout.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -44,4 +44,3 @@ object layout:
),
div(cls := "page-menu__content box")(body)
)
}
5 changes: 0 additions & 5 deletions ui/site/css/_video.scss
Original file line number Diff line number Diff line change
Expand Up @@ -257,11 +257,6 @@
}

#video {
.not_found {
margin-top: 200px;
text-align: center;
}

.not_much {
margin-top: 100px;
text-align: center;
Expand Down

0 comments on commit 781e9e1

Please sign in to comment.