[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/browser/ Fixed apidoc preferences. This reminds me that I need to write some tests

Stephan Richter srichter at cosmos.phy.tufts.edu
Fri Nov 4 16:09:13 EST 2005


Log message for revision 39895:
  Fixed apidoc preferences. This reminds me that I need to write some tests 
  for this.
  

Changed:
  U   Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
  U   Zope3/trunk/src/zope/app/apidoc/browser/index.pt
  U   Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt
  U   Zope3/trunk/src/zope/app/apidoc/browser/preference.py
  U   Zope3/trunk/src/zope/app/apidoc/browser/static_index.pt

-=-
Modified: Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml	2005-11-04 21:08:02 UTC (rev 39894)
+++ Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml	2005-11-04 21:09:13 UTC (rev 39895)
@@ -148,8 +148,7 @@
       permission="zope.Public"
       name="apidocIndex.html"
       template="prefIndex.pt"
-      class="zope.app.preference.browser.EditPreferenceGroup"
-      layer=".skin.apidoc"
+      class=".preference.ApidocEditPreferenceGroup"
       />
 
 </configure>

Modified: Zope3/trunk/src/zope/app/apidoc/browser/index.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/index.pt	2005-11-04 21:08:02 UTC (rev 39894)
+++ Zope3/trunk/src/zope/app/apidoc/browser/index.pt	2005-11-04 21:09:13 UTC (rev 39895)
@@ -5,7 +5,7 @@
           tal:attributes="href context/++resource++favicon.png|default" />
   </head>
   <frameset cols="20%, *">
-    <frameset rows="140, *"> 
+    <frameset rows="140, *">
       <frame name="modules" src="modulelist.html">
       <frame name="menu" src="menu.html">
     </frameset>

Modified: Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt	2005-11-04 21:08:02 UTC (rev 39894)
+++ Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt	2005-11-04 21:09:13 UTC (rev 39895)
@@ -88,10 +88,14 @@
     <tr class=""
         tal:define="parity repeat/widget/parity;
                     firstrow repeat/widget/start"
-        tal:attributes="class python: parity + 
+        tal:attributes="class python: parity +
                                       (firstrow and ' first' or '')">
       <td class="description">
-        <b tal:content="widget/label" i18n:translate="">Option</b>
+        <b class="label">
+          <label for="field.name"
+            tal:attributes="for widget/name"
+            tal:content="widget/label" i18n:translate="">Option</label>
+        </b>
         <div class="indent small">
           <div tal:content="widget/hint" i18n:translate="">
             Explanation
@@ -111,9 +115,9 @@
     <tr><td class="spacer"></td></tr>
     <tr>
       <td colspan="2" class="controls">
-        <input type="submit" value="Refresh" 
+        <input type="submit" value="Refresh"
             i18n:attributes="value refresh-button" />
-        <input type="submit" name="UPDATE_SUBMIT" value="Change" 
+        <input type="submit" name="UPDATE_SUBMIT" value="Change"
             i18n:attributes="value submit-button"/>
       </td>
     </tr>

Modified: Zope3/trunk/src/zope/app/apidoc/browser/preference.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/preference.py	2005-11-04 21:08:02 UTC (rev 39894)
+++ Zope3/trunk/src/zope/app/apidoc/browser/preference.py	2005-11-04 21:09:13 UTC (rev 39895)
@@ -18,8 +18,11 @@
 __docformat__ = "reStructuredText"
 
 from zope.app import zapi
+from zope.app.apidoc.browser.skin import APIDOC
 from zope.app.tree.browser.cookie import CookieTreeView
 from zope.app.preference.browser import PreferenceGroupFilter
+from zope.app.preference.browser import EditPreferenceGroup
+from zope.app.publisher.browser import applySkin
 
 class APIDocPreferencesTree(CookieTreeView):
     """Preferences Tree using the stateful cookie tree."""
@@ -30,3 +33,9 @@
         return self.cookieTree(root, filter)
 
 
+class ApidocEditPreferenceGroup(EditPreferenceGroup):
+
+    def __init__(self, context, request):
+        # Make sure we enter APIDOC territory.
+        applySkin(request, APIDOC)
+        super(ApidocEditPreferenceGroup, self).__init__(context, request)

Modified: Zope3/trunk/src/zope/app/apidoc/browser/static_index.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/static_index.pt	2005-11-04 21:08:02 UTC (rev 39894)
+++ Zope3/trunk/src/zope/app/apidoc/browser/static_index.pt	2005-11-04 21:09:13 UTC (rev 39895)
@@ -5,7 +5,7 @@
           tal:attributes="href context/++resource++favicon.png|default" />
   </head>
   <frameset cols="20%, *">
-    <frameset rows="140, *"> 
+    <frameset rows="140, *">
       <frame name="modules" src="staticmodulelist.html">
       <frame name="menu" src="staticmenu.html">
     </frameset>



More information about the Zope3-Checkins mailing list