freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game.fmt
author Jaroslav Tulach <jaroslav.tulach@apidesign.org>
Sat, 05 Sep 2009 15:40:39 +0200
changeset 60 74d333da1725
parent 59 fd7e8e705b75
child 61 517faddf1320
permissions -rw-r--r--
Displaying list of moves
     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.GAME}</h1>
     9       <h3>${doc.game.id.@white}${bundle.VS}${doc.game.id.@black}</h3>
    10 
    11       <p>
    12       <a href="/games/${doc.game.id.@id}">${bundle.RELOAD}</a>
    13       <a href="/">${bundle.ROOT}</a>
    14       </p>
    15       
    16       <#if message?? >
    17         <p>
    18             <span style="color: red">${message}</span>
    19         </p>
    20       </#if>
    21 
    22       ${bundle.MOVE_WHO} ${doc.game.@currentPlayer}
    23       <#if user = doc.game.@currentPlayer >
    24           <form action="/games/${doc.game.id.@id}/move">
    25               <input type="hidden" name="type" value="fence" readonly="readonly"/>
    26               <select name="column">
    27                   <option>A</option>
    28                   <option>B</option>
    29                   <option>C</option>
    30                   <option>D</option>
    31                   <option>E</option>
    32                   <option>F</option>
    33                   <option>G</option>
    34                   <option>H</option>
    35               </select>
    36               <select name="row">
    37                   <option>1</option>
    38                   <option>2</option>
    39                   <option>3</option>
    40                   <option>4</option>
    41                   <option>5</option>
    42                   <option>6</option>
    43                   <option>7</option>
    44                   <option>8</option>
    45               </select>
    46               <select name="direction">
    47                   <option>${bundle.H}</option>
    48                   <option>${bundle.V}</option>
    49               </select>
    50               <input type="submit" value="${bundle.PLACE}" />
    51           </form>
    52           <form action="move">
    53               <input type="hidden" name="type" value="move" readonly="readonly"/>
    54               <select name="direction">
    55                   <option>E</option>
    56                   <option>W</option>
    57                   <option>N</option>
    58                   <option>S</option>
    59               </select>
    60               <select name="direction-next">
    61                   <option></option>
    62                   <option>E</option>
    63                   <option>W</option>
    64                   <option>N</option>
    65                   <option>S</option>
    66               </select>
    67               <input type="submit" value="${bundle.MOVE}" />
    68           </form>
    69       </#if>
    70       <pre>${doc.game.board}</pre>
    71 
    72       <h3>${bundle.MOVES}</h3>
    73 
    74       <table border="0">
    75           <thead>
    76               <tr>
    77                   <th>${bundle.MOVENUMBER}</th>
    78                   <th>${doc.game.id.@white}</th>
    79                   <th>${doc.game.id.@black}</th>
    80               </tr>
    81           </thead>
    82           <tbody>
    83               <#list doc.game.moves.* as item>
    84                 <#if item.@index?number % 2 = 1>
    85                     <tr><td>${item.@index}</td><td>${item.@move}</td>
    86                 <#else>
    87                     <td>${item.@move}</td></tr>
    88                 </#if>
    89               </#list>
    90           </tbody>
    91       </table>
    92   </body>
    93 </html>