[%# vim:set filetype=html: %]
-<div>
- <ul>
+
+[% IF !public %]
+ <div>
+ <p><a href="add-tournament.pl">Add tournament</a></p>
+ </div>
+[% END %]
+
+[% SET last_season = 0 %]
[% FOR t = tournaments %]
- <li><a href="show-tournament.pl?id=[% t.tournament %]">[% t.tournamentname %]</a></li>
+
+[% IF t.season != last_season %]
+[% IF last_season != 0 %]
+ </ul>
+ </div>
+[% END %]
+[% SET last_season = t.season %]
+
+ <h2>[% t.seasonname %]</h2>
+
+ <div>
+ <ul>
+[% END %]
+ <li>
+ <a href="show-tournament.pl?id=[% t.tournament %]">[% t.tournamentname %]</a>
+[% IF !public %]
+ (<a href="registration.pl?id=[% t.tournament %]"><_>registration</_></a>)
+[% END %]
+ </li>
[% END %]
- </ul>
-</div>
+ </ul>
+ </div>