<metal:macro define-macro="newsitem">
  <h3 class="heading newsitemheading" tal:content="structure r/get_title">article title</h3>

  <div class="newsiteminfo">
   <tal:infopublic 
     tal:define="
       publicationdate python: obj.get_metadata_element('silva-extra', 'publicationtime');
       displaydate r/display_datetime;"
     tal:condition="publicationdate"> 
    <p class="p newsiteminfopublicationdate">
     <tal:translate i18n:translate="">Publication date:</tal:translate>
     <span class="newsitempublicationdate"
         tal:content="python: formatdate(displaydate or publicationdate)" />
    </p>
   </tal:infopublic>

   <tal:comment tal:omit-tag=""><!-- if the object is an agenda item --></tal:comment>
   <p class="p eventdates"
     tal:define="
       startdate r/start_datetime;
       enddate r/end_datetime"
     tal:condition="python: startdate or enddate">
    <tal:if condition="startdate">
     <span tal:omit-tag="" i18n:translate="">Start:</span>
     <tal:startdate replace="python: formatdate(startdate, obj.display_time())" />
    </tal:if>
    <tal:if condition="enddate"><br />
     <span tal:omit-tag="" i18n:translate="">End:</span>
     <tal:enddate replace="python: formatdate(enddate, obj.display_time())" />
    </tal:if>
   </p>
  </div>

  <div class="newsintro">
   <img 
     tal:define="classname python: 'newsitem-thumbnail-%s'%(repeat['r'].odd() and 'odd' or 'even')"
     tal:replace="structure python: obj.get_thumbnail(classname)"
    />
<!--   <tal:insertintro replace="structure r/get_intro" />-->
   <tal:insertintro replace="structure python:obj.get_intro(max_size=128)" />
  </div>

  <p class="p articlelink">
   <a href="#" tal:attributes="href python:obj.get_content().absolute_url()" i18n:translate="">
    view article
   </a>
  </p>

</metal:macro>
