[Zope3-checkins] SVN: Zope3/trunk/src/zope/app/apidoc/browser/
Reinstantiated the apidoc-specific preference screens. The UI
is much
Stephan Richter
srichter at cosmos.phy.tufts.edu
Fri Apr 1 16:13:20 EST 2005
Log message for revision 29804:
Reinstantiated the apidoc-specific preference screens. The UI is much
nicer than that of the Rotterdam skin. ;-)
Changed:
U Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
U Zope3/trunk/src/zope/app/apidoc/browser/modules.pt
A Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt
A Zope3/trunk/src/zope/app/apidoc/browser/preference.py
A Zope3/trunk/src/zope/app/apidoc/browser/prefmenu.pt
-=-
Modified: Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml 2005-04-01 21:12:37 UTC (rev 29803)
+++ Zope3/trunk/src/zope/app/apidoc/browser/configure.zcml 2005-04-01 21:13:18 UTC (rev 29804)
@@ -64,5 +64,30 @@
</pages>
+ <!-- Preference Views -->
+
+ <page
+ name="apidocTree"
+ for="zope.app.preference.interfaces.IPreferenceGroup"
+ class=".preference.APIDocPreferencesTree"
+ permission="zope.View"
+ attribute="apidocTree"
+ />
+
+ <page
+ for="zope.app.preference.interfaces.IPreferenceGroup"
+ permission="zope.Public"
+ name="apidocMenu.html"
+ template="prefmenu.pt"
+ />
+
+ <page
+ for="zope.app.preference.interfaces.IPreferenceGroup"
+ permission="zope.Public"
+ name="apidocIndex.html"
+ template="prefIndex.pt"
+ class="zope.app.preference.browser.EditPreferenceGroup"
+ />
+
</configure>
Modified: Zope3/trunk/src/zope/app/apidoc/browser/modules.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/modules.pt 2005-04-01 21:12:37 UTC (rev 29803)
+++ Zope3/trunk/src/zope/app/apidoc/browser/modules.pt 2005-04-01 21:13:18 UTC (rev 29804)
@@ -19,11 +19,9 @@
</li>
</ul>
<div id="preference_entry">
-<!--
- <a href="./++preferences++/@@menu.html" target="menu">
+ <a href="./++preferences++/apidoc/@@apidocMenu.html" target="menu">
User Preferences
</a>
--->
</div>
</div>
Added: Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt 2005-04-01 21:12:37 UTC (rev 29803)
+++ Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt 2005-04-01 21:13:18 UTC (rev 29804)
@@ -0,0 +1,123 @@
+<html metal:use-macro="context/@@apidoc_macros/details">
+<head>
+ <style type="text/css" media="all"
+ metal:fill-slot="style_slot">
+
+table.prefs {
+ border: 0pt;
+ width: 80%;
+}
+
+tr {
+ margin: 0pt;
+ padding: 0pt;
+ border: 0pt;
+}
+
+tr.odd {
+ background: #fffbbe;
+}
+
+tr.first td {
+ border-top: 1pt solid #0000C0;
+}
+
+td {
+ padding: 3pt;
+ border-bottom: 1pt solid #0000C0;
+}
+
+td.input {
+ vertical-align: middle;
+ text-align: center;
+}
+
+td.description {
+
+}
+
+td.controls {
+ margin-top: 10pt;
+ border: 0pt;
+ padding: 4pt;
+ background: #ccf;
+ text-align: right;
+}
+
+td.spacer {
+ padding: 5pt;
+ border: 0pt;
+}
+
+div.documentation blockquote {
+ margin: 0pt;
+ padding: 0pt;
+}
+
+div.error {
+ font-weight: bold;
+ margin: 3pt 0pt;
+ color: #ffaa22;
+}
+ </style>
+</head>
+<body metal:fill-slot="contents">
+
+ <h1 tal:content="view/label">Edit something</h1>
+
+ <div class="documentation" tal:content="structure view/getIntroduction">
+ Here is the doc string
+ </div>
+
+ <p tal:define="status view/update"
+ tal:condition="status"
+ tal:content="status" />
+
+ <p tal:condition="view/errors" i18n:translate="">
+ There are <strong tal:content="python:len(view.errors)"
+ i18n:name="num_errors">6</strong> input errors.
+ </p>
+ <br />
+
+ <form action="." tal:attributes="action request/URL" method="post"
+ enctype="multipart/form-data">
+
+ <table class="prefs" cellspacing="0" cellpadding="0">
+ <tal:block repeat="widget view/widgets" >
+ <tr class=""
+ tal:define="parity repeat/widget/parity;
+ firstrow repeat/widget/start"
+ tal:attributes="class python: parity +
+ (firstrow and ' first' or '')">
+ <td class="description">
+ <b tal:content="widget/label">Option</b>
+ <div class="indent small">
+ <div tal:content="widget/hint">
+ Explanation
+ </div>
+ <div class="error" tal:define="error widget/error"
+ tal:condition="error" tal:content="structure error">
+ The Error
+ </div>
+ </div>
+ </td>
+ <td class="input" tal:content="structure widget">
+ <input type="text" style="width:100%"/>
+ </td>
+ </tr>
+ </tal:block>
+ <tr><td class="spacer"></td></tr>
+ <tr>
+ <td colspan="2" class="controls">
+ <input type="submit" value="Refresh"
+ i18n:attributes="value refresh-button" />
+ <input type="submit" name="UPDATE_SUBMIT" value="Change"
+ i18n:attributes="value submit-button"/>
+ </td>
+ </tr>
+ </table>
+
+ </form>
+
+</body>
+</html>
\ No newline at end of file
Property changes on: Zope3/trunk/src/zope/app/apidoc/browser/prefIndex.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/apidoc/browser/preference.py
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/preference.py 2005-04-01 21:12:37 UTC (rev 29803)
+++ Zope3/trunk/src/zope/app/apidoc/browser/preference.py 2005-04-01 21:13:18 UTC (rev 29804)
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# Copyright (c) 2005 Zope Corporation and Contributors.
+# All Rights Reserved.
+#
+# This software is subject to the provisions of the Zope Public License,
+# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
+# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
+# WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
+# FOR A PARTICULAR PURPOSE.
+#
+##############################################################################
+"""API Doc Preference Views
+
+$Id$
+"""
+__docformat__ = "reStructuredText"
+
+from zope.app import zapi
+from zope.app.tree.browser.cookie import CookieTreeView
+from zope.app.preference.browser import PreferenceGroupFilter
+
+class APIDocPreferencesTree(CookieTreeView):
+ """Preferences Tree using the stateful cookie tree."""
+
+ def apidocTree(self):
+ root = zapi.getRoot(self.context)['apidoc']
+ filter = PreferenceGroupFilter()
+ return self.cookieTree(root, filter)
+
+
Property changes on: Zope3/trunk/src/zope/app/apidoc/browser/preference.py
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/trunk/src/zope/app/apidoc/browser/prefmenu.pt
===================================================================
--- Zope3/trunk/src/zope/app/apidoc/browser/prefmenu.pt 2005-04-01 21:12:37 UTC (rev 29803)
+++ Zope3/trunk/src/zope/app/apidoc/browser/prefmenu.pt 2005-04-01 21:13:18 UTC (rev 29804)
@@ -0,0 +1,67 @@
+<html metal:use-macro="views/apidoc_macros/menu">
+<body>
+
+ <div class="menu" metal:fill-slot="menu-title" i18n:translate="">
+ Preferences
+ </div>
+
+ <div metal:fill-slot="menu" class="small">
+
+<table cellspacing="0" cellpadding="0"
+ tal:define="root context/@@apidocTree;
+ result root/getFlatDicts;
+ nodeDictList python:result[0];
+ maxDepth python:result[1]">
+
+<tr tal:repeat="nodeInfo nodeDictList">
+<tal:block tal:define="node nodeInfo/node">
+
+ <td style="width:16px" tal:repeat="state nodeInfo/row-state">
+ <img tal:attributes="src context/++resource++tree_images/vline.png"
+ tal:condition="state" alt="|" border="0" />
+ </td>
+
+ <td style="width:16px">
+ <a href=""
+ tal:attributes="href string:?tree-state=${nodeInfo/tree-state}"
+ tal:condition="node/hasChildren">
+ <tal:block condition="not:nodeInfo/last-level-node">
+ <img tal:attributes="src context/++resource++tree_images/plus_vline.png"
+ tal:condition="not:node/expanded" alt="+" border="0" />
+ <img tal:attributes="src context/++resource++tree_images/minus_vline.png"
+ tal:condition="node/expanded" alt="-" border="0" />
+ </tal:block>
+ <tal:block condition="nodeInfo/last-level-node">
+ <img tal:attributes="src context/++resource++tree_images/plus.png"
+ tal:condition="not:node/expanded" alt="+" border="0" />
+ <img tal:attributes="src context/++resource++tree_images/minus.png"
+ tal:condition="node/expanded" alt="-" border="0" />
+ </tal:block>
+ </a>
+ <tal:block condition="not:node/hasChildren">
+ <img tal:attributes="src context/++resource++tree_images/tline.png"
+ tal:condition="not:nodeInfo/last-level-node" alt="" border="0" />
+ <img tal:attributes="src context/++resource++tree_images/lline.png"
+ tal:condition="nodeInfo/last-level-node" alt="" border="0" />
+ </tal:block>
+ </td>
+
+ <td class="list-item"
+ tal:attributes="colspan python:maxDepth-len(nodeInfo['row-state'])+1">
+ <a href="" target="main"
+ tal:attributes="href
+ string:${node/context/@@absolute_url}/@@apidocIndex.html"
+ tal:content="node/context/__title__">
+ node/id
+ </a>
+ </td>
+
+</tal:block>
+</tr>
+
+</table>
+
+ </div>
+
+</body>
+</html>
\ No newline at end of file
Property changes on: Zope3/trunk/src/zope/app/apidoc/browser/prefmenu.pt
___________________________________________________________________
Name: svn:eol-style
+ native
More information about the Zope3-Checkins
mailing list