  {% for Attachment in Content %}
  <!-- Begin attachment {{ Attachment.id }} -------------------------------- -->
  <div class="post" id="post_{{ Attachment.id }}">
    <script type="text/javascript">
      var Post{{ Attachment.id }} = new APost({{ Attachment.id }});
    </script>
    <table class="post_bounds" id="post_{{ Attachment.id }}$bounds">
      <tr>
        <td class="post_title" id="post_{{ Attachment.id }}$title">{{ Attachment.name() }}</td>
        <td valign="top" id="post_{{ Attachment.id }}$icon" rowspan="3">
        {% if Attachment.icon() %}
          <img class="post_icon" src="{{ Attachment.icon() }}" alt="Attachment icon" />
        {% else %}
          <img class="post_icon" src="{{ Script.path(Channel.icon) }}" alt="Attachment icon" />
        {% endif %}
        </td>
      </tr>
      <tr>
        <td class="post_header" id="post_{{ Attachment.id }}$header">
          <strong>created</strong> on {{ Time.localString(Attachment.created) }} (GMT {{ Time.zoneOffset() }}) by <a href="{{ Site.url(channel='$site/user/profile', title=Attachment.author) }}" title="View profile for {{ Attachment.author }}">{{ Attachment.author }}</a><br />        
          <strong>edited</strong> on {{ Time.localString(Attachment.published) }} (GMT {{ Time.zoneOffset() }}) by <a href="{{ Site.url(channel='$site/user/profile', title=Attachment.editor) }}" title="View profile for {{ Attachment.editor }}">{{ Attachment.editor }}</a>
        </td>
      </tr>
      <tr>
        <td class="post_footer">
          <a href="{{ Script.path(Attachment.clientPath) }}" title="Download this attachment">Download this attachment</a>
        {% if User.has(Right.toEdit, Channel.name) %}
          | 
          <a href="{{ Site.url(channel=Channel.name, view='site/attach/edit', title=Attachment.name()) }}" title="Edit this attachment">Edit this attachment</a>
        {% endif %}
        {% if User.has(Right.toDelete, Channel.name) %}
          |
          <a href="javascript:Post{{ Attachment.id }}.delete('{{ Site.url(channel=Channel.name) }}')" title="Delete this attachment">Delete this attachment</a>
        {% endif %}
        </td>
      </tr>
      <tr>
        <td id="post_{{ Attachment.id }}$content" class="post_content">
        {% if "image" in Attachment.mimeType %}
          <p style="text-align:center">
            <img class="post_bounds" src="{{ Script.path(Attachment.clientPath) }}" alt="Attachment image" style="border:none">
          </p>
        {% endif %}
          {{ Attachment.description }}
        </td>
      </tr>
      <tr>
        <td class="post_attributes">
          <table class="post_attributes">
            <tr>
              <td class="field_name">File type:</td>
              <td>{{ Attachment.mimeType }}</td>
            </tr>
            <tr>
              <td class="field_name">File size:</td>
              <td>{{ Attachment.fileSize|filesizeformat(true) }}</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>
          {% if "image" in Attachment.mimeType %}
            <tr>
              <td class="field_name">Image reference:</td>
              <td>
                <code>![{{ Attachment.name() }}](attach:{{ Attachment.name() }})</code></br/>
                <small>
                  <em>
                    To embed this image, you can copy and paste the above text
                    into a Markdown-formatted post.
                  </em>
                </small>
              </td>
            </tr>
          {% endif %}              
            <tr>
              <td class="field_name">Shortlink:</td>
              <td>
                <code>[{{ Attachment.name() }}](attach:{{ Attachment.name() }})</code><br />
                <small>
                  <em>
                    To link to this attachment, you can copy and paste the above
                    text into a Markdown-formatted post.
                  </em>
                </small>
              </td>
            </tr>
            <tr>
              <td class="field_name">Permalink:</td>
              <td>
                <a href="http://{{ Site.host }}{{ Script.path(Attachment.clientPath) }}" title="Download this post">http://{{ Site.host }}{{ Script.path(Attachment.clientPath) }}</a>
              </td>
            </tr>                
          </table>
        </td>
      </tr>
    </table>
  </div>
  <!-- End attachment{{ Attachment.id }} --------------------------------- -->
  {% endfor %}

