<html xmlns:tal="http://xml.zope.org/namespaces/tal"
      xmlns:i18n="http://xml.zope.org/namespaces/i18n"
      xmlns:metal="http://xml.zope.org/namespaces/metal"
      metal:use-macro="path:view/macro"
      i18n:domain="horae.properties">
  <div metal:fill-slot="content">
    <div class="history">
      <h2 i18n:translate="">
        History
      </h2>
      <p class="discreet"
         tal:condition="not: view.changes"
         i18n:translate="">
        No changes made so far
      </p>
      <div class="change"
           tal:repeat="change view.changes">
        <h3>
          <span tal:condition="change['title']"
                tal:replace="change['title']" />
          <a href="" class="id"
             tal:attributes="href view.url()+'#change'+str(change['id']);
                             name 'change'+str(change['id']);">
            <small tal:condition="change['id']">#<span tal:replace="change['id']" /></small>
          </a>
        </h3>
        <div class="text" 
             tal:condition="change['comment']"
             tal:content="structure change['comment']" />
        <dl class="display-form"
            tal:condition="change['properties'] or change['workexpense']">
          <tal:block repeat="property change['properties']">
            <dt tal:content="property['name']" tal:attributes="class property.get('cssClass', None)" />
            <dd tal:attributes="class property.get('cssClass', None)">
              <tal:previous condition="property.get('previous', None) is not None">
              <span class="previous"
                    tal:content="structure property.get('previous', None)" /> →
              </tal:previous>
              <span tal:attributes="class python:property.get('previous', None) is not None and 'current' or ''"
                    tal:content="structure property['value']" />
            </dd>
          </tal:block>
        </dl>
        <h4 tal:condition="change['name']"
            tal:content="change['name']" />
        <div class="text" 
             tal:condition="change['description']"
             tal:content="structure change['description']" />
        <p class="byline discreet"
           i18n:translate="">
          <strong class="date"
                  tal:content="structure change['date']"
                  i18n:name="date" />
          by
          <strong class="user"
                  i18n:name="user">
            <a href=""
               tal:omit-tag="not: change['user_url']"
               tal:attributes="href change['user_url']"
               tal:content="change['user']">
              User
            </a>
          </strong>.
        </p>
      </div>
    </div>
  </div>
</html>