view montage/templates/sequence.html @ 40:77c3439e76bb default tip

py3
author Jeff Hammel <k0scist@gmail.com>
date Wed, 25 Nov 2020 11:00:17 -0800
parents 87e02281dcac
children
line wrap: on
line source

<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <head>
    <xi:include href="head.html"/>
    <style>
      .spacer {
      width: 3em;
      }
    </style>
  </head>
  <body>
    <xi:include py:if="include" href="${include}"/>

    <center py:if="files" py:with="index = int(request.GET.get('index', 0))">
      <div py:if="index in range(len(files))" py:with="image = files[index]" class="image">
        <a name="${image['path']}"></a>
        <a href="${image['link']}">
          <img src="${image['path']}" width="${width or None}" height="${height or None}" title="${image.get('title', image['description'])}"/>
        </a>
        <br/>
        <p py:if="image.get('title', None)">
          <i>${image.get('title', '')}</i>
        </p>
        ${image['description']}
      </div>
      <py:if test="(index - 1) in range(len(files))">
	<a href="?index=${index - 1}" py:with="image=files[index - 1]">
	  ${image.get('title') or image.get('description') or '&laquo;&laquo;'}
	</a>
      </py:if>
      <span class="spacer"></span>
      <py:if test="(index + 1) in range(len(files))">
	<a href="?index=${index + 1}" py:with="image=files[index + 1]">
          ${image.get('title') or image.get('description') or '&raquo;&raquo;'}
        </a>
      </py:if>
    </center>

  </body>
</html>