freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/opening_games.fmt
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Thu, 07 Jan 2010 22:34:17 +0100
branchstatistics-and-elo
changeset 178 4b78d4f028b3
child 193 9b414aae2aa9
permissions -rw-r--r--
Initial version of statistics and ELO rating. Donated by Martin Rexa
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     2 <html>
     3   <head>
     4     <title>${bundle.OPENINGS} - ${bundle.GAMES}</title>
     5     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     6   </head>
     7   <body bgcolor="white">
     8       <h3><a href="/">${bundle.TITLE_PLAIN}</a></h3>
     9       <h4>${bundle.OPENINGS} - ${bundle.GAMES}</h4>
    10 
    11       <#macro before t>
    12         <#assign seconds = (t / 1000)?long/>
    13         <#assign minutes= (seconds / 60)?long/>
    14         <#assign hours= (minutes / 60)?long/>
    15         <#assign days= (hours / 24)?long/>
    16         <!--millis: ${t}, seconds: ${seconds}, minutes: ${minutes} hours: ${hours}, days: ${days} -->
    17         ${bundle("LastMove", t?int, seconds?int, minutes?int, hours?int, days?int)}
    18       </#macro>
    19       <#macro game game>
    20           ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)}
    21           <a href="/games/${game.@id}/"><@before (now - game.@modified?number)?long/></a>
    22           <#if game.@comments?number != 0>
    23             ${bundle("comments", game.@comments?number)}
    24           </#if>
    25       </#macro>
    26 
    27       <ol>
    28       <#list doc.gameIds.* as g>
    29             <li>
    30                 <@game g/>
    31             </li>
    32       </#list>
    33       </ol>
    34       <h4><a href="/openings/${code}">${bundle.OPENINGS}</a></h4>
    35   </body>
    36 </html>