Annotation of kupuMPIWG/plone/kupu_plone_layer/kupucollection.xml.pt, revision 1.1.1.1

1.1       dwinter     1: <tal:block define="charset here/portal_properties/site_properties/default_charset|here/portal_properties/default_charset|string:utf-8;
                      2:         content_type python:request.RESPONSE.setHeader('Content-Type', 'text/xml;;charset=%s' % charset);"
                      3:  replace='structure string:&lt;?xml version="1.0" encoding="${charset}" ?&gt;'>
                      4: <?xml version="1.0"?>
                      5: </tal:block>
                      6: <collection
                      7:     xmlns:tal="http://xml.zope.org/namespaces/tal"
                      8:     xmlns:metal="http://xml.zope.org/namespaces/metal"
                      9:     >
                     10:   <tal:with define="info python:context.kupuInfoForBrains([context])[0]">
                     11:     <metal:macro use-macro="here/kupucollection.xml/macros/commonToAllItems" />
                     12:     <src tal:define="resource_type request/resource_type | string:mediaobject;
                     13:         global supportsupload python:resource_type=='mediaobject';
                     14:         global showimagesize python:resource_type=='mediaobject';"
                     15:          tal:content="string:${here/absolute_url}/${template/getId}?resource_type=${resource_type}">Source</src>
                     16:   </tal:with>
                     17: 
                     18:   <items metal:define-macro="collectionItems">
                     19:      <tal:var define="global resource_type request/resource_type | string:mediaobject;" />
                     20:      <metal:slot define-slot="defineItems">
                     21:        <tal:comment condition="nothing">
                     22:          The default resource type is mediaobject
                     23:        </tal:comment>
                     24:        <tal:var define="
                     25:            list_types  python:context.kupuGetResourceTypes(resource_type, True);
                     26:            link_types  python:context.kupuGetResourceTypes(resource_type, False);
                     27:            content     python:context.getFolderContents(contentFilter=list_types);
                     28:            global items python:context.kupuInfoForBrains(content,
                     29:                 linkhere=context.portal_type in link_types,
                     30:                 linkparent=True, showimagesize=showimagesize);
                     31:            " />
                     32:      </metal:slot>
                     33: 
                     34: 
                     35:     <tal:loop repeat="info items">
                     36: 
                     37:       <tal:comment condition="nothing">
                     38:         We use the URI as ID here, because all resource need to have a
                     39:         site-wide unique id
                     40:       </tal:comment>
                     41: 
                     42:       <resource tal:attributes="id info/url"
                     43:                 tal:condition="not:info/collection">
                     44:         <metal:macro define-macro="commonToAllItems">
                     45:           <uri metal:define-slot="uri"
                     46:                tal:content="info/url">URI</uri>
                     47:           <icon metal:define-slot="icon"
                     48:                 tal:content="info/icon">icon</icon>
                     49:           <size metal:define-slot="size"
                     50:                 tal:condition="info/size"
                     51:                 tal:content="info/size">size</size>
                     52:           <tal:block condition="python:info.get('width') and info.get('height')">
                     53:               <width metal:define-slot="width"
                     54:                      tal:content="info/width">width</width>
                     55:               <height metal:define-slot="height"
                     56:                      tal:content="info/height">height</height>
                     57:           </tal:block>
                     58:           <preview metal:define-slot="preview"
                     59:                    tal:condition="info/preview"
                     60:                    tal:content="string:${info/url}/${info/preview}"></preview>
                     61:           <label metal:define-slot="label"
                     62:                 tal:condition="info/label|nothing"
                     63:                 tal:content="info/label">label</label>
                     64:           <title metal:define-slot="title"
                     65:                  tal:content="info/title">title</title>
                     66:           <description metal:define-slot="description"
                     67:                        tal:content="info/description">description</description>
                     68:         </metal:macro>
                     69:       </resource>
                     70: 
                     71:       <collection tal:attributes="id info/url"
                     72:                   tal:condition="info/collection">
                     73:         <metal:insert use-macro="here/kupucollection.xml/macros/commonToAllItems" />
                     74:         <src tal:content="string:${info/url}/kupucollection.xml?resource_type=${resource_type}">Source</src>
                     75:       </collection>
                     76: 
                     77:     </tal:loop>
                     78:     <uploadbutton tal:condition="supportsupload|nothing" />
                     79:   </items>
                     80: 
                     81: </collection>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>