author | Jaroslav Tulach <jaroslav.tulach@apidesign.org> |
Sun, 20 Sep 2009 20:04:41 +0200 | |
changeset 105 | 6e55d5c85d3c |
parent 100 | 8b899ed24f9f |
child 109 | d2140ee1c682 |
permissions | -rw-r--r-- |
jtulach@41 | 1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> |
jtulach@41 | 2 |
<html> |
jtulach@41 | 3 |
<head> |
jaroslav@93 | 4 |
<title> |
jaroslav@93 | 5 |
<#if user = doc.game.@currentPlayer> |
jaroslav@93 | 6 |
${bundle.YourTurn} |
jaroslav@93 | 7 |
<#else> |
jaroslav@93 | 8 |
${bundle("Waiting", doc.game.@currentPlayer?string)} |
jaroslav@93 | 9 |
</#if> |
jaroslav@93 | 10 |
</title> |
jtulach@41 | 11 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
jaroslav@66 | 12 |
<#if user != doc.game.@currentPlayer > |
jaroslav@66 | 13 |
<meta http-equiv="REFRESH" content="60;URL=/games/${doc.game.id.@id}"> |
jaroslav@66 | 14 |
</#if> |
jtulach@41 | 15 |
</head> |
jtulach@41 | 16 |
<body> |
jaroslav@99 | 17 |
<h1><a href="/games/${doc.game.id.@id}">${bundle.GAME}</a></h1> |
jaroslav@98 | 18 |
|
jaroslav@98 | 19 |
<#macro status who> |
jaroslav@98 | 20 |
${who?string} |
jaroslav@98 | 21 |
<#if who = doc.game.@currentPlayer> |
jaroslav@98 | 22 |
<#if doc.game.id.@status = "whiteWon" || doc.game.id.@status = "blackWon" > |
jaroslav@98 | 23 |
- ${bundle.HAS_WON} |
jaroslav@98 | 24 |
<#else> |
jaroslav@98 | 25 |
- ${bundle.TO_MOVE} |
jaroslav@98 | 26 |
</#if> |
jaroslav@98 | 27 |
</#if> |
jaroslav@98 | 28 |
</#macro> |
jaroslav@98 | 29 |
|
jaroslav@98 | 30 |
|
jaroslav@98 | 31 |
<p> |
jaroslav@100 | 32 |
<b>${bundle.MOVENUMBER}: </b> ${(doc.game.@currentMove?number / 2 + 1)?string("0")}<br> |
jaroslav@99 | 33 |
<b>${bundle.WHITE}:</b> <@status doc.game.id.@white/> ${bundle("FENCES_LEFT", board.players[0].fences)}<br> |
jaroslav@99 | 34 |
<b>${bundle.BLACK}:</b> <@status doc.game.id.@black/> ${bundle("FENCES_LEFT", board.players[1].fences)}<br> |
jaroslav@98 | 35 |
</p> |
jaroslav@56 | 36 |
|
jaroslav@56 | 37 |
<p> |
jaroslav@60 | 38 |
<a href="/">${bundle.ROOT}</a> |
jaroslav@100 | 39 |
<#if (doc.game.@currentMove?number > 0)> |
jaroslav@100 | 40 |
<a href="/games/${doc.game.id.@id}?move=${doc.game.@currentMove?number - 1}">${bundle.PREVIOUS}</a> |
jaroslav@100 | 41 |
<#else> |
jaroslav@100 | 42 |
${bundle.PREVIOUS} |
jaroslav@100 | 43 |
</#if> |
jaroslav@100 | 44 |
<a href="/games/${doc.game.id.@id}"">${bundle.LATEST}</a> |
jaroslav@100 | 45 |
<#if (doc.game.@currentMove?number < doc.game.moves.*?size)> |
jaroslav@100 | 46 |
<a href="/games/${doc.game.id.@id}?move=${doc.game.@currentMove?number + 1}">${bundle.NEXT}</a> |
jaroslav@100 | 47 |
<#else> |
jaroslav@100 | 48 |
${bundle.NEXT} |
jaroslav@100 | 49 |
</#if> |
jaroslav@56 | 50 |
</p> |
jaroslav@56 | 51 |
|
jaroslav@56 | 52 |
<#if message?? > |
jaroslav@56 | 53 |
<p> |
jaroslav@56 | 54 |
<span style="color: red">${message}</span> |
jaroslav@56 | 55 |
</p> |
jaroslav@56 | 56 |
</#if> |
jaroslav@56 | 57 |
|
jaroslav@66 | 58 |
<#assign play = false> |
jaroslav@66 | 59 |
|
jtulach@77 | 60 |
<#if doc.game.id.@status = "whiteMove" || doc.game.id.@status = "blackMove" > |
jaroslav@66 | 61 |
<#assign play = user = doc.game.@currentPlayer> |
jaroslav@66 | 62 |
</#if> |
jaroslav@66 | 63 |
<#if play> |
jaroslav@56 | 64 |
<form action="/games/${doc.game.id.@id}/move"> |
jaroslav@55 | 65 |
<input type="hidden" name="type" value="fence" readonly="readonly"/> |
jaroslav@55 | 66 |
<select name="column"> |
jaroslav@55 | 67 |
<option>A</option> |
jaroslav@55 | 68 |
<option>B</option> |
jaroslav@55 | 69 |
<option>C</option> |
jaroslav@55 | 70 |
<option>D</option> |
jaroslav@55 | 71 |
<option>E</option> |
jaroslav@55 | 72 |
<option>F</option> |
jaroslav@55 | 73 |
<option>G</option> |
jaroslav@55 | 74 |
<option>H</option> |
jaroslav@55 | 75 |
</select> |
jaroslav@55 | 76 |
<select name="row"> |
jaroslav@55 | 77 |
<option>1</option> |
jaroslav@55 | 78 |
<option>2</option> |
jaroslav@55 | 79 |
<option>3</option> |
jaroslav@55 | 80 |
<option>4</option> |
jaroslav@55 | 81 |
<option>5</option> |
jaroslav@55 | 82 |
<option>6</option> |
jaroslav@55 | 83 |
<option>7</option> |
jaroslav@55 | 84 |
<option>8</option> |
jaroslav@55 | 85 |
</select> |
jaroslav@55 | 86 |
<select name="direction"> |
jaroslav@59 | 87 |
<option>${bundle.H}</option> |
jaroslav@59 | 88 |
<option>${bundle.V}</option> |
jaroslav@55 | 89 |
</select> |
jaroslav@59 | 90 |
<input type="submit" value="${bundle.PLACE}" /> |
jaroslav@55 | 91 |
</form> |
jaroslav@61 | 92 |
<form action="/games/${doc.game.id.@id}/move"> |
jaroslav@55 | 93 |
<input type="hidden" name="type" value="move" readonly="readonly"/> |
jaroslav@55 | 94 |
<select name="direction"> |
jaroslav@55 | 95 |
<option>E</option> |
jaroslav@55 | 96 |
<option>W</option> |
jaroslav@55 | 97 |
<option>N</option> |
jaroslav@55 | 98 |
<option>S</option> |
jaroslav@55 | 99 |
</select> |
jaroslav@55 | 100 |
<select name="direction-next"> |
jaroslav@55 | 101 |
<option></option> |
jaroslav@55 | 102 |
<option>E</option> |
jaroslav@55 | 103 |
<option>W</option> |
jaroslav@55 | 104 |
<option>N</option> |
jaroslav@55 | 105 |
<option>S</option> |
jaroslav@55 | 106 |
</select> |
jaroslav@59 | 107 |
<input type="submit" value="${bundle.MOVE}" /> |
jaroslav@55 | 108 |
</form> |
jtulach@75 | 109 |
<form action="/games/${doc.game.id.@id}/move"> |
jtulach@75 | 110 |
<input type="hidden" name="type" value="resign" readonly="readonly"/> |
jtulach@75 | 111 |
<input type="submit" value="${bundle.RESIGN}" /> |
jtulach@75 | 112 |
</form> |
jaroslav@55 | 113 |
</#if> |
jaroslav@100 | 114 |
<p> |
jaroslav@95 | 115 |
<#if format?? && format = "text"> |
jaroslav@95 | 116 |
<pre>${doc.game.board}</pre> |
jaroslav@105 | 117 |
${bundle.BOARD_VIEW} |
jaroslav@100 | 118 |
<a href="/games/${doc.game.id.@id}?format=small">${bundle.BOARD_SMALL}</a> |
jaroslav@98 | 119 |
<a href="/games/${doc.game.id.@id}?format=image">${bundle.BOARD_IMAGE}</a> |
jaroslav@100 | 120 |
${bundle.BOARD_TEXT} |
jaroslav@100 | 121 |
<#elseif format?? && format = "small"> |
jaroslav@100 | 122 |
<p> |
jaroslav@105 | 123 |
<img src="/games/${doc.game.id.@id}.png?fieldSize=20<#if doc.game.@currentMove??>&move=${doc.game.@currentMove}</#if>" alt="${bundle.BOARD_TEXT}"> |
jaroslav@100 | 124 |
</p> |
jaroslav@105 | 125 |
${bundle.BOARD_VIEW} |
jaroslav@100 | 126 |
${bundle.BOARD_SMALL} |
jaroslav@100 | 127 |
<a href="/games/${doc.game.id.@id}?format=image">${bundle.BOARD_IMAGE}</a> |
jaroslav@100 | 128 |
<a href="/games/${doc.game.id.@id}?format=text">${bundle.BOARD_TEXT}</a> |
jaroslav@95 | 129 |
<#else> |
jaroslav@95 | 130 |
<p> |
jaroslav@105 | 131 |
<img src="/games/${doc.game.id.@id}.png<#if doc.game.@currentMove??>?move=${doc.game.@currentMove}</#if>" alt="${bundle.BOARD_TEXT}"> |
jaroslav@95 | 132 |
</p> |
jaroslav@105 | 133 |
${bundle.BOARD_VIEW} |
jaroslav@100 | 134 |
<a href="/games/${doc.game.id.@id}?format=small">${bundle.BOARD_SMALL}</a> |
jaroslav@100 | 135 |
${bundle.BOARD_IMAGE} |
jaroslav@98 | 136 |
<a href="/games/${doc.game.id.@id}?format=text">${bundle.BOARD_TEXT}</a> |
jaroslav@95 | 137 |
</#if> |
jaroslav@95 | 138 |
|
jaroslav@100 | 139 |
<#macro printMove item> |
jaroslav@100 | 140 |
<#if item.@index = doc.game.@currentMove> |
jaroslav@100 | 141 |
<b>${item.@move}</b> |
jaroslav@100 | 142 |
<#else> |
jaroslav@100 | 143 |
<a href="/games/${doc.game.id.@id}?move=${item.@index}">${item.@move}</a> |
jaroslav@100 | 144 |
</#if> |
jaroslav@100 | 145 |
</#macro> |
jaroslav@60 | 146 |
|
jaroslav@100 | 147 |
<h3><a href="/games/${doc.game.id.@id}?move=0">${bundle.MOVES}</a></h3> |
jaroslav@60 | 148 |
|
jaroslav@60 | 149 |
<table border="0"> |
jaroslav@60 | 150 |
<thead> |
jaroslav@60 | 151 |
<tr> |
jaroslav@60 | 152 |
<th>${bundle.MOVENUMBER}</th> |
jaroslav@60 | 153 |
<th>${doc.game.id.@white}</th> |
jaroslav@60 | 154 |
<th>${doc.game.id.@black}</th> |
jaroslav@60 | 155 |
</tr> |
jaroslav@60 | 156 |
</thead> |
jaroslav@60 | 157 |
<tbody> |
jaroslav@61 | 158 |
<#assign index = 0> |
jaroslav@60 | 159 |
<#list doc.game.moves.* as item> |
jaroslav@100 | 160 |
|
jaroslav@60 | 161 |
<#if item.@index?number % 2 = 1> |
jaroslav@61 | 162 |
<#assign index = index + 1> |
jaroslav@100 | 163 |
<tr><td>${index}</td><td><@printMove item/></td> |
jaroslav@60 | 164 |
<#else> |
jaroslav@100 | 165 |
<td><@printMove item/></td></tr> |
jaroslav@60 | 166 |
</#if> |
jaroslav@60 | 167 |
</#list> |
jaroslav@60 | 168 |
</tbody> |
jaroslav@60 | 169 |
</table> |
jaroslav@88 | 170 |
<hr/> |
jaroslav@88 | 171 |
${bundle("copyright", version)} |
jtulach@41 | 172 |
</body> |
jtulach@41 | 173 |
</html> |