From f67b8cc2ceff09ea75c8985509d78c149be1ad8b Mon Sep 17 00:00:00 2001 From: Thibault Duplessis Date: Fri, 7 Feb 2020 14:42:56 -0600 Subject: [PATCH] /class translation WIP --- app/controllers/Clas.scala | 11 +++-------- app/views/clas/clas.scala | 15 +++++++++++---- modules/i18n/src/main/I18nKeys.scala | 8 +++++++- translation/source/class.xml | 11 +++++++---- 4 files changed, 28 insertions(+), 17 deletions(-) diff --git a/app/controllers/Clas.scala b/app/controllers/Clas.scala index 26817c9ea0..78fc657e8d 100644 --- a/app/controllers/Clas.scala +++ b/app/controllers/Clas.scala @@ -8,8 +8,7 @@ import views._ final class Clas( env: Env, - authC: Auth, - prismicC: Prismic + authC: Auth ) extends LilaController(env) { def index = Open { implicit ctx => @@ -36,13 +35,9 @@ final class Clas( } } - private def renderHome(implicit ctx: Context) = { + private def renderHome(implicit ctx: Context) = fuccess { pageHit - prismicC getBookmark "class" map { - _ ?? { - case (doc, resolver) => Ok(views.html.clas.clas.home(doc, resolver)) - } - } + Ok(views.html.clas.clas.home) } def form = Secure(_.Teacher) { implicit ctx => _ => diff --git a/app/views/clas/clas.scala b/app/views/clas/clas.scala index bb5dc654c9..d49c959271 100644 --- a/app/views/clas/clas.scala +++ b/app/views/clas/clas.scala @@ -11,7 +11,7 @@ import controllers.routes object clas { - def home(doc: io.prismic.Document, resolver: io.prismic.DocumentLinkResolver)(implicit ctx: Context) = + def home(implicit ctx: Context) = views.html.base.layout( moreCss = frag( cssTag("page"), @@ -22,11 +22,18 @@ object clas { main(cls := "page-small box box-pad page clas-home")( h1(trans.clas.lichessClasses()), div(cls := "clas-home__doc body")( - raw(~doc.getHtml("doc.content", resolver)) + p(trans.clas.teachClassesOfChessStudents()), + h2(trans.clas.features()), + ul( + li(trans.clas.quicklyGenerateSafeUsernames()), + li(trans.clas.trackStudentProgress()), + li(trans.clas.messageAllStudents()), + li(trans.clas.freeForAllForever()) + ) ), div(cls := "clas-home__onboard")( a(cls := "button button-fat", href := routes.Clas.verifyTeacher)( - "Apply for Lichess Teacher" + trans.clas.applyToBeLichessTeacher() ) ) ) @@ -36,7 +43,7 @@ object clas { bits.layout("Lichess Classes", Right("classes"))( cls := "clas-index", div(cls := "box__top")( - h1("Lichess Classes"), + h1(trans.clas.lichessClasses()), a( href := routes.Clas.form, cls := "new button button-empty", diff --git a/modules/i18n/src/main/I18nKeys.scala b/modules/i18n/src/main/I18nKeys.scala index 1d9f263c4d..0fcddd5278 100644 --- a/modules/i18n/src/main/I18nKeys.scala +++ b/modules/i18n/src/main/I18nKeys.scala @@ -1160,7 +1160,13 @@ val `pasteYourPgnTextHereUpToNbGames` = new Translated("pasteYourPgnTextHereUpTo object clas { val `lichessClasses` = new Translated("lichessClasses", Clas) -val `class` = new Translated("class", Clas) +val `teachClassesOfChessStudents` = new Translated("teachClassesOfChessStudents", Clas) +val `features` = new Translated("features", Clas) +val `quicklyGenerateSafeUsernames` = new Translated("quicklyGenerateSafeUsernames", Clas) +val `trackStudentProgress` = new Translated("trackStudentProgress", Clas) +val `messageAllStudents` = new Translated("messageAllStudents", Clas) +val `freeForAllForever` = new Translated("freeForAllForever", Clas) +val `applyToBeLichessTeacher` = new Translated("applyToBeLichessTeacher", Clas) } } diff --git a/translation/source/class.xml b/translation/source/class.xml index cf691efde1..b6ab437541 100644 --- a/translation/source/class.xml +++ b/translation/source/class.xml @@ -1,8 +1,11 @@ Lichess Classes - - Class - Classes - + Teach classes of chess students with the Lichess Classes tool suite. + Features + Quicly generate safe usernames and passwords for students + Track student progress in games and puzzles + Message all students about new class material + 100% free for all, forever, with no ads or trackers + Apply to be a Lichess Teacher