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 var lb = document.getElementById('lightbox');
89 var uploadUrl = absolute_url() + '/jsupload';
91 new DDFileUploader(lb, uploadUrl);
98 <div metal:define-macro="film_bar" tal:omit-tag="">
100 <table cellspacing="0">
101 <tr tal:define="slide_size python:portal_object.thumb_height/2 + 10">
102 <td tal:repeat="info contextInfos/infos">
103 <a href="." tal:attributes="href info/href;
104 class info/className;
105 portfolio:position info/index"
107 tal:define="size info/thumbSize;
108 margin_top python:(slide_size - size['height']) / 2"
109 tal:attributes="src info/src;
113 style string:margin-top : ${margin_top}px ;"/></a>
118 <div class="jsslider">
119 <span id="slider"></span>
121 <script type="text/javascript" tal:content="python:'''
122 var startSlideShow, slideShowNext, stopSlideShow;
125 var ctxInfos = {'filmLength': %(filmLength)s
126 ,'center': %(center)s
127 ,'slideSize': %(slideSize)d
128 ,'ctxUrlTranslation' : [%(reBaseCtxUrl)s, %(canonicalUrl)s]
130 var fs = new FilmSlider(document.getElementById('film_bar'),
131 document.getElementById('slider'),
133 document.getElementById('medium_image').getElementsByTagName('img')[0],
134 document.getElementById('image_toolbar'),
135 document.getElementById('Breadcrumbs'));
136 startSlideShow = function() {return fs.startSlideShow();};
137 stopSlideShow = function() {return fs.stopSlideShow();};
138 slideShowPrevious = function() {return fs.slideShowPrevious();};
139 slideShowNext = function() {return fs.slideShowNext();};
140 slideShowImageLoaded = function() {return fs.slideShowImageLoaded();};
142 ''' % {'filmLength': len(contextInfos['infos'])
144 ,'slideSize': portal_object.thumb_width/2 + 11
145 ,'reBaseCtxUrl':contextInfos['reBaseCtxUrl']
146 ,'canonicalUrl':contextInfos['canonicalUrl']