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 <#if format?? && format="small">
16 <meta name="viewport" content="width = 200" />
18 <meta name="viewport" content="width = 460" />
20 <script type="text/javascript">
21 function paintFence() {
22 var fifth = fieldSize / 10;
23 var x = (document.getElementById("column").value.charCodeAt(0) - 64) * fieldSize;
24 var y = fieldSize * 9 - (document.getElementById("row").value) * fieldSize;
27 if (document.getElementById("direction").value.charAt(0) == 'H') {
28 dx = fieldSize - 2 * fifth;
32 dy = fieldSize - 2 * fifth;
34 var fenceDiv = document.getElementById("fence");
35 fenceDiv.style.position="absolute";
36 fenceDiv.style.left = (x - dx) +"px";
37 fenceDiv.style.top = (y - dy) +"px";
38 fenceDiv.style.width = (dx * 2) +"px";
39 fenceDiv.style.height = (dy * 2) +"px";
40 fenceDiv.style.backgroundColor = 'black';
41 fenceDiv.style.visibility = 'visible';
43 function deltas(dir) {
47 if (dir == 'N') r.y = 1;
48 if (dir == 'S') r.y = -1;
49 if (dir == 'E') r.x = 1;
50 if (dir == 'W') r.x = -1;
53 function paintPlayer() {
54 var fifth = fieldSize / 5;
55 var m1 = deltas(document.getElementById("pdir1").value.charAt(0));
56 var m2 = deltas(document.getElementById("pdir2").value.charAt(0));
59 x : m1.x + m2.x + playerPos.x,
60 y : m1.y + m2.y + playerPos.y
62 var fenceDiv = document.getElementById("player");
63 fenceDiv.style.position="absolute";
64 fenceDiv.style.left = (pos.x * fieldSize + fifth) +"px";
65 fenceDiv.style.top = ((8 - pos.y) * fieldSize + fifth) +"px";
66 fenceDiv.style.width = (fieldSize - fifth * 2) +"px";
67 fenceDiv.style.height = (fieldSize - fifth * 2) +"px";
68 fenceDiv.style.backgroundColor = 'black';
69 fenceDiv.style.visibility = 'visible';
71 var fieldSize=<#if format?? && format="small">20<#else>50</#if>;
73 x: ${board.currentPlayer.column},
74 y: ${board.currentPlayer.row}
79 <h3><a href="/">${bundle.TITLE_PLAIN}</a></h3>
83 <#if who = doc.game.@currentPlayer>
84 <#if doc.game.id.@status = "whiteWon" || doc.game.id.@status = "blackWon" >
94 <b>${bundle.MOVENUMBER}: </b> ${(doc.game.@currentMove?number / 2 + 1)?string("0")}<br>
95 <b>${bundle.WHITE}:</b> <@status doc.game.id.@white/> ${bundle("FENCES_LEFT", board.players[0].fences)}<br>
96 <b>${bundle.BLACK}:</b> <@status doc.game.id.@black/> ${bundle("FENCES_LEFT", board.players[1].fences)}<br>
100 <#if (doc.game.@currentMove?number > 0)>
101 <a href="/games/${doc.game.id.@id}?move=${doc.game.@currentMove?number - 1}">${bundle.PREVIOUS}</a>
105 <a href="/games/${doc.game.id.@id}"">${bundle.LATEST}</a>
106 <#if (doc.game.@currentMove?number < doc.game.moves.*?size)>
107 <a href="/games/${doc.game.id.@id}?move=${doc.game.@currentMove?number + 1}">${bundle.NEXT}</a>
115 <span style="color: red">${message}</span>
119 <#assign play = false>
121 <#if doc.game.id.@status = "whiteMove" || doc.game.id.@status = "blackMove" >
122 <#assign play = user = doc.game.@currentPlayer>
125 <form action="/games/${doc.game.id.@id}/move">
126 <input type="hidden" name="type" value="fence" readonly="readonly"/>
127 <select name="column" id="column" onchange="paintFence()">
137 <select name="row" id="row" onchange="paintFence()">
147 <select name="direction" id="direction" onchange="paintFence()">
148 <option value="H">${bundle.H}</option>
149 <option value="V">${bundle.V}</option>
151 <input type="submit" value="${bundle.PLACE}" />
153 <form action="/games/${doc.game.id.@id}/move">
154 <input type="hidden" name="type" value="move" readonly="readonly"/>
155 <select id="pdir1" name="direction" onchange="paintPlayer()">
156 <option value="E">${bundle.E}</option>
157 <option value="W">${bundle.W}</option>
158 <option value ="N" <#if doc.game.id.@status = "whiteMove">selected="true"</#if>>${bundle.N}</option>
159 <option value ="S" <#if doc.game.id.@status = "blackMove">selected="true"</#if>>${bundle.S}</option>
161 <select id="pdir2" name="direction-next" onchange="paintPlayer()">
163 <option value="E">${bundle.E}</option>
164 <option value="W">${bundle.W}</option>
165 <option value="N">${bundle.N}</option>
166 <option value="S">${bundle.S}</option>
168 <input type="submit" value="${bundle.MOVE}" />
170 <form action="/games/${doc.game.id.@id}/move">
171 <input type="hidden" name="type" value="resign" readonly="readonly"/>
172 <input type="submit" value="${bundle.RESIGN}" />
176 <#if format?? && format = "text">
177 <pre>${doc.game.board}</pre>
179 <a href="/games/${doc.game.id.@id}?format=small">${bundle.BOARD_SMALL}</a>
180 <a href="/games/${doc.game.id.@id}?format=image">${bundle.BOARD_IMAGE}</a>
182 <#elseif format?? && format = "small">
184 <div style="position: relative; height:180px;">
185 <img style="position: absolute; left: 0; right: 0;"
186 width="180" height="180 "
187 src="/games/${doc.game.id.@id}.png?fieldSize=20<#if doc.game.@currentMove??>&move=${doc.game.@currentMove}</#if>"
188 alt="${bundle.BOARD_TEXT}"
190 <div id="fence" style="position: absolute; left: 0; right: 0;"></div>
191 <div id="player" style="position: absolute; left: 0; right: 0;"></div>
194 ${bundle.BOARD_SMALL}
195 <a href="/games/${doc.game.id.@id}?format=image">${bundle.BOARD_IMAGE}</a>
196 <a href="/games/${doc.game.id.@id}?format=text">${bundle.BOARD_TEXT}</a>
198 <div style="position: relative; height:450px;">
199 <img style="position: absolute; left: 0; right: 0;"
200 width="450" height="450"
201 src="/games/${doc.game.id.@id}.png<#if doc.game.@currentMove??>?move=${doc.game.@currentMove}</#if>"
202 alt="${bundle.BOARD_TEXT}"
204 <div id="fence" style="position: absolute; left: 0; right: 0;"></div>
205 <div id="player" style="position: absolute; left: 0; right: 0;"></div>
208 <a href="/games/${doc.game.id.@id}?format=small">${bundle.BOARD_SMALL}</a>
209 ${bundle.BOARD_IMAGE}
210 <a href="/games/${doc.game.id.@id}?format=text">${bundle.BOARD_TEXT}</a>
213 <#macro printMove item>
214 <#if item.@index = doc.game.@currentMove>
217 <a href="/games/${doc.game.id.@id}?move=${item.@index}">${item.@move}</a>
221 <h3><a href="/games/${doc.game.id.@id}?move=0">${bundle.MOVES}</a></h3>
226 <th>${bundle.MOVENUMBER}</th>
227 <th>${doc.game.id.@white}</th>
228 <th>${doc.game.id.@black}</th>
233 <#list doc.game.moves.* as item>
235 <#if item.@index?number % 2 = 1>
236 <#assign index = index + 1>
237 <tr><td>${index}</td><td><@printMove item/></td>
239 <td><@printMove item/></td></tr>
245 <h3>${bundle.TALK}</h3>
248 <#list doc.game.moves.item.comment as item>
249 <li><b>${item.@who}</b>: ${item}</li>
253 <form action="/games/${doc.game.id.@id}/comment">
254 <textarea rows="2" cols="80" name="comment"></textarea>
255 <input type="submit"/>
259 ${bundle("copyright", version)}