view zpt/www/common_template.zpt @ 26:8a99ad8713d6

new common template for fragments. new styles for servicebox.
author casties
date Thu, 18 Apr 2013 20:39:01 +0200
parents
children b12d80f033fb
line wrap: on
line source

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
  <!-- common template snippets as METAL macros -->

  <!-- full-row feature block -->
  <div class="row teaser" metal:define-macro="feature_teaser"
    tal:define="features python:here.getFeatures(); 
                feature_num python:int(request.get('ff',len(features)-1)); 
                feature python:features[feature_num];
                feature_url python:feature.getUrl('%s/%s/features'%(root,secmap['news']));
                teaser_path string:here/features/${feature/getTeaserPath};">
    <!-- feature image and intro -->
    <div class="col">
      <div class="box teaser_image">
        <div class="slider prev" tal:condition="python:feature_num>1">
          <a tal:attributes="href python:'?ff=%s'%(feature_num-1)"><img tal:attributes="src string:$root/images/slider_prev.png"
            alt="previous" /></a>
        </div>
        <a tal:attributes="href feature_url"> <img tal:attributes="src feature/getFrontpageImgUrl" width="593" height="351" />
        </a>
        <tal:block tal:condition="exists:python:path(teaser_path+'/macros/caption')">
          <tal:block metal:use-macro="python:path(teaser_path+'/macros/caption')" />
        </tal:block>
      </div>
    </div>
    <div class="col">
      <div class="box teaser_text">
        <div class="feature_number" tal:content="feature_num|nothing" />
        <div class="date" tal:content="feature/getDateString" />
        <h3>
          <metal:block metal:define-slot="topic_title">Current Research Topic</metal:block>
        </h3>
        <tal:block tal:condition="exists:python:path(teaser_path+'/macros/text')">
          <tal:block tal:condition="exists:python:path(teaser_path+'/macros/text')"
            metal:use-macro="python:path(teaser_path+'/macros/text')" />
        </tal:block>
        <p>
          <a class="internal" tal:attributes="href feature_url"><metal:block metal:define-slot="topic_link">Current Research Topic</metal:block></a>
        </p>
        <p>
          <a class="internal" tal:attributes="href string:$root/${secmap/news}/featurearchive.html"><metal:block
              metal:define-slot="topic_archive">Research Topic Archive</metal:block></a>
        </p>
        <div class="slider next" tal:condition="python:feature_num<len(features)-1">
          <a tal:attributes="href python:'?ff=%s'%(feature_num+1)"><img tal:attributes="src string:$root/images/slider_next.png"
            alt="next" /></a>
        </div>
      </div>
    </div>
  </div>
  <!-- feature -->

</body>
</html>