freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt
author Jaroslav Tulach <jtulach@netbeans.org>
Tue, 15 Sep 2009 21:46:30 +0200
changeset 90 63ec24914da9
parent 88 a3be2be0112f
child 103 9a1eda26132d
permissions -rw-r--r--
Refreshing index automatically to be notified about moves of others
     1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     2 <html>
     3   <head>
     4     <title></title>
     5     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
     6     <meta http-equiv="REFRESH" content="60;URL=/">
     7   </head>
     8   <body>
     9       <h1>${bundle.TITLE}</h1>
    10 
    11       <#macro before t>
    12         <#assign seconds = (t / 1000)?int/>
    13         <#assign minutes= (seconds / 60)?int/>
    14         <#assign hours= (minutes / 60)?int/>
    15         <#assign days= (hours / 24)?int/>
    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 
    20       <#macro game game>
    21           ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} 
    22           <a href="/games/${game.@id}/"><@before (now - game.@modified?number)?int/></a>
    23       </#macro>
    24 
    25       <#if message?? >
    26         <p>
    27             <span style="color: red">${message}</span>
    28         </p>
    29       </#if>
    30 
    31       <h5>${bundle.GAME_MOVE}</h5>
    32 
    33       <ol>
    34       <#list doc.gameIds.* as g>
    35         <#if (g.@white = user && g.@status = "whiteMove") ||
    36              (g.@black = user && g.@status = "blackMove")
    37         >
    38             <li>
    39                 <@game g/>
    40             </li>
    41         </#if>
    42       </#list>
    43       </ol>
    44 
    45       <h5>${bundle.GAME_WAIT}</h5>
    46 
    47       <ol>
    48       <#list doc.gameIds.* as g>
    49         <#if (g.@white = user && g.@status = "blackMove") ||
    50              (g.@black = user && g.@status = "whiteMove")
    51         >
    52             <li>
    53                 <@game g/>
    54             </li>
    55         </#if>
    56       </#list>
    57       </ol>
    58 
    59       <h5>${bundle.GAME_WON}</h5>
    60 
    61       <ol>
    62       <#list doc.gameIds.* as g>
    63         <#if 
    64             (g.@white = user && g.@status = "whiteWon") ||
    65             (g.@black = user && g.@status = "blackWon")
    66         >
    67             <li>
    68                 <@game g/>
    69             </li>
    70         </#if>
    71       </#list>
    72       </ol>
    73 
    74       <h5>${bundle.GAME_LOST}</h5>
    75 
    76       <ol>
    77       <#list doc.gameIds.* as g>
    78         <#if
    79             (g.@white = user && g.@status = "blackWon") ||
    80             (g.@black = user && g.@status = "whiteWon")
    81         >
    82             <li>
    83                 <@game g/>
    84             </li>
    85         </#if>
    86       </#list>
    87       </ol>
    88 
    89       <form action="/games/create">
    90             ${bundle.WHITE}: <input type="text" name="white" value="" />
    91             ${bundle.BLACK}: <input type="text" name="black" value="" />
    92             <input type="submit" value="${bundle.CREATE}" />
    93       </form>
    94 
    95       <h5>${bundle.GAME_ALL}</h5>
    96 
    97       <ol>
    98       <#list doc.gameIds.* as g>
    99         <li>
   100             <@game g/>
   101         </li>
   102       </#list>
   103       </ol>
   104       <hr/>
   105       ${bundle("copyright", version)}
   106   </body>
   107 </html>