1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
5 <#if user = doc.game.@currentPlayer>
8 ${bundle("Waiting", doc.game.@currentPlayer?string)}
11 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
12 <#if user != doc.game.@currentPlayer >
13 <meta http-equiv="REFRESH" content="60;URL=/games/${doc.game.id.@id}">
15 <script type="text/javascript">
16 function paintFence() {
17 var fifth = fieldSize / 10;
18 var x = (document.getElementById("column").value.charCodeAt(0) - 64) * fieldSize;
19 var y = fieldSize * 9 - (document.getElementById("row").value) * fieldSize;
22 if (document.getElementById("direction").value.charAt(0) == 'H') {
23 dx = fieldSize - 2 * fifth;
27 dy = fieldSize - 2 * fifth;
29 var fenceDiv = document.getElementById("fence");
30 fenceDiv.style.position="absolute";
31 fenceDiv.style.left = (x - dx) +"px";
32 fenceDiv.style.top = (y - dy) +"px";
33 fenceDiv.style.width = (dx * 2) +"px";
34 fenceDiv.style.height = (dy * 2) +"px";
35 fenceDiv.style.backgroundColor = 'black';
36 fenceDiv.style.visibility = 'visible';
38 var fieldSize=<#if format?? && format="small">20<#else>50</#if>;
42 <h1><a href="/games/${doc.game.id.@id}">${bundle.GAME}</a></h1>
46 <#if who = doc.game.@currentPlayer>
47 <#if doc.game.id.@status = "whiteWon" || doc.game.id.@status = "blackWon" >
57 <b>${bundle.MOVENUMBER}: </b> ${(doc.game.@currentMove?number / 2 + 1)?string("0")}<br>
58 <b>${bundle.WHITE}:</b> <@status doc.game.id.@white/> ${bundle("FENCES_LEFT", board.players[0].fences)}<br>
59 <b>${bundle.BLACK}:</b> <@status doc.game.id.@black/> ${bundle("FENCES_LEFT", board.players[1].fences)}<br>
63 <a href="/">${bundle.ROOT}</a>
64 <#if (doc.game.@currentMove?number > 0)>
65 <a href="/games/${doc.game.id.@id}?move=${doc.game.@currentMove?number - 1}">${bundle.PREVIOUS}</a>
69 <a href="/games/${doc.game.id.@id}"">${bundle.LATEST}</a>
70 <#if (doc.game.@currentMove?number < doc.game.moves.*?size)>
71 <a href="/games/${doc.game.id.@id}?move=${doc.game.@currentMove?number + 1}">${bundle.NEXT}</a>
79 <span style="color: red">${message}</span>
83 <#assign play = false>
85 <#if doc.game.id.@status = "whiteMove" || doc.game.id.@status = "blackMove" >
86 <#assign play = user = doc.game.@currentPlayer>
89 <form action="/games/${doc.game.id.@id}/move">
90 <input type="hidden" name="type" value="fence" readonly="readonly"/>
91 <select name="column" id="column" onchange="paintFence()">
101 <select name="row" id="row" onchange="paintFence()">
111 <select name="direction" id="direction" onchange="paintFence()">
112 <option value="H">${bundle.H}</option>
113 <option value="V">${bundle.V}</option>
115 <input type="submit" value="${bundle.PLACE}" />
117 <form action="/games/${doc.game.id.@id}/move">
118 <input type="hidden" name="type" value="move" readonly="readonly"/>
119 <select name="direction">
122 <option <#if doc.game.id.@status = "whiteMove">selected="true"</#if>>N</option>
123 <option <#if doc.game.id.@status = "blackMove">selected="true"</#if>>S</option>
125 <select name="direction-next">
132 <input type="submit" value="${bundle.MOVE}" />
134 <form action="/games/${doc.game.id.@id}/move">
135 <input type="hidden" name="type" value="resign" readonly="readonly"/>
136 <input type="submit" value="${bundle.RESIGN}" />
140 <#if format?? && format = "text">
141 <pre>${doc.game.board}</pre>
143 <a href="/games/${doc.game.id.@id}?format=small">${bundle.BOARD_SMALL}</a>
144 <a href="/games/${doc.game.id.@id}?format=image">${bundle.BOARD_IMAGE}</a>
146 <#elseif format?? && format = "small">
148 <div style="position: relative; height:180px;">
149 <div id="fence"></div>
150 <img style="position: absolute; left: 0; right: 0;"
151 width="180" height="180 "
152 src="/games/${doc.game.id.@id}.png?fieldSize=20<#if doc.game.@currentMove??>&move=${doc.game.@currentMove}</#if>"
153 alt="${bundle.BOARD_TEXT}"
157 ${bundle.BOARD_SMALL}
158 <a href="/games/${doc.game.id.@id}?format=image">${bundle.BOARD_IMAGE}</a>
159 <a href="/games/${doc.game.id.@id}?format=text">${bundle.BOARD_TEXT}</a>
161 <div style="position: relative; height:450px;">
162 <div id="fence"></div>
163 <img style="position: absolute; left: 0; right: 0;"
164 width="450" height="450"
165 src="/games/${doc.game.id.@id}.png<#if doc.game.@currentMove??>?move=${doc.game.@currentMove}</#if>"
166 alt="${bundle.BOARD_TEXT}"
170 <a href="/games/${doc.game.id.@id}?format=small">${bundle.BOARD_SMALL}</a>
171 ${bundle.BOARD_IMAGE}
172 <a href="/games/${doc.game.id.@id}?format=text">${bundle.BOARD_TEXT}</a>
175 <#macro printMove item>
176 <#if item.@index = doc.game.@currentMove>
179 <a href="/games/${doc.game.id.@id}?move=${item.@index}">${item.@move}</a>
183 <h3><a href="/games/${doc.game.id.@id}?move=0">${bundle.MOVES}</a></h3>
188 <th>${bundle.MOVENUMBER}</th>
189 <th>${doc.game.id.@white}</th>
190 <th>${doc.game.id.@black}</th>
195 <#list doc.game.moves.* as item>
197 <#if item.@index?number % 2 = 1>
198 <#assign index = index + 1>
199 <tr><td>${index}</td><td><@printMove item/></td>
201 <td><@printMove item/></td></tr>
207 ${bundle("copyright", version)}