freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt
changeset 78 5ea4172dcf8b
parent 77 d574ac6e44cc
child 79 89bca098e14e
     1.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Fri Sep 11 20:32:15 2009 +0200
     1.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Fri Sep 11 22:25:21 2009 +0200
     1.3 @@ -7,8 +7,26 @@
     1.4    <body>
     1.5        <h1>${bundle.TITLE}</h1>
     1.6  
     1.7 +      <#macro past t>
     1.8 +        <#if t < 60000>
     1.9 +          <#assign unit="s"/>
    1.10 +          <#assign value= t?float / 1000.0/>
    1.11 +        <#elseif t < 3600000>
    1.12 +          <#assign unit="min"/>
    1.13 +          <#assign value=t?float / 60000.0/>
    1.14 +        <#elseif t < 24 * 3600 * 1000>
    1.15 +          <#assign unit="h"/>
    1.16 +          <#assign value=t?float / 3600000.0/>
    1.17 +        <#else>
    1.18 +          <#assign unit="day"/>
    1.19 +          <#assign value=t?float / (24.0 * 3600000.0)/>
    1.20 +        </#if>
    1.21 +        ${value?float?string("0")} ${unit}
    1.22 +      </#macro>
    1.23 +
    1.24        <#macro game game>
    1.25 -          ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} <a href="/games/${game.@id}/">${bundle.BOARD}</a>
    1.26 +          ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} 
    1.27 +          <a href="/games/${game.@id}/">${bundle.before} <@past (now - game.@modified?number)/></a>
    1.28        </#macro>
    1.29  
    1.30        <#if message?? >