[Zope3-checkins] CVS: Zope3/lib/python/Zope/App/OFS/Services/Browser - NameConfigurable.pt:1.1.2.1 NameConfigurableView.py:1.1.2.2 configure.zcml:1.3.2.2

Marius Gedminas mgedmin@codeworks.lt
Wed, 11 Dec 2002 09:29:52 -0500


Update of /cvs-repository/Zope3/lib/python/Zope/App/OFS/Services/Browser
In directory cvs.zope.org:/tmp/cvs-serv15435/Zope/App/OFS/Services/Browser

Modified Files:
      Tag: named-component-configuration-branch
	NameConfigurableView.py configure.zcml 
Added Files:
      Tag: named-component-configuration-branch
	NameConfigurable.pt 
Log Message:
Refactor INameConfigurable views to share a common page template and use macros
for customization.



=== Added File Zope3/lib/python/Zope/App/OFS/Services/Browser/NameConfigurable.pt ===
<html metal:use-macro="views/standard_macros/page">
<body metal:fill-slot="body">
<div metal:define-macro="body">
<div tal:define="registries view/update">

  <h2 metal:define-slot="heading">Fruits configured in this fruits manager.</h2>

  <div tal:condition="not:registries">
       <p metal:define-slot="empty_text">No fruits have been configured</p>
  </div>

  <div tal:condition="registries">

    <div metal:define-slot="extra_top">

      <p>For each fruit, the fruit name is given and all of the components
         registered to provide the fruit are shown.  You may select the
         component to provide the fruit or disable the fruit.
      </p>

      <p>Select a fruit name or a component name to visit the fruit or
         component.
      </p>

    </div>

      <form action="." method="post" tal:attributes="action request/URL">

      <table width="100%">

         <tr tal:repeat="registry registries">
           <td valign="top" align="right">
              <a href="#"
                 tal:content="registry/name"
                 tal:attributes="href registry/url"
                 tal:condition="registry/active"
                 >Orange</a>
              <span tal:replace="registry/name"
                    tal:condition="registry/inactive" />
           </td>
           <td tal:content="structure registry/view">
           </td>
         </tr>

      </table>

      <input type=submit name="submit_update" value="Update"><br>

      </form>

    <div metal:define-slot="extra_bottom" />

  </div>

  <p metal:define-slot="help_text">To configure a fruit, add a fruit component
     to a <em>package</em> in <a href="Packages">Packages</a> or to the <a
     href="Packages/default">default package</a>. After the fruit is added, add
     a fruit configuration that configures the component to provide a fruit.
  </p>

</div>
</div>
</body>
</html>


=== Zope3/lib/python/Zope/App/OFS/Services/Browser/NameConfigurableView.py 1.1.2.1 => 1.1.2.2 ===
--- Zope3/lib/python/Zope/App/OFS/Services/Browser/NameConfigurableView.py:1.1.2.1	Tue Dec 10 14:15:59 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/Browser/NameConfigurableView.py	Wed Dec 11 09:29:21 2002
@@ -19,8 +19,12 @@
 from Zope.Publisher.Browser.BrowserView import BrowserView
 from Zope.ComponentArchitecture import getView
 from Zope.App.Traversing import traverse
+from Zope.App.PageTemplate.ViewPageTemplateFile import ViewPageTemplateFile
+
 
 class NameConfigurableView(BrowserView):
+
+    indexMacros = index = ViewPageTemplateFile('NameConfigurable.pt')
 
     def update(self):
 


=== Zope3/lib/python/Zope/App/OFS/Services/Browser/configure.zcml 1.3.2.1 => 1.3.2.2 ===
--- Zope3/lib/python/Zope/App/OFS/Services/Browser/configure.zcml:1.3.2.1	Tue Dec 10 14:15:59 2002
+++ Zope3/lib/python/Zope/App/OFS/Services/Browser/configure.zcml	Wed Dec 11 09:29:21 2002
@@ -66,4 +66,18 @@
       permission="Zope.ManageServices"
       />
 
+<!-- INameConfigurable default view -->
+
+  <defaultView
+      for=".ConfigurationInterfaces.INameConfigurable"
+      name="index.html"
+      />
+
+  <view
+      for=".ConfigurationInterfaces.INameConfigurable."
+      factory=".Browser.NameConfigurableView."
+      permission="Zope.ManageServices">
+    <page name="index.html" attribute="index" />
+  </view>
+
 </zope:zopeConfigure>