/class translation WIP

pull/5998/head
Thibault Duplessis 2020-02-07 14:42:56 -06:00
parent d6419b4b8e
commit f67b8cc2ce
4 changed files with 28 additions and 17 deletions

View File

@ -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 => _ =>

View File

@ -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",

View File

@ -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)
}
}

View File

@ -1,8 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<resources>
<string name="lichessClasses">Lichess Classes</string>
<plurals name="class">
<item quantity="one">Class</item>
<item quantity="other">Classes</item>
</plurals>
<string name="teachClassesOfChessStudents">Teach classes of chess students with the Lichess Classes tool suite.</string>
<string name="features">Features</string>
<string name="quicklyGenerateSafeUsernames">Quicly generate safe usernames and passwords for students</string>
<string name="trackStudentProgress">Track student progress in games and puzzles</string>
<string name="messageAllStudents">Message all students about new class material</string>
<string name="freeForAllForever">100% free for all, forever, with no ads or trackers</string>
<string name="applyToBeLichessTeacher">Apply to be a Lichess Teacher</string>
</resources>