products/CPSonFive.old

changeset 4:4d3bd6f09b25

Moving the CPS-style widget macro overrides to this new product.
author lregebro
date Mon, 27 Jun 2005 11:57:23 +0000
parents 637830cb0c2a
children c6b4dc97c687
files overrides.zcml widget_macros.pt
diffstat 2 files changed, 35 insertions(+), 0 deletions(-) [+]
line diff
     1.1 new file mode 100644
     1.2 --- /dev/null
     1.3 +++ b/overrides.zcml
     1.4 @@ -0,0 +1,13 @@
     1.5 +<configure xmlns="http://namespaces.zope.org/zope"
     1.6 +           xmlns:five="http://namespaces.zope.org/five"
     1.7 +           xmlns:browser="http://namespaces.zope.org/browser"
     1.8 +           > 
     1.9 +  
    1.10 +  <browser:page
    1.11 +    for="*"
    1.12 +    name="widget_macros"
    1.13 +    template="widget_macros.pt"
    1.14 +    permission="zope.Public"
    1.15 +    />
    1.16 +    
    1.17 +</configure>
     2.1 new file mode 100644
     2.2 --- /dev/null
     2.3 +++ b/widget_macros.pt
     2.4 @@ -0,0 +1,22 @@
     2.5 +<html>
     2.6 +  <body>
     2.7 +    <metal:block define-macro="widget_rows">
     2.8 +      <div class="row" tal:repeat="widget view/widgets">
     2.9 +        <metal:block define-macro="widget_row">
    2.10 +          <div tal:attributes="class python:'label ' + (widget.required and 'required' or '')">
    2.11 +            <label for="field.name" title="The widget's hint"
    2.12 +              tal:attributes="for widget/name; title widget/hint"
    2.13 +              tal:content="widget/label">The Label</label>:
    2.14 +          </div>
    2.15 +          <div class="field">
    2.16 +            <tal:block tal:content="structure widget"/>
    2.17 +            <span tal:define="error widget/error"
    2.18 +              tal:condition="error" tal:content="structure error">
    2.19 +              The Error
    2.20 +            </span>
    2.21 +          </div>
    2.22 +        </metal:block>
    2.23 +      </div>
    2.24 +    </metal:block>
    2.25 +  </body>
    2.26 +</html>
    2.27 \ No newline at end of file