Revert "Upload avec script adhoc."
[Portfolio.git] / skins / photo_layout_macros.pt
1 <html xmlns:tal="http://xml.zope.org/namespaces/tal" xmlns:metal="http://xml.zope.org/namespaces/metal">
2 <head>
3 <title>Display macros for arbitrary set of photos</title>
4 <meta http-equiv="content-type" content="text/html;charset=UTF-8"/>
5 </head>
6 <body>
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;
18 name info/cmf_uid">
19 <a class="slide" tal:attributes="href info/href; title info/title">
20 <img border="0" tal:attributes="src info/thumbUrl;
21 alt info/title;
22 height size/height;
23 width size/width;
24 style string:margin-top : ${margin_top}px ;;margin-left:${margin_left}px;"/>
25 </a>
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"/>
32 </a>
33 </span>
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"/>
39 </a>
40 </span>
41 </tal:block>
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"/>
47 </a>
48 </span>
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"/>
54 </a>
55 </span>
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"/>
66 </a>
67 </span>
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"/>
77 </a>
78 </span>
79 </tal:block>
80 </span>
81 </span>
82 </div>
83 <br clear="all"/>
84 <div metal:use-macro="here/batch_macros/macros/navigation">batch navigation</div>
85 <script type="text/javascript">
86 // <!--
87 (function(){
88 var lb = document.getElementById('lightbox');
89 var uploadUrl = absolute_url();
90 new Lightbox(lb);
91 new DDFileUploader(lb, uploadUrl);
92 })();
93 // -->
94 </script>
95 </div>
96
97
98 <div metal:define-macro="film_bar" tal:omit-tag="">
99 <div id="film_bar">
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"
106 ><img
107 tal:define="size info/thumbSize;
108 margin_top python:(slide_size - size['height']) / 2"
109 tal:attributes="src info/src;
110 alt info/title;
111 height size/height;
112 width size/width;
113 style string:margin-top : ${margin_top}px ;"/></a>
114 </td>
115 </tr>
116 </table>
117 </div>
118 <div class="jsslider">
119 <span id="slider"></span>
120 </div>
121 <script type="text/javascript" tal:content="python:'''
122 var startSlideShow, slideShowNext, stopSlideShow;
123 (function(){
124
125 var ctxInfos = {'filmLength': %(filmLength)s
126 ,'center': %(center)s
127 ,'slideSize': %(slideSize)d
128 ,'ctxUrlTranslation' : [%(reBaseCtxUrl)s, %(canonicalUrl)s]
129 };
130 var fs = new FilmSlider(document.getElementById('film_bar'),
131 document.getElementById('slider'),
132 ctxInfos,
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();};
141 })();
142 ''' % {'filmLength': len(contextInfos['infos'])
143 ,'center': index
144 ,'slideSize': portal_object.thumb_width/2 + 11
145 ,'reBaseCtxUrl':contextInfos['reBaseCtxUrl']
146 ,'canonicalUrl':contextInfos['canonicalUrl']
147 }">
148 </script>
149 </div>
150
151 </body>
152 </html>