fix anon challenge time mode - closes #7974

pull/8134/head
Thibault Duplessis 2021-02-09 10:56:30 +01:00
parent 2a123cac2d
commit 8483cba9b1
2 changed files with 5 additions and 5 deletions

View File

@ -93,12 +93,12 @@ private object bits {
def renderLabel(field: Field, content: Frag) =
label(`for` := s"$prefix${field.id}")(content)
def renderTimeMode(form: Form[_])(implicit ctx: Context) =
def renderTimeMode(form: Form[_], allowAnon: Boolean)(implicit ctx: Context) =
div(cls := "time_mode_config optional_config")(
div(
cls := List(
"label_select" -> true,
"none" -> ctx.isAnon
"none" -> (ctx.isAnon && !allowAnon)
)
)(
renderLabel(form("timeMode"), trans.timeControl()),

View File

@ -21,7 +21,7 @@ object forms {
) {
frag(
renderVariant(form, translatedVariantChoicesWithVariants),
renderTimeMode(form),
renderTimeMode(form, allowAnon = false),
ctx.isAuth option frag(
div(cls := "mode_choice buttons")(
renderRadios(form("mode"), translatedModeChoices)
@ -61,7 +61,7 @@ object forms {
frag(
renderVariant(form, translatedAiVariantChoices),
fenInput(form("fen"), strict = true, validFen),
renderTimeMode(form),
renderTimeMode(form, allowAnon = true),
if (ctx.blind)
frag(
renderLabel(form("level"), trans.strength()),
@ -104,7 +104,7 @@ object forms {
},
renderVariant(form, translatedVariantChoicesWithVariantsAndFen),
fenInput(form("fen"), strict = false, validFen),
renderTimeMode(form),
renderTimeMode(form, allowAnon = true),
ctx.isAuth option div(cls := "mode_choice buttons")(
renderRadios(form("mode"), translatedModeChoices)
),