Skip to content

Commit

Permalink
improve thematic tournament integration
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jun 8, 2015
1 parent aeb78f8 commit 78f0d89
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 3 deletions.
14 changes: 13 additions & 1 deletion app/views/tournament/form.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,19 @@ <h1>@trans.createANewTournament()</h1>
</tr>
<tr class="position">
<th><label for="@form("position").id">@trans.startPosition()</label></th>
<td>@base.select(form("position"), positionChoices)</td>
<td>
@defining(form("position")) { field =>
<select name="@field.name">
@chess.StartingPosition.categories.map { categ =>
<optgroup label="@categ.name">
@categ.positions.map { v =>
<option value="@v.eco" @(if(field.value == Some(v.eco)) "selected" else "")>@v.fullName</option>
}
</optgroup>
}
</select>
}
</td>
</tr>
<tr>
<th><label for="@form("mode").id">@trans.mode()</label></th>
Expand Down
4 changes: 4 additions & 0 deletions app/views/tournament/side.scala.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
}.getOrElse {
@momentFormat(tour.createdAt)
}
@if(tour.position != chess.StartingPosition.initial) {
<br /><br />
<strong>@tour.position.eco</strong> @tour.position.name
}
@tour.winner.filter(_ => tour.isFinished).map { winner =>
<br /><br />
@trans.winner(): @userInfosLink(winner.id, none)
Expand Down
2 changes: 1 addition & 1 deletion modules/chess
Submodule chess updated from 81055f to a4e7f8
4 changes: 3 additions & 1 deletion modules/tournament/src/main/Tournament.scala
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,9 @@ object Tournament {
val tour = Created(
id = Random nextStringUppercase 8,
data = Data(
name = RandomName(),
name =
if (position == StartingPosition.initial) RandomName()
else position.shortName,
system = system,
clock = clock,
createdBy = createdBy.id,
Expand Down

0 comments on commit 78f0d89

Please sign in to comment.