1 <html xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal">
3 <title>Display macros for arbitrary set of photos</title>
4 <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
7 <div metal:define-macro="grid"
8 tal:define="slide_size portal_object/slide_size;"
9 i18n:domain="portfolio">
10 <div metal:use-macro="here/batch_macros/macros/navigation">batch navigation</div>
11 <div id="lightbox" class="lightbox photo-drop-target">
12 <span tal:repeat="info infos" tal:omit-tag="">
13 <span tal:define="size info/thumbSize;
14 margin_top python:(slide_size - size['height']) / 2;
15 margin_left python:(slide_size - size['width']) / 2;
16 selected info/selected|nothing"
17 tal:attributes="class info/className;
19 <a class="slide" tal:attributes="href info/href; title info/title">
20 <img border="0" tal:attributes="src info/thumbUrl;
24 style string:margin-top : ${margin_top}px ;;margin-left:${margin_left}px;"/>
26 <tal:block tal:condition="python:features.has_key('select')">
27 <span class="button slide-select" tal:condition="not:selected">
28 <a name="add_to_selection" title="Add to selection" i18n:attributes="title"
29 tal:attributes="href python:features['select'](info['o'], False)">
30 <img tal:attributes="src string:${portal_url}/transparent.gif" height="17" width="12"
31 alt="Add to selection" i18n:attributes="alt"/>
34 <span class="button slide-deselect" tal:condition="selected">
35 <a name="remove_to_selection" title="Remove to selection" i18n:attributes="title"
36 tal:attributes="href python:features['select'](info['o'], True)">
37 <img tal:attributes="src string:${portal_url}/transparent.gif" height="17" width="12"
38 alt="Remove to selection" i18n:attributes="alt"/>
42 <span class="button slide-cart" tal:condition="python:info.get('buyable')">
43 <a name="add_to_cart" title="Add to cart" i18n:attributes="title"
44 tal:attributes="href python:features['cart'](info['o'])">
45 <img tal:attributes="src string:${portal_url}/transparent.gif" height="17" width="20"
46 alt="Add to cart" i18n:attributes="alt"/>
49 <span class="button slide-del" tal:condition="python:features.has_key('del')">
50 <a title="Delete" i18n:attributes="title"
51 tal:attributes="href python:features['del'](info['o'])">
52 <img tal:attributes="src string:${portal_url}/transparent.gif" height="19" width="18"
53 alt="Delete" i18n:attributes="alt"/>
56 <tal:block tal:condition="features/hideAnonymous|nothing">
57 <span class="button slide-hide" tal:condition="not:info/hiddenForAnonymous"
58 tal:define="mtop python:margin_top + 4;
59 mleft python:margin_left + size['width'] - 17"
60 tal:attributes="style python:'margin-top:%dpx;; margin-left:%dpx' % (mtop, mleft)">
61 <a title="Hide for anonymous" i18n:attributes="title"
62 name="hide_for_anonymous"
63 tal:attributes="href string:${info/href}/hideForAnonymous">
64 <img tal:attributes="src string:${portal_url}/transparent.gif" height="15" width="16"
65 alt="Hide for anonymous" i18n:attributes="alt"/>
68 <span class="button slide-show" tal:condition="info/hiddenForAnonymous"
69 tal:define="mtop python:margin_top + 4;
70 mleft python:margin_left + size['width'] - 17"
71 tal:attributes="style python:'margin-top:%dpx;; margin-left:%dpx' % (mtop, mleft)">
72 <a title="Show for anonymous" i18n:attributes="title"
73 name="show_for_anonymous"
74 tal:attributes="href string:${info/href}/resetHide">
75 <img tal:attributes="src string:${portal_url}/transparent.gif" height="15" width="16"
76 alt="Show for anonymous" i18n:attributes="alt"/>
84 <div metal:use-macro="here/batch_macros/macros/navigation">batch navigation</div>
85 <script type="text/javascript">
88 new Lightbox(document.getElementById('lightbox'));
95 <div metal:define-macro="film_bar" tal:omit-tag="">
97 <table cellspacing="0">
98 <tr tal:define="slide_size python:portal_object.thumb_height/2 + 10">
99 <td tal:repeat="info contextInfos/infos">
100 <a href="." tal:attributes="href info/href;
101 class info/className;
102 portfolio:position info/index"
104 tal:define="size info/thumbSize;
105 margin_top python:(slide_size - size['height']) / 2"
106 tal:attributes="src info/src;
110 style string:margin-top : ${margin_top}px ;"/></a>
115 <div class="jsslider">
116 <span id="slider"></span>
118 <script type="text/javascript" tal:content="python:'''
119 var startSlideShow, slideShowNext, stopSlideShow;
122 var ctxInfos = {'filmLength': %(filmLength)s
123 ,'center': %(center)s
124 ,'slideSize': %(slideSize)d
125 ,'ctxUrlTranslation' : [%(reBaseCtxUrl)s, %(canonicalUrl)s]
127 var fs = new FilmSlider(document.getElementById('film_bar'),
128 document.getElementById('slider'),
130 document.getElementById('medium_image').getElementsByTagName('img')[0],
131 document.getElementById('image_toolbar'),
132 document.getElementById('Breadcrumbs'));
133 startSlideShow = function() {return fs.startSlideShow();};
134 stopSlideShow = function() {return fs.stopSlideShow();};
135 slideShowPrevious = function() {return fs.slideShowPrevious();};
136 slideShowNext = function() {return fs.slideShowNext();};
137 slideShowImageLoaded = function() {return fs.slideShowImageLoaded();};
139 ''' % {'filmLength': len(contextInfos['infos'])
141 ,'slideSize': portal_object.thumb_width/2 + 11
142 ,'reBaseCtxUrl':contextInfos['reBaseCtxUrl']
143 ,'canonicalUrl':contextInfos['canonicalUrl']