freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game.fmt
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Mon, 07 Sep 2009 22:16:19 +0200
changeset 69 90de58894949
parent 66 d8dfa8972c4f
child 75 6802034b7a6f
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     <#if user != doc.game.@currentPlayer >
     7         <meta http-equiv="REFRESH" content="60;URL=/games/${doc.game.id.@id}">
     8     </#if>
     9   </head>
    10   <body>
    11       <h1>${bundle.GAME}</h1>
    12       <h3>${bundle("players", doc.game.id.@white?string, doc.game.id.@black?string)}</h3>
    13 
    14       <p>
    15       <a href="/games/${doc.game.id.@id}">${bundle.RELOAD}</a>
    16       <a href="/">${bundle.ROOT}</a>
    17       </p>
    18       
    19       <#if message?? >
    20         <p>
    21             <span style="color: red">${message}</span>
    22         </p>
    23       </#if>
    24 
    25       <#assign play = false>
    26 
    27       <#if doc.game.id.@result = "IN_PROGRESS" >
    28           ${bundle("MOVE_WHO", doc.game.@currentPlayer?string)}
    29           <#assign play = user = doc.game.@currentPlayer>
    30       <#else>
    31         <#if doc.game.id.@result = "WHITE_WON">
    32           ${bundle("WON", doc.game.id.@white?string)}
    33         <#else>
    34           ${bundle("WON", doc.game.id.@black?string)}
    35         </#if>
    36       </#if>
    37       <#if  play>
    38           <form action="/games/${doc.game.id.@id}/move">
    39               <input type="hidden" name="type" value="fence" readonly="readonly"/>
    40               <select name="column">
    41                   <option>A</option>
    42                   <option>B</option>
    43                   <option>C</option>
    44                   <option>D</option>
    45                   <option>E</option>
    46                   <option>F</option>
    47                   <option>G</option>
    48                   <option>H</option>
    49               </select>
    50               <select name="row">
    51                   <option>1</option>
    52                   <option>2</option>
    53                   <option>3</option>
    54                   <option>4</option>
    55                   <option>5</option>
    56                   <option>6</option>
    57                   <option>7</option>
    58                   <option>8</option>
    59               </select>
    60               <select name="direction">
    61                   <option>${bundle.H}</option>
    62                   <option>${bundle.V}</option>
    63               </select>
    64               <input type="submit" value="${bundle.PLACE}" />
    65           </form>
    66           <form action="/games/${doc.game.id.@id}/move">
    67               <input type="hidden" name="type" value="move" readonly="readonly"/>
    68               <select name="direction">
    69                   <option>E</option>
    70                   <option>W</option>
    71                   <option>N</option>
    72                   <option>S</option>
    73               </select>
    74               <select name="direction-next">
    75                   <option></option>
    76                   <option>E</option>
    77                   <option>W</option>
    78                   <option>N</option>
    79                   <option>S</option>
    80               </select>
    81               <input type="submit" value="${bundle.MOVE}" />
    82           </form>
    83       </#if>
    84       <pre>${doc.game.board}</pre>
    85 
    86       <h3>${bundle.MOVES}</h3>
    87 
    88       <table border="0">
    89           <thead>
    90               <tr>
    91                   <th>${bundle.MOVENUMBER}</th>
    92                   <th>${doc.game.id.@white}</th>
    93                   <th>${doc.game.id.@black}</th>
    94               </tr>
    95           </thead>
    96           <tbody>
    97               <#assign index = 0>
    98               <#list doc.game.moves.* as item>
    99                 <#if item.@index?number % 2 = 1>
   100                     <#assign index = index + 1>
   101                     <tr><td>${index}</td><td>${item.@move}</td>
   102                 <#else>
   103                     <td>${item.@move}</td></tr>
   104                 </#if>
   105               </#list>
   106           </tbody>
   107       </table>
   108   </body>
   109 </html>