complete private tournaments implementation
This commit is contained in:
parent
7cfd75af8a
commit
e847931cf8
|
@ -108,12 +108,10 @@ object Tournament extends LilaController {
|
||||||
_.fold(tournamentNotFound(ctx).fuccess) { tour ⇒
|
_.fold(tournamentNotFound(ctx).fuccess) { tour ⇒
|
||||||
env.forms.joinPassword.bindFromRequest.fold(
|
env.forms.joinPassword.bindFromRequest.fold(
|
||||||
err ⇒ renderJoinPassword(tour, err) map { BadRequest(_) },
|
err ⇒ renderJoinPassword(tour, err) map { BadRequest(_) },
|
||||||
password ⇒ FuRedirect {
|
password ⇒ env.api.join(tour, me, password.some) flatFold (
|
||||||
env.api.join(tour, me, password.some).fold(
|
_ ⇒ renderJoinPassword(tour, env.forms.joinPassword) map { BadRequest(_) },
|
||||||
err ⇒ routes.Tournament.show(tour.id),
|
_ ⇒ fuccess(Redirect(routes.Tournament.show(tour.id)))
|
||||||
_ ⇒ routes.Tournament.show(tour.id)
|
)
|
||||||
)
|
|
||||||
}
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@
|
||||||
<span class="label">JOINED</span>
|
<span class="label">JOINED</span>
|
||||||
} else {
|
} else {
|
||||||
<form class="inline" action="@routes.Tournament.join(tour.id)" method="POST">
|
<form class="inline" action="@routes.Tournament.join(tour.id)" method="POST">
|
||||||
<input type="submit" class="submit button" value="Join" />
|
<button type="submit" class="submit button"><span class="s16 lock">@trans.join()</span></button>
|
||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,10 +7,13 @@
|
||||||
@timeago(tour.createdAt)
|
@timeago(tour.createdAt)
|
||||||
@tour.password.map { password =>
|
@tour.password.map { password =>
|
||||||
<br />
|
<br />
|
||||||
@trans.isPrivate()
|
<span class="s16 lock">
|
||||||
@if(ctx.userId == tour.createdBy.some) {
|
@if(ctx.userId == tour.createdBy.some) {
|
||||||
(@trans.password(): @tour.password)
|
@trans.password(): @tour.password
|
||||||
}
|
} else {
|
||||||
|
@trans.isPrivate()
|
||||||
|
}
|
||||||
|
</span>
|
||||||
}
|
}
|
||||||
<br /><br />
|
<br /><br />
|
||||||
<span class="s16 clock">@tour.clock.show</span>,
|
<span class="s16 clock">@tour.clock.show</span>,
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
<h1>@tour.nameT
|
<h1>@tour.nameT
|
||||||
@if(tour.hasPassword) {
|
@if(tour.hasPassword) {
|
||||||
<span class="private">(@trans.isPrivate())</span>
|
<span class="private s16 lock">@trans.isPrivate()</span>
|
||||||
}
|
}
|
||||||
</h1>
|
</h1>
|
||||||
@form
|
@form
|
||||||
|
@ -30,7 +30,7 @@
|
||||||
</form>
|
</form>
|
||||||
} else {
|
} else {
|
||||||
<form class="inline" action="@routes.Tournament.join(tour.id)" method="POST">
|
<form class="inline" action="@routes.Tournament.join(tour.id)" method="POST">
|
||||||
<input type="submit" class="submit button strong" value="@trans.join()" />
|
<button type="submit" class="submit button strong"><span class="s16 lock">@trans.join()</span></button>
|
||||||
</form>
|
</form>
|
||||||
}
|
}
|
||||||
</th>
|
</th>
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 3.6 KiB |
|
@ -974,6 +974,9 @@ span.s16.clock {
|
||||||
.s16.tdown {
|
.s16.tdown {
|
||||||
background-position: 0 -448px;
|
background-position: 0 -448px;
|
||||||
}
|
}
|
||||||
|
.s16.lock {
|
||||||
|
background-position: 0 -480px;
|
||||||
|
}
|
||||||
.user_link.white, .user_link.black, .user_link.online, .user_link.offline {
|
.user_link.white, .user_link.black, .user_link.online, .user_link.offline {
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
display: block;
|
display: block;
|
||||||
|
|
|
@ -101,6 +101,12 @@
|
||||||
padding: 3px 5px;
|
padding: 3px 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.s16.lock {
|
||||||
|
display: inline-block;
|
||||||
|
height: 16px;
|
||||||
|
line-height: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
#tournament_side {
|
#tournament_side {
|
||||||
float: right;
|
float: right;
|
||||||
width: 246px;
|
width: 246px;
|
||||||
|
|
Loading…
Reference in a new issue