simplify routing

pull/7377/head
Thibault Duplessis 2020-09-27 23:16:05 +02:00
parent e67202b0cc
commit 05dfdd7237
5 changed files with 17 additions and 21 deletions

View File

@ -7,13 +7,10 @@ final class Page(
prismicC: Prismic
) extends LilaController(env) {
val thanks = helpBookmark("thanks")
val help = helpBookmark("help")
val about = helpBookmark("about")
val tos = helpBookmark("tos")
val privacy = helpBookmark("privacy")
val master = helpBookmark("master")
val ads = helpBookmark("ads")
val thanks = helpBookmark("thanks")
val help = helpBookmark("help")
val tos = helpBookmark("tos")
val master = helpBookmark("master")
private def helpBookmark(name: String) =
Open { implicit ctx =>

View File

@ -182,9 +182,9 @@ object home {
a(href := "/contact")(trans.contact.contact()),
a(href := "/mobile")(trans.mobileApp()),
a(href := routes.Page.tos())(trans.termsOfService()),
a(href := routes.Page.privacy())(trans.privacy()),
a(href := routes.Page.source())(trans.sourceCode()),
a(href := routes.Page.ads())("Ads"),
a(href := "/privacy")(trans.privacy()),
a(href := "/source")(trans.sourceCode()),
a(href := "/ads")("Ads"),
views.html.base.bits.connectLinks
)
)

View File

@ -311,8 +311,8 @@ object contact {
p("Please do not email us about marketing, tracking, or advertising."),
br,
p(
"We actively encourage everyone to ",
a(href := routes.Page.ads())("block all ads and trackers.")
"We encourage everyone to ",
a(href := "/ads")("block all ads and trackers.")
)
)
),

View File

@ -202,23 +202,23 @@ $('#asset-version-message').text(lichess.info.message);"""
def activeCls(c: String) = cls := active.activeO(c)
main(cls := "page-menu")(
st.nav(cls := "page-menu__menu subnav")(
a(activeCls("about"), href := routes.Page.about())(trans.aboutX("lichess.org")),
a(activeCls("about"), href := "/about")(trans.aboutX("lichess.org")),
a(activeCls("faq"), href := routes.Main.faq())(trans.faq.faqAbbreviation()),
a(activeCls("contact"), href := routes.Main.contact())(trans.contact.contact()),
a(activeCls("tos"), href := routes.Page.tos())(trans.termsOfService()),
a(activeCls("privacy"), href := routes.Page.privacy())(trans.privacy()),
a(activeCls("privacy"), href := "/privacy")(trans.privacy()),
a(activeCls("master"), href := routes.Page.master())("Title verification"),
sep,
a(activeCls("source"), href := routes.Page.source())(trans.sourceCode()),
a(activeCls("help"), href := routes.Page.help())(trans.contribute()),
a(activeCls("thanks"), href := routes.Page.thanks())(trans.thankYou()),
a(activeCls("thanks"), href := "/thanks")(trans.thankYou()),
sep,
a(activeCls("webmasters"), href := routes.Main.webmasters())(trans.webmasters()),
a(activeCls("database"), href := "https://database.lichess.org")(trans.database(), external),
a(activeCls("api"), href := routes.Api.index())("API", external),
sep,
a(activeCls("lag"), href := routes.Main.lag())(trans.lag.isLichessLagging()),
a(activeCls("ads"), href := routes.Page.ads())("Block ads")
a(activeCls("ads"), href := "/ads")("Block ads")
),
div(cls := s"page-menu__content $contentCls")(body)
)

View File

@ -691,18 +691,17 @@ POST /mobile/unregister controllers.Push.mobileUnregister
POST /push/subscribe controllers.Push.webSubscribe
# Pages
GET /thanks controllers.Page.thanks
GET /terms-of-service controllers.Page.tos
GET /privacy controllers.Page.privacy
GET /privacy controllers.Page.bookmark(bookmark = "privacy")
GET /contact controllers.Main.contact
GET /about controllers.Page.about
GET /about controllers.Page.bookmark(bookmark = "about")
GET /faq controllers.Main.faq
GET /source controllers.Page.source
GET /qa controllers.Main.movedPermanently(to: String = "/faq")
GET /help controllers.Main.movedPermanently(to: String = "/contact")
GET /qa/:id/:slug controllers.Main.legacyQaQuestion(id: Int, slug: String)
GET /how-to-cheat controllers.Page.bookmark(name = "how-to-cheat")
GET /ads controllers.Page.ads
GET /how-to-cheat controllers.Page.bookmark(bookmark = "how-to-cheat")
GET /ads controllers.Page.bookmark(bookmark = "ads")
GET /page/:bookmark controllers.Page.bookmark(bookmark: String)
# Variants