freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt
changeset 80 e03f660f0e0a
parent 79 89bca098e14e
child 88 a3be2be0112f
     1.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Sat Sep 12 05:00:28 2009 +0200
     1.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Sat Sep 12 09:11:13 2009 +0200
     1.3 @@ -7,26 +7,18 @@
     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 -        <!--millis ${t}-->${value?float?string("0")} ${unit}
    1.22 +      <#macro before t>
    1.23 +        <#assign seconds = (t / 1000)?int/>
    1.24 +        <#assign minutes= (seconds / 60)?int/>
    1.25 +        <#assign hours= (minutes / 60)?int/>
    1.26 +        <#assign days= (hours / 24)?int/>
    1.27 +        <!--millis: ${t}, seconds: ${seconds}, minutes: ${minutes} hours: ${hours}, days: ${days} -->
    1.28 +        ${bundle("LastMove", t?int, seconds?int, minutes?int, hours?int, days?int)}
    1.29        </#macro>
    1.30  
    1.31        <#macro game game>
    1.32            ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} 
    1.33 -          <a href="/games/${game.@id}/">${bundle.before} <@past (now - game.@modified?number)/></a>
    1.34 +          <a href="/games/${game.@id}/"><@before (now - game.@modified?number)?int/></a>
    1.35        </#macro>
    1.36  
    1.37        <#if message?? >