  {% include "common/content-bookend.tpl.html" ignore missing %}
  <script type="text/javascript">
    Post0 = new APost(0);
  </script>
  <table class="post_bounds">
    <tr>
      <td class="post">
      {% if Content|length > 0 %}
        <a href="javascript:void(0)" onclick="Post0.toggleDisplayOf('refineSearch', this)" title="Show this section"><code>+</code> Refine your search</a>
        <div class="quote" id="post_0$refineSearch" style="visibility:hidden; display:none">
      {% else %}
        <a href="javascript:void(0)" onclick="Post0.toggleDisplayOf('refineSearch', this)" title="Hide this section"><code>-</code> Refine your search</a>
        <div class="quote" id="post_0$refineSearch">
      {% endif %}
          {% include "site/search/attachments/search.tpl.html" ignore missing %}
        </div>
      </td>
    </tr>
  </table>  
  <table class="post">
  {% for Attachment in Content %}
    <tr>
      <td rowspan="4" class="{{ loop.cycle('search_result_count_odd', 'search_result_count_even') }}">{{ loop.index + Script.Request.offset.value }}</td>           
      <td>
        <a href="{{ Site.url(channel=Channel.name, title=Attachment.name()) }}" title="View attachment details"><strong>{{ Attachment.name() }}</strong></a>
      </td>
      <td rowspan="3">
        <a href="{{ Script.path(Attachment.clientPath) }}" title="Download attachment">
      {% if "image" in Attachment.mimeType %}
        <img src="{{ Script.path(Attachment.clientPath) }}" title="Download attachment" class="post_icon" />
      {% elif Attachment.icon() %}
        <img src="{{ Attachment.icon() }}" alt="Attachment icon" class="post_icon" />
      {% else %}
        <img src="{{ Script.path(Channel.icon) }}" alt="Attachment icon" class="post_icon" />
      {% endif %}
        </a>
      </td>
     </tr>
    <tr>
      <td>{{ Attachment.description }}</td>
    </tr>
    <tr>
      <td class="post_attributes">
        <table>
          <tr>
            <td class="field_name">Uploaded:</td>
            <td>{{ Time.localString(Attachment.published) }}</td>
          </tr>
          <tr>
            <td class="field_name">Tags:</td>
            <td>
              {%- for keyword in Attachment.keywords -%}
                {%- if loop.index0 > 0 -%}
                  ,
                {%- endif %}
                <a href="{{ Site.url(channel=Channel.name, view='site/search/attachments/results', title=keyword, what='tags') }}" title="Search for other attachments that are tagged with &quot;{{ keyword }}&quot;">{{- keyword -}}</a>
              {%- endfor -%}              
            </td>
          </tr>
        </table>
      </td>
    </tr>    
    <tr>
      <td class="post_footer">
        <a href="{{ Site.url(channel=Channel.name, title=Attachment.name()) }}" title="View attachment details">Details</a> |
        <a href="{{ Script.path(Attachment.clientPath) }}" title="Download attachment">Download ({{ Attachment.fileSize|filesizeformat(true) }})</a>
      </td>
    </tr>
  {% else %}
    <tr>
      <td>
      {% if Site.Attachments.allowed and User.has(Right.toPost, Channel.name) %}
        {% include "site/search/attachments/upload.tpl.html" ignore missing %}
      {% endif %}
      </td>
    </tr>
  {% endfor %}
</table>

