tweak broadcast round form

pull/9722/head
Thibault Duplessis 2021-09-04 09:13:12 +02:00
parent 9664e37b28
commit 547ba446c8
2 changed files with 6 additions and 5 deletions

View File

@ -15,7 +15,6 @@ import views._
final class RelayRound(
env: Env,
studyC: => Study
// apiC: => Api
) extends LilaController(env) {
def form(tourId: String) =

View File

@ -18,7 +18,7 @@ object roundForm {
layout(newBroadcast.txt())(
h1(a(href := routes.RelayTour.edit(tour.id.value))(tour.name), " • ", addRound()),
standardFlash(),
inner(form, routes.RelayRound.create(tour.id.value), tour)
inner(form, routes.RelayRound.create(tour.id.value), tour, create = true)
)
def edit(rt: RelayRound.WithTour, form: Form[Data])(implicit ctx: Context) =
@ -29,7 +29,7 @@ object roundForm {
" > ",
a(href := rt.path)(rt.round.name)
),
inner(form, routes.RelayRound.update(rt.round.id.value), rt.tour),
inner(form, routes.RelayRound.update(rt.round.id.value), rt.tour, create = false),
div(cls := "relay-round__actions")(
postForm(action := routes.RelayRound.reset(rt.round.id.value))(
submitButton(
@ -58,12 +58,14 @@ 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, create: Boolean)(implicit
ctx: Context
) = {
val isLcc = form("syncUrl").value.exists(LccRegex.matches)
postForm(cls := "form3", action := url)(
div(cls := "form-group")(
bits.howToUse,
p(dataIcon := "", cls := "text")(
create option p(dataIcon := "", cls := "text")(
"The new round will have the same members and contributors as the previous one."
)
),