<?xml version="1.0" ?>

<!-- 
	Full "abstract page" (or splash page or summary page, depending on your jargon) for an eprint. 
-->

<cite:citation xmlns="http://www.w3.org/1999/xhtml" xmlns:epc="http://eprints.org/ep3/control" xmlns:cite="http://eprints.org/ep3/citation" >

  <p style="margin-bottom: 1em">
    <epc:print expr="$item.citation($config{citation_default}{eprint}{for_summary_page})" />
  </p>

  <epc:if test="$flags{has_multiple_versions}">
    <div style="margin-bottom: 1em">
      <epc:print expr="$multi_info" />
    </div>
  </epc:if>

  <epc:set name='docs' expr='$item.documents()'>

    <epc:if test="length($docs) = 0">
      <epc:phrase ref="page:nofulltext" />
      <!--<epc:if test="$item.contact_email().is_set() and eprint_status = 'archive'">
        (<a href="{$config{perl_url}/request_doc?eprintid={eprintid}"><epc:phrase ref="request:button" /></a>)
      </epc:if>-->
    </epc:if>
  
    <epc:if test="length($docs) gt 0">
      <epc:phrase ref="page:fulltext" />
      <div>
        <epc:foreach expr="$docs" iterator="doc">
          <div class="ep_summary_page_document">
            <span><epc:print expr="$doc.icon('HoverPreview','noNewWindow','previewRight')}" /></span>
            <span>
              <epc:print expr="$doc.citation($config{citation_default}{document}{for_summary_page})" /><br />
              <a href="{$doc.url()}" class="ep_document_link"><epc:phrase ref="summary_page:download"/> (<epc:print expr="$doc.doc_size().human_filesize()" />)</a>
              <epc:if test="$doc.is_public()">
			  <epc:choose>
			  <epc:when test="$doc.thumbnail_url('video_mp4').is_set()">
			  | <epc:print expr="$doc.preview_link(phrase('lib/document:preview'),'docs','video_mp4')" />
			  </epc:when>
			  <epc:when test="$doc.thumbnail_url('audio_mp4').is_set()">
			  | <epc:print expr="$doc.preview_link(phrase('lib/document:preview'),'docs','audio_mp4')" />
			  </epc:when>
			  <epc:when test="$doc.thumbnail_url('lightbox').is_set()">
			  | <epc:print expr="$doc.preview_link(phrase('lib/document:preview'),'docs','lightbox')" />
			  </epc:when>
			  </epc:choose>
			  </epc:if>
              <epc:if test="!$doc.is_public() and $item.contact_email().is_set() and eprint_status = 'archive'">
                | <a href="{$config{perl_url}}/request_doc?docid={$doc{docid}"><epc:phrase ref="request:button" /></a>
              </epc:if>
  
              <ul>
              <epc:foreach expr="$doc.related_objects('http://eprints.org/relation/hasVersion')" iterator="rel">
                <epc:if test="$rel{relation_type}!='http://eprints.org/relation/isVolatileVersionOf'">
                  <li><epc:print expr="$rel.citation_link($config{citation_default}{eprint}{for_summary_page})" /></li>
                </epc:if>
              </epc:foreach>
              </ul>
            </span>
          </div>
        </epc:foreach>
      </div>
      <div class="ep_summary_page_document"/>
    </epc:if>

  </epc:set>


  <table style="margin-bottom: 1em; margin-top: 1em;" cellpadding="3">
    <tr>
      <th align="right"><epc:phrase ref="eprint_fieldname_type" />:</th>
      <td>
        <epc:print expr="type" />
      </td>
    </tr>
    <epc:comment> 
       The below block loops over a list of field names taken from eprint_render.pl
       Edit the list of metadata to show in the summary page table in eprint_render.pl
    </epc:comment>
    <epc:foreach expr="$config{summary_page_metadata}" iterator="fieldname">
      <epc:if test="is_set($item.property($fieldname))">
        <tr>
          <th align="right"><epc:phrase ref="eprint_fieldname_{$fieldname}" />:</th>
          <td valign="top"><epc:print expr="$item.property($fieldname)" /></td>
        </tr>
      </epc:if>
    </epc:foreach>
    <tr>
      <th align="right">URI:</th>
      <td valign="top"><a href="{$item.uri()}"><epc:print expr="$item.uri()" /></a></td>
    </tr>
  </table>

  <epc:if test="$flags{has_multiple_versions}">
    <epc:phrase ref="page:available_versions" />
    <epc:print expr="$version_tree" />
  </epc:if>
  <epc:if test="$flags{in_commentary_thread}">
    <epc:phrase ref="page:commentary_threads" />
    <epc:print expr="$commentary_tree" />
  </epc:if>

  <epc:if test="!$flags{preview}">
    <epc:phrase ref="summary_page:actions"/>
    <dl class="ep_summary_page_actions">
    <epc:foreach expr="action_list('eprint_summary_page_actions',$item)" iterator="action">
      <dt><epc:print expr="$action.action_icon()" /></dt>
      <dd><epc:print expr="$action.action_title()" /></dd>
    </epc:foreach>
    </dl>
  </epc:if>

</cite:citation>
