products/CPSSubscriptions

changeset 1067:2da7f1862eee CPS-3.5

#2049: here is the new macro
author Georges Racinet on purity.racinet.fr <georges@racinet.fr>
date Sun, 02 Oct 2011 12:16:46 +0200
parents d556b73e7e72
children e91bfc6740e4
files skins/cps_subscriptions/subscriptions_lib_display_detailed_recipients.pt
diffstat 1 files changed, 76 insertions(+), 0 deletions(-) [+]
line diff
     1.1 new file mode 100644
     1.2 --- /dev/null
     1.3 +++ b/skins/cps_subscriptions/subscriptions_lib_display_detailed_recipients.pt
     1.4 @@ -0,0 +1,76 @@
     1.5 +<metal:block define-macro="events_in_div">
     1.6 + <div tal:repeat="event item/events"
     1.7 +      i18n:translate="" tal:content="events/?event"/>
     1.8 +</metal:block>
     1.9 +
    1.10 +<metal:block define-macro="recipient">
    1.11 + <tal:block define="href item/link|nothing">
    1.12 +  <a tal:omit-tag="not:href" tal:attributes="href href"
    1.13 +     tal:content="item/title|item/id" />
    1.14 + </tal:block>
    1.15 +</metal:block>
    1.16 +
    1.17 +<metal:block define-macro="display"
    1.18 +             xmlns:metal="http://xml.zope.org/namespaces/metal"
    1.19 +             xmlns:tal="http://xml.zope.org/namespaces/tal">
    1.20 +
    1.21 +  <tal:block define="recipients python:here.portal_subscriptions.getDetailedRecipientsFor(here);
    1.22 +                     events python:here.portal_subscriptions.getEventsFromContext(context=here);
    1.23 +                     members recipients/members;
    1.24 +                     groups recipients/groups;
    1.25 +                     other recipients/other;">
    1.26 +
    1.27 +   <table class="subscriptionsSummary">
    1.28 +    <thead>
    1.29 +     <tr>
    1.30 +      <th i18n:translate="label_subscriptions_fullname">Full Name</th>
    1.31 +      <th i18n:translate="">Notification type</th>
    1.32 +     </tr>
    1.33 +    </thead>
    1.34 +    <tbody tal:condition="groups">
    1.35 +     <tr><th colspan="0">Groups</th></tr>
    1.36 +     <tr tal:repeat="item python:groups.values()"
    1.37 +         tal:attributes="class python:test(repeat['item'].even(), 'even', 'odd')"
    1.38 +         >
    1.39 +      <td>
    1.40 +       <metal:block use-macro="here/subscriptions_lib_display_detailed_recipients/macros/recipient"/>
    1.41 +      </td>
    1.42 +      <td>
    1.43 +       <metal:block use-macro="here/subscriptions_lib_display_detailed_recipients/macros/events_in_div"/>
    1.44 +      </td>
    1.45 +     </tr>
    1.46 +    </tbody>
    1.47 +
    1.48 +    <tbody tal:condition="members">
    1.49 +     <tr><th colspan="0">Members</th></tr>
    1.50 +     <tr tal:repeat="item python:members.values()"
    1.51 +         tal:attributes="class python:test(repeat['item'].even(), 'even', 'odd')"
    1.52 +         >
    1.53 +      <td>
    1.54 +        <metal:block use-macro="here/subscriptions_lib_display_detailed_recipients/macros/recipient"/>
    1.55 +      </td>
    1.56 +
    1.57 +      <td>
    1.58 +       <metal:block use-macro="here/subscriptions_lib_display_detailed_recipients/macros/events_in_div"/>
    1.59 +      </td>
    1.60 +     </tr>
    1.61 +    </tbody>
    1.62 +
    1.63 +    <tbody tal:condition="other">
    1.64 +     <tr><th colspan="0">Others</th></tr>
    1.65 +     <tr tal:repeat="item python:members.items()"
    1.66 +         tal:attributes="class python:test(repeat['item'].even(), 'even', 'odd')"
    1.67 +         >
    1.68 +      <td>
    1.69 +       <metal:block use-macro="here/subscriptions_lib_display_detailed_recipients/macros/recipient"/>
    1.70 +      </td>
    1.71 +      <td>
    1.72 +       <metal:block use-macro="here/subscriptions_lib_display_detailed_recipients/macros/events_in_div"/>
    1.73 +      </td>
    1.74 +     </tr>
    1.75 +    </tbody>
    1.76 +
    1.77 +   </table>
    1.78 +
    1.79 +  </tal:block>
    1.80 +</metal:block>