82511dde64e0e72e587028850aea77a0c4d13b3d
[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"
12 tal:define="mayBeDropable exists:dropable;
13 dropable python:True if mayBeDropable and dropable else False"
14 tal:attributes="class python:'lightbox photo-drop-target' if dropable else 'lightbox'">
15 <span tal:repeat="info infos" tal:omit-tag="">
16 <span tal:define="size info/thumbSize;
17 margin_top python:(slide_size - size['height']) / 2;
18 margin_left python:(slide_size - size['width']) / 2;
19 selected info/selected|nothing"
20 tal:attributes="class info/className;
21 name info/cmf_uid">
22 <a class="slide" tal:attributes="href info/href; title info/title">
23 <img border="0" tal:attributes="src info/thumbUrl;
24 alt info/title;
25 height size/height;
26 width size/width;
27 style string:margin-top : ${margin_top}px ;;margin-left:${margin_left}px;"/>
28 </a>
29 <tal:block tal:condition="python:features.has_key('select')">
30 <span class="button slide-select" tal:condition="not:selected">
31 <a name="add_to_selection" title="Add to selection" i18n:attributes="title"
32 tal:attributes="href python:features['select'](info['o'], False)">
33 <img tal:attributes="src string:${portal_url}/transparent.gif" height="17" width="12"
34 alt="Add to selection" i18n:attributes="alt"/>
35 </a>
36 </span>
37 <span class="button slide-deselect" tal:condition="selected">
38 <a name="remove_to_selection" title="Remove to selection" i18n:attributes="title"
39 tal:attributes="href python:features['select'](info['o'], True)">
40 <img tal:attributes="src string:${portal_url}/transparent.gif" height="17" width="12"
41 alt="Remove to selection" i18n:attributes="alt"/>
42 </a>
43 </span>
44 </tal:block>
45 <span class="button slide-cart" tal:condition="python:info.get('buyable')">
46 <a name="add_to_cart" title="Add to cart" i18n:attributes="title"
47 tal:attributes="href python:features['cart'](info['o'])">
48 <img tal:attributes="src string:${portal_url}/transparent.gif" height="17" width="20"
49 alt="Add to cart" i18n:attributes="alt"/>
50 </a>
51 </span>
52 <span class="button slide-del" tal:condition="python:features.has_key('del')">
53 <a title="Delete" i18n:attributes="title"
54 tal:attributes="href python:features['del'](info['o'])">
55 <img tal:attributes="src string:${portal_url}/transparent.gif" height="19" width="18"
56 alt="Delete" i18n:attributes="alt"/>
57 </a>
58 </span>
59 <tal:block tal:condition="features/hideAnonymous|nothing">
60 <span class="button slide-hide" tal:condition="not:info/hiddenForAnonymous"
61 tal:define="mtop python:margin_top + 4;
62 mleft python:margin_left + size['width'] - 17"
63 tal:attributes="style python:'margin-top:%dpx;; margin-left:%dpx' % (mtop, mleft)">
64 <a title="Hide for anonymous" i18n:attributes="title"
65 name="hide_for_anonymous"
66 tal:attributes="href string:${info/href}/hideForAnonymous">
67 <img tal:attributes="src string:${portal_url}/transparent.gif" height="15" width="16"
68 alt="Hide for anonymous" i18n:attributes="alt"/>
69 </a>
70 </span>
71 <span class="button slide-show" tal:condition="info/hiddenForAnonymous"
72 tal:define="mtop python:margin_top + 4;
73 mleft python:margin_left + size['width'] - 17"
74 tal:attributes="style python:'margin-top:%dpx;; margin-left:%dpx' % (mtop, mleft)">
75 <a title="Show for anonymous" i18n:attributes="title"
76 name="show_for_anonymous"
77 tal:attributes="href string:${info/href}/resetHide">
78 <img tal:attributes="src string:${portal_url}/transparent.gif" height="15" width="16"
79 alt="Show for anonymous" i18n:attributes="alt"/>
80 </a>
81 </span>
82 </tal:block>
83 </span>
84 </span>
85 </div>
86 <br clear="all"/>
87 <div metal:use-macro="here/batch_macros/macros/navigation">batch navigation</div>
88 <script type="text/javascript">
89 // <!--
90 (function(){
91 var lb = document.getElementById('lightbox');
92 var uploadUrl = absolute_url() + '/put_upload';
93 new Lightbox(lb);
94 new DDFileUploader(lb, uploadUrl);
95 })();
96 // -->
97 </script>
98 </div>
99
100
101 <div metal:define-macro="film_bar" tal:omit-tag="">
102 <div id="film_bar">
103 <table cellspacing="0">
104 <tr tal:define="slide_size python:portal_object.thumb_height/2 + 10">
105 <td tal:repeat="info contextInfos/infos">
106 <a href="." tal:attributes="href info/href;
107 class info/className;
108 portfolio:position info/index"
109 ><img
110 tal:define="size info/thumbSize;
111 margin_top python:(slide_size - size['height']) / 2"
112 tal:attributes="src info/src;
113 alt info/title;
114 height size/height;
115 width size/width;
116 style string:margin-top : ${margin_top}px ;"/></a>
117 </td>
118 </tr>
119 </table>
120 </div>
121 <div class="jsslider">
122 <span id="slider"></span>
123 </div>
124 <script type="text/javascript" tal:content="python:'''
125 var startSlideShow, slideShowNext, stopSlideShow;
126 (function(){
127
128 var ctxInfos = {'filmLength': %(filmLength)s
129 ,'center': %(center)s
130 ,'slideSize': %(slideSize)d
131 ,'ctxUrlTranslation' : [%(reBaseCtxUrl)s, %(canonicalUrl)s]
132 };
133 var fs = new FilmSlider(document.getElementById('film_bar'),
134 document.getElementById('slider'),
135 ctxInfos,
136 document.getElementById('medium_image').getElementsByTagName('img')[0],
137 document.getElementById('image_toolbar'),
138 document.getElementById('Breadcrumbs'));
139 startSlideShow = function() {return fs.startSlideShow();};
140 stopSlideShow = function() {return fs.stopSlideShow();};
141 slideShowPrevious = function() {return fs.slideShowPrevious();};
142 slideShowNext = function() {return fs.slideShowNext();};
143 slideShowImageLoaded = function() {return fs.slideShowImageLoaded();};
144 })();
145 ''' % {'filmLength': len(contextInfos['infos'])
146 ,'center': index
147 ,'slideSize': portal_object.thumb_width/2 + 11
148 ,'reBaseCtxUrl':contextInfos['reBaseCtxUrl']
149 ,'canonicalUrl':contextInfos['canonicalUrl']
150 }">
151 </script>
152 </div>
153
154 </body>
155 </html>