autofill broadcast livechesscloud source round
parent
d0b4e19da9
commit
ee71c6f77e
|
@ -61,7 +61,7 @@ trait FormHelper { self: I18nHelper =>
|
|||
klass: String = "",
|
||||
half: Boolean = false,
|
||||
help: Option[Frag] = None
|
||||
)(content: Field => Frag)(implicit ctx: Context): Frag =
|
||||
)(content: Field => Frag)(implicit ctx: Context): Tag =
|
||||
div(
|
||||
cls := List(
|
||||
"form-group" -> true,
|
||||
|
|
|
@ -58,7 +58,8 @@ object roundForm {
|
|||
main(cls := "page-small box box-pad")(body)
|
||||
)
|
||||
|
||||
private def inner(form: Form[Data], url: play.api.mvc.Call, t: RelayTour)(implicit ctx: Context) =
|
||||
private def inner(form: Form[Data], url: play.api.mvc.Call, t: RelayTour)(implicit ctx: Context) = {
|
||||
val isLcc = form("syncUrl").value.exists(LccRegex.matches)
|
||||
postForm(cls := "form3", action := url)(
|
||||
div(cls := "form-group")(
|
||||
bits.howToUse,
|
||||
|
@ -77,11 +78,10 @@ object roundForm {
|
|||
gameIdsHelp()
|
||||
).some
|
||||
)(form3.input(_)),
|
||||
form("syncUrl").value.exists(LccRegex.matches) option {
|
||||
form3.group(form("syncUrlRound"), roundNumber())(
|
||||
form3.input(_, typ = "number")(required := true)
|
||||
)
|
||||
},
|
||||
form3
|
||||
.group(form("syncUrlRound"), roundNumber(), help = frag("Only for livechesscloud source URLs").some)(
|
||||
form3.input(_, typ = "number")(required := isLcc)
|
||||
)(ctx)(cls := (!isLcc).option("none")),
|
||||
form3.split(
|
||||
form3.group(
|
||||
form("startsAt"),
|
||||
|
@ -102,4 +102,5 @@ object roundForm {
|
|||
form3.submit(trans.apply())
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,11 +114,10 @@ object form {
|
|||
)
|
||||
),
|
||||
form3.split(
|
||||
teams.nonEmpty ?? {
|
||||
teams.nonEmpty option
|
||||
form3.group(form("team"), raw("Only members of team"), half = true)(
|
||||
form3.select(_, List(("", "No Restriction")) ::: teams.map(_.pair))
|
||||
)
|
||||
},
|
||||
),
|
||||
form3.group(
|
||||
form("position"),
|
||||
trans.startPosition(),
|
||||
|
|
|
@ -35,7 +35,7 @@ final class RelayRoundForm {
|
|||
s"Maximum rounds per tournament: ${RelayTour.maxRelays}",
|
||||
_ => trs.rounds.sizeIs < RelayTour.maxRelays
|
||||
)
|
||||
}.fill(Data(name = s"Round ${trs.rounds.size + 1}"))
|
||||
}.fill(Data(name = s"Round ${trs.rounds.size + 1}", syncUrlRound = Some(trs.rounds.size + 1)))
|
||||
|
||||
def edit(r: RelayRound) = Form(roundMapping) fill Data.make(r)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue