freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt
changeset 172 3de0568f7ee8
parent 169 e041463c81db
child 178 4b78d4f028b3
     1.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Tue Dec 08 23:56:20 2009 +0100
     1.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Wed Dec 23 20:45:19 2009 +0100
     1.3 @@ -1,5 +1,6 @@
     1.4  <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
     1.5  <html>
     1.6 +  <#setting locale = locale/>
     1.7    <#assign toMove = 0/>
     1.8    <#assign toWait = 0/>
     1.9    <#assign toWon = 0/>
    1.10 @@ -43,18 +44,20 @@
    1.11    <body bgcolor="white">
    1.12        <h1>${bundle.TITLE}</h1>
    1.13  
    1.14 -      <#macro before t>
    1.15 +      <#macro before t w>
    1.16          <#assign seconds = (t / 1000)?long/>
    1.17          <#assign minutes= (seconds / 60)?long/>
    1.18          <#assign hours= (minutes / 60)?long/>
    1.19          <#assign days= (hours / 24)?long/>
    1.20          <!--millis: ${t}, seconds: ${seconds}, minutes: ${minutes} hours: ${hours}, days: ${days} -->
    1.21 -        ${bundle("LastMove", t?int, seconds?int, minutes?int, hours?int, days?int)}
    1.22 +        ${bundle("LastMove", t?int, seconds?int, minutes?int, hours?int, days?int, w?date?string.long)}
    1.23        </#macro>
    1.24  
    1.25        <#macro game game>
    1.26 -          ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} 
    1.27 -          <a href="/games/${game.@id}/"><@before (now - game.@modified?number)?long/></a>
    1.28 +          ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)}
    1.29 +          <#assign sinceNow= now - game.@modified?number/>
    1.30 +          <#assign when=toDate[game.@modified?string]/>
    1.31 +          <a href="/games/${game.@id}/"><@before t=sinceNow w=when/></a>
    1.32            <#if game.@comments?number != 0>
    1.33              ${bundle("comments", game.@comments?number)}
    1.34            </#if>