freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 07 Sep 2009 22:16:19 +0200
changeset 69 90de58894949
parent 59 fd7e8e705b75
child 71 2bb77e950347
permissions -rw-r--r--
Using bundle("key", args) to get better order of localization
     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   </head>
     7   <body>
     8       <h1>${bundle.TITLE}</h1>
     9 
    10       <#macro game game>
    11           ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} <a href="/games/${game.@id}/">${bundle.BOARD}</a>
    12       </#macro>
    13 
    14       <#if message?? >
    15         <p>
    16             <span style="color: red">${message}</span>
    17         </p>
    18       </#if>
    19 
    20       <h5>${bundle.GAME_MOVE}</h5>
    21 
    22       <ol>
    23       <#list doc.gameIds.* as g>
    24         <#if (g.@white = user || g.@black = user) && g.@result = "IN_PROGRESS" >
    25             <li>
    26                 <@game g/>
    27             </li>
    28         </#if>
    29       </#list>
    30       </ol>
    31 
    32       <h5>${bundle.GAME_WON}</h5>
    33 
    34       <ol>
    35       <#list doc.gameIds.* as g>
    36         <#if 
    37             (g.@white = user && g.@result = "WHITE_WON") ||
    38             (g.@black = user && g.@result = "BLACK_WON")
    39         >
    40             <li>
    41                 <@game g/>
    42             </li>
    43         </#if>
    44       </#list>
    45       </ol>
    46 
    47       <h5>${bundle.GAME_LOST}</h5>
    48 
    49       <ol>
    50       <#list doc.gameIds.* as g>
    51         <#if
    52             (g.@white = user && g.@result = "BLACK_WON") ||
    53             (g.@black = user && g.@result = "WHITE_WON")
    54         >
    55             <li>
    56                 <@game g/>
    57             </li>
    58         </#if>
    59       </#list>
    60       </ol>
    61 
    62       <form action="games/create">
    63             ${bundle.WHITE}: <input type="text" name="white" value="" />
    64             ${bundle.BLACK}: <input type="text" name="black" value="" />
    65             <input type="submit" value="Create!" />
    66       </form>
    67 
    68       <h5>${bundle.GAME_ALL}</h5>
    69 
    70       <ol>
    71       <#list doc.gameIds.* as g>
    72         <li>
    73             <@game g/>
    74         </li>
    75       </#list>
    76       </ol>
    77   </body>
    78 </html>