1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/openings.fmt Thu Jan 07 22:34:17 2010 +0100
1.3 @@ -0,0 +1,97 @@
1.4 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
1.5 +<html>
1.6 + <head>
1.7 + <title>${bundle.OPENINGS}</title>
1.8 + <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
1.9 + </head>
1.10 + <body bgcolor="white">
1.11 + <h3><a href="/">${bundle.TITLE_PLAIN}</a></h3>
1.12 + <h4><a href="/openings">${bundle.OPENINGS}</a></h4>
1.13 + <p>
1.14 + <b>${bundle.WHITE}:</b> ${bundle("FENCES_LEFT", whitefences?number)}<br>
1.15 + <b>${bundle.BLACK}:</b> ${bundle("FENCES_LEFT", blackfences?number)}<br>
1.16 + </p>
1.17 + <div style="position: relative; height:180px;">
1.18 + <img style="position: absolute; left: 0; right: 0;"
1.19 + width="180" height="180 "
1.20 + src="/openings/${doc.openingNodeView.@code}.png?fieldSize=20"
1.21 + alt="${bundle.BOARD_TEXT}"
1.22 + >
1.23 + <div id="fence" style="position: absolute; left: 0; right: 0;"></div>
1.24 + <div id="player" style="position: absolute; left: 0; right: 0;"></div>
1.25 + </div>
1.26 +
1.27 + <#macro move item>
1.28 + <a href="/openings/${item.code}/">${item.move}</a>
1.29 + </#macro>
1.30 + <#macro games cnt gId status code>
1.31 + <#if (cnt?number = 0)>
1.32 + ${cnt?number}
1.33 + </#if>
1.34 + <#if (cnt?number = 1)>
1.35 + <a href="/games/${gId.@id}/">${cnt?number}</a>
1.36 + </#if>
1.37 + <#if (cnt?number > 1)>
1.38 + <a href="/openings/${code}/${status}">${cnt?number}</a>
1.39 + </#if>
1.40 + </#macro>
1.41 + <#if (doc.openingNodeView.children.*?size > 0)>
1.42 + <table border="1">
1.43 + <thead>
1.44 + <tr>
1.45 + <th>${bundle.MOVENUMBER}</th>
1.46 + <th>${bundle.WHITE_WON}</th>
1.47 + <th>${bundle.BLACK_WON}</th>
1.48 + </tr>
1.49 + </thead>
1.50 + <tbody>
1.51 + <#list doc.openingNodeView.children.* as item>
1.52 + <tr>
1.53 + <td><@move item/></td>
1.54 + <td><@games item.whiteWon item.whiteGame 'white' item.code/></td>
1.55 + <td><@games item.blackWon item.blackGame 'black' item.code/></td>
1.56 + </tr>
1.57 + </#list>
1.58 + </tbody>
1.59 + </table>
1.60 + </#if>
1.61 +
1.62 + <#macro before t>
1.63 + <#assign seconds = (t / 1000)?long/>
1.64 + <#assign minutes= (seconds / 60)?long/>
1.65 + <#assign hours= (minutes / 60)?long/>
1.66 + <#assign days= (hours / 24)?long/>
1.67 + <!--millis: ${t}, seconds: ${seconds}, minutes: ${minutes} hours: ${hours}, days: ${days} -->
1.68 + ${bundle("LastMove", t?int, seconds?int, minutes?int, hours?int, days?int)}
1.69 + </#macro>
1.70 + <#macro game game>
1.71 + ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)}
1.72 + <a href="/games/${game.@id}/"><@before (now - game.@modified?number)?long/></a>
1.73 + <#if game.@status = "whiteWon">
1.74 + ${bundle.WHITE_WON}
1.75 + </#if>
1.76 + <#if game.@status = "blackWon">
1.77 + ${bundle.BLACK_WON}
1.78 + </#if>
1.79 + <#if game.@comments?number != 0>
1.80 + ${bundle("comments", game.@comments?number)}
1.81 + </#if>
1.82 + </#macro>
1.83 +
1.84 + <#if (doc.openingNodeView.@whiteCount?number + doc.openingNodeView.@blackCount?number > 0)>
1.85 + <h3>${bundle.GAMES}</h3>
1.86 + <ol>
1.87 + <#list doc.openingNodeView.whiteGames.* as g>
1.88 + <li>
1.89 + <@game g/>
1.90 + </li>
1.91 + </#list>
1.92 + <#list doc.openingNodeView.blackGames.* as g>
1.93 + <li>
1.94 + <@game g/>
1.95 + </li>
1.96 + </#list>
1.97 + </ol>
1.98 + </#if>
1.99 + </body>
1.100 +</html>
1.101 \ No newline at end of file