[%# vim:set filetype=html: %]
-<h2>PĆ„melding</h2>
+<h2>Registration</h2>
<div>
<form method="post" action="do-registration.pl">
- <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
<table>
<tr>
- <th>Spiller</th>
+ <th>Player</th>
<td>
<select name="player">
[% FOR a = available %]
- <option value="[% a.player %]">[% a.nick %]</option>
+[% IF a.player == selected_player %]
+ <option value="[% a.player %]" selected="selected">[% a.nick %]</option>
+[% ELSE %]
+ <option value="[% a.player %]">[% a.nick %]</option>
+[% END %]
[% END %]
</select>
</td>
</tr>
<tr>
- <th>Betalt</th>
+ <th>Paid</th>
<td>
<select name="paid">
- <option value="f">Nei</option>
- <option value="t">Ja</option>
+ <option value="f">No</option>
+ <option value="t">Yes</option>
</select>
</td>
</tr>
<tr>
<th colspan="2">
- <input type="submit" value="Legg til" />
+ <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
+ <input type="submit" value="Add" />
</th>
</tr>
</table>
</form>
</div>
-<h2>PĆ„meldte</h2>
+<h2>Register a new player</h2>
<div>
- <ul>
-[% FOR r = registered %]
- <li>[% r.nick %]</li>
-[% END %]
- </ul>
+<form method="post" action="do-add-player.pl">
+ <table>
+ <tr>
+ <th>Nick</th>
+ <td><input name="nick" /></td>
+ </tr>
+ <tr>
+ <th>Country</th>
+ <td>
+ <select name="country">
+[% FOR c = countries %]
+[% IF c.countrycode == "NOR" %]
+ <option value="[% c.country %]" selected="selected">[% c.countrycode %] - [% c.countryname %]</option>
+[% ELSE %]
+ <option value="[% c.country %]">[% c.countrycode %] - [% c.countryname %]</option>
+[% END %]
+[% END %]
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th>Club</th>
+ <td>
+ <select name="club">
+ <option value="-1" selected="selected"></option>
+[% FOR c = clubs %]
+ <option value="[% c.club %]">[% c.clubcode %] - [% c.clubname %]</option>
+[% END %]
+ </select>
+ </td>
+ </tr>
+ <tr>
+ <th colspan="2">
+ <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
+ <input type="submit" value="Add" />
+ </th>
+ </tr>
+ </table>
+</form>
</div>
+<h2>Registered</h2>
+<div>
+ <table>
+[% FOR r = registered %]
+ <tr>
+ <td><a href="player.pl?id=[% r.player %]">[% r.nick %]</a></td>
+[% IF r.paid %]
+ <td>paid</td>
+[% ELSE %]
+ <td class="notpaid">not paid</td>
+[% END %]
+ <td>
+ <form method="post" action="do-set-paid.pl">
+ <p class="button">
+ <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
+ <input type="hidden" name="player" value="[% r.player %]" />
+[% IF r.paid %]
+ <input type="hidden" name="paid" value="f" />
+ <input type="submit" value="<_>Set as not paid</_>" />
+[% ELSE %]
+ <input type="hidden" name="paid" value="t" />
+ <input type="submit" value="<_>Set as paid</_>" />
+[% END %]
+ </p>
+ </form>
+ </td>
+ <td>
+ <form method="post" action="do-unregister.pl">
+ <p class="button">
+ <input type="hidden" name="tournament" value="[% tournament.tournament %]" />
+ <input type="hidden" name="player" value="[% r.player %]" />
+ <input type="submit" value="<_>Remove</_>" />
+ </p>
+ </form>
+ </td>
+ <td>
+ <form method="post" action="edit-player.pl">
+ <p class="button">
+ <input type="hidden" name="player" value="[% r.player %]" />
+ <input type="submit" value="<_>Edit player</_>" />
+ </p>
+ </form>
+ </td>
+ </tr>
+[% END %]
+ </table>
+</div>