<span
  xmlns="http://www.w3.org/1999/xhtml"
  xmlns:metal="http://xml.zope.org/namespaces/metal"
  xmlns:notal="http://www.infrae.com/silva/notal"
  xmlns:tal="http://xml.zope.org/namespaces/tal"
  xmlns:i18n="http://xml.zope.org/namespaces/i18n"
  i18n:domain="silva_news"

  tal:define="view here;
        model view/REQUEST/model;
                   global silva_root view/silva_root;
                   global formatdate nocall:view/service_news/format_date;
                   "
>

  <div class="margins">
    <h2 class="heading" i18n:translate="">Search <tal:block i18n:name="title" tal:content="model/get_title" /></h2>
  </div>

  <tal:comment condition="nothing">Begin items</tal:comment>

  <tal:block define="global results python:model.search_items(
                                            view.REQUEST['query']);"
          on-error="structure string:<span class='error'>Error searching: ${error/value}'</span>" />

  <tal:block define="global results results | python:[]" />

  <div class="searchbox">
    <form tal:attributes="action model/absolute_url" method="POST">
      <input type="text" name="query" tal:attributes="value request/query|nothing"/>
      <input type="submit" class="button" value="Search" title="Do a full text search: alt-s"
              accesskey="s" i18n:attributes="title;value" />
    </form>
  </div>

  <div class="item" tal:repeat="r results">
   <tal:block define="obj r/getObject">
    <metal:macro use-macro="here/agendaitem_macro/macros/agendaitem" />
   </tal:block>
  </div>

  <div class="item" tal:condition="python: len(results) < 1" i18n:translate="">
    There are no articles corresponding to your query
  </div>

  <div class="viewlinks">
    <div class="viewlink">
      <a href="#" tal:attributes="href string:?view=view_agenda" i18n:translate="">view agenda</a>
    </div>
    <div class="viewlink">
      <a href="#" tal:attributes="href string:?view=view_archive" i18n:translate="">view past and future articles</a>
    </div>
  </div>

</span>
