[Checkins] SVN: Sandbox/jens/zmi.core/trunk/ - Switch Zope2 checkout to z4-zmi branch
Christian Theune
ct at gocept.com
Wed Nov 16 10:59:00 UTC 2011
Log message for revision 123372:
- Switch Zope2 checkout to z4-zmi branch
- Fix up a skin with global template
for the ZMI (++skin++zmi) and hook up our views to it.
- Fix linking and existing templates.
Changed:
U Sandbox/jens/zmi.core/trunk/buildout.cfg
U Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/configure.zcml
U Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/configure.zcml
U Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/error_log.py
A Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/skin.py
U Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/error_log.pt
A Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi.pt
U Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi_interfaces.pt
-=-
Modified: Sandbox/jens/zmi.core/trunk/buildout.cfg
===================================================================
--- Sandbox/jens/zmi.core/trunk/buildout.cfg 2011-11-16 10:55:29 UTC (rev 123371)
+++ Sandbox/jens/zmi.core/trunk/buildout.cfg 2011-11-16 10:58:59 UTC (rev 123372)
@@ -10,7 +10,7 @@
sources-dir = dev
[sources]
-Zope2 = svn svn+ssh://svn.zope.org/repos/main/Zope/trunk update=true
+Zope2 = svn svn+ssh://svn.zope.org/repos/main/Zope/branches/z4-zmi update=true
[test]
recipe = zc.recipe.testrunner
Modified: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/configure.zcml
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/configure.zcml 2011-11-16 10:55:29 UTC (rev 123371)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/configure.zcml 2011-11-16 10:58:59 UTC (rev 123372)
@@ -1,29 +1,46 @@
<configure xmlns="http://namespaces.zope.org/zope"
- xmlns:browser="http://namespaces.zope.org/browser">
+ xmlns:browser="http://namespaces.zope.org/browser">
+ <interface
+ interface="zmi.core.browser.skin.IZMISkin"
+ type="zope.publisher.interfaces.browser.IBrowserSkinType"
+ name="zmi"
+ />
+
<browser:page
- for="*"
- name="zmi_interfaces"
- template="templates/zmi_interfaces.pt"
- class="zmi.core.browser.zmi_interfaces.InterfacesView"
- permission="zope2.ViewManagementScreens"
- />
+ for="*"
+ name="zmi"
+ template="templates/zmi.pt"
+ permission="zope2.ViewManagementScreens"
+ layer="zmi.core.browser.skin.IZMISkin"
+ />
<browser:page
- for="Products.SiteErrorLog.SiteErrorLog.SiteErrorLog"
- name="zmi_error_log"
- template="templates/error_log.pt"
- class="zmi.core.browser.error_log.ErrorLogView"
- permission="zope2.ViewManagementScreens"
- />
+ for="*"
+ name="interfaces"
+ template="templates/zmi_interfaces.pt"
+ class="zmi.core.browser.zmi_interfaces.InterfacesView"
+ permission="zope2.ViewManagementScreens"
+ layer="zmi.core.browser.skin.IZMISkin"
+ />
<browser:page
- for="Products.SiteErrorLog.SiteErrorLog.SiteErrorLog"
- name="zmi_error_log_entry"
- template="templates/error_log_entry.pt"
- permission="zope2.ViewManagementScreens"
- />
+ for="Products.SiteErrorLog.SiteErrorLog.SiteErrorLog"
+ name="index_html"
+ template="templates/error_log.pt"
+ class="zmi.core.browser.error_log.ErrorLogView"
+ permission="zope2.ViewManagementScreens"
+ layer="zmi.core.browser.skin.IZMISkin"
+ />
+ <browser:page
+ for="Products.SiteErrorLog.SiteErrorLog.SiteErrorLog"
+ name="view_entry"
+ template="templates/error_log_entry.pt"
+ permission="zope2.ViewManagementScreens"
+ layer="zmi.core.browser.skin.IZMISkin"
+ />
+
<include package=".database" />
</configure>
Modified: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/configure.zcml
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/configure.zcml 2011-11-16 10:55:29 UTC (rev 123371)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/configure.zcml 2011-11-16 10:58:59 UTC (rev 123372)
@@ -7,6 +7,7 @@
template="templates/overview.pt"
class=".overview.View"
permission="zope2.ManageProperties"
+ layer="zmi.core.browser.skin.IZMISkin"
/>
<browser:page
@@ -15,6 +16,7 @@
template="templates/activity.pt"
class=".activity.View"
permission="zope2.ManageProperties"
+ layer="zmi.core.browser.skin.IZMISkin"
/>
<browser:page
@@ -23,6 +25,7 @@
template="templates/parameters.pt"
class=".parameters.View"
permission="zope2.ManageProperties"
+ layer="zmi.core.browser.skin.IZMISkin"
/>
<browser:page
@@ -31,6 +34,7 @@
template="templates/flush.pt"
class=".flush.View"
permission="zope2.ManageProperties"
+ layer="zmi.core.browser.skin.IZMISkin"
/>
</configure>
Modified: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/error_log.py
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/error_log.py 2011-11-16 10:55:29 UTC (rev 123371)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/error_log.py 2011-11-16 10:58:59 UTC (rev 123372)
@@ -21,7 +21,7 @@
@property
def entry_url(self):
- return '%s/@@zmi_error_log_entry?id=' % self.context.absolute_url()
+ return '%s/@@view_entry?id=' % self.context.absolute_url()
@property
def forget_url(self):
Added: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/skin.py
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/skin.py (rev 0)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/skin.py 2011-11-16 10:58:59 UTC (rev 123372)
@@ -0,0 +1,24 @@
+##############################################################################
+#
+# Copyright (c) 2011 Zope Foundation 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.
+#
+##############################################################################
+""" ZMI skin
+"""
+
+import zope.interface
+import zope.publisher.interfaces.browser
+
+
+class IZMISkin(zope.publisher.interfaces.browser.IBrowserRequest):
+ """The Zope management interface exposes administrative and development
+ functionality in a Zope server.
+ """
Modified: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/error_log.pt
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/error_log.pt 2011-11-16 10:55:29 UTC (rev 123371)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/error_log.pt 2011-11-16 10:58:59 UTC (rev 123372)
@@ -1,109 +1,108 @@
-<div class="system-msg" tal:condition="request/manage_tabs_message|nothing"
- tal:content="request/manage_tabs_message">
-</div>
+<html metal:use-macro="context/@@zmi/view">
+ <div metal:fill-slot="body">
-<p class="form-help">
-This page lists the exceptions that have occurred in this site
-recently. You can configure how many exceptions should be kept
-and whether the exceptions should be copied to Zope's event log
-file(s).
-</p>
+ <p class="form-help">
+ This page lists the exceptions that have occurred in this site
+ recently. You can configure how many exceptions should be kept
+ and whether the exceptions should be copied to Zope's event log.
+ </p>
-<form action="." method="post"
- tal:attributes="action request/ACTUAL_URL">
-<table tal:define="props container/getProperties">
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Number of exceptions to keep
- </div>
- </td>
- <td align="left" valign="top">
- <input type="text" name="keep_entries" size="40"
- tal:attributes="value props/keep_entries" />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Copy exceptions to the event log
- </div>
- </td>
- <td align="left" valign="top">
- <input type="checkbox" name="copy_to_zlog"
- tal:attributes="checked props/copy_to_zlog;
- disabled not:container/checkEventLogPermission|nothing" />
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- <div class="form-label">
- Ignored exception types
- </div>
- </td>
- <td align="left" valign="top">
- <textarea name="ignored_exceptions:lines" cols="40" rows="3"
- tal:content="python: '\n'.join(props['ignored_exceptions'])"></textarea>
- </td>
- </tr>
- <tr>
- <td align="left" valign="top">
- </td>
- <td align="left" valign="top">
- <div class="form-element">
- <input class="form-element" type="submit" name="SAVE"
- value=" Save Changes " />
- </div>
- </td>
- </tr>
-</table>
+ <form action="." method="post"
+ tal:attributes="action request/ACTUAL_URL">
+ <table tal:define="props container/getProperties">
+ <tr>
+ <td align="left" valign="top">
+ <div class="form-label">
+ Number of exceptions to keep
+ </div>
+ </td>
+ <td align="left" valign="top">
+ <input type="text" name="keep_entries" size="40"
+ tal:attributes="value props/keep_entries" />
+ </td>
+ </tr>
+ <tr>
+ <td align="left" valign="top">
+ <div class="form-label">
+ Copy exceptions to the event log
+ </div>
+ </td>
+ <td align="left" valign="top">
+ <input type="checkbox" name="copy_to_zlog"
+ tal:attributes="checked props/copy_to_zlog;
+ disabled not:container/checkEventLogPermission|nothing" />
+ </td>
+ </tr>
+ <tr>
+ <td align="left" valign="top">
+ <div class="form-label">
+ Ignored exception types
+ </div>
+ </td>
+ <td align="left" valign="top">
+ <textarea name="ignored_exceptions:lines" cols="40" rows="3"
+ tal:content="python: '\n'.join(props['ignored_exceptions'])"></textarea>
+ </td>
+ </tr>
+ <tr>
+ <td align="left" valign="top">
+ </td>
+ <td align="left" valign="top">
+ <div class="form-element">
+ <input class="form-element" type="submit" name="SAVE"
+ value=" Save Changes " />
+ </div>
+ </td>
+ </tr>
+ </table>
-<h3>Exception Log (most recent first)</h3>
+ <h3>Exception Log (most recent first)</h3>
-<div tal:define="entries container/getLogEntries">
+ <div tal:define="entries container/getLogEntries">
-<em tal:condition="not:entries">
-No exceptions logged.
-</em>
+ <em tal:condition="not:entries">
+ No exceptions logged.
+ </em>
-<table tal:condition="entries">
- <tr>
- <th align="left">Time</th>
- <th align="left">Username (User Id)</th>
- <th align="left">Exception</th>
- <th></th>
- </tr>
- <tr tal:repeat="entry entries">
- <td valign="top" nowrap="nowrap">
- <span tal:content="python: modules['DateTime'].DateTime(entry['time']).Time()">13:04:41</span>
- </td>
- <td>
- <span tal:content="string: ${entry/username} (${entry/userid})">
- joe (joe)
- </span>
- </td>
- <td valign="top">
- <a href="showEntry" tal:attributes="href string:${view/entry_url}${entry/id}"
- >
- <span tal:content="entry/type">AttributeError</span>:
- <span tal:define="value entry/value"
- tal:content="python: len(value) < 70 and value or value[:70] + '...'">
- Application object has no attribute "zzope"</span>
- </a>
- </td>
- <td><a href="."
- tal:attributes="href string:${view/forget_url}${entry/id}"
- >Forget this entry</a></td>
- </tr>
-</table>
+ <table tal:condition="entries">
+ <tr>
+ <th align="left">Time</th>
+ <th align="left">Username (User Id)</th>
+ <th align="left">Exception</th>
+ <th></th>
+ </tr>
+ <tr tal:repeat="entry entries">
+ <td valign="top" nowrap="nowrap">
+ <span tal:content="python: modules['DateTime'].DateTime(entry['time']).Time()">13:04:41</span>
+ </td>
+ <td>
+ <span tal:content="string: ${entry/username} (${entry/userid})">
+ joe (joe)
+ </span>
+ </td>
+ <td valign="top">
+ <a href="showEntry" tal:attributes="href string:${view/entry_url}${entry/id}"
+ >
+ <span tal:content="entry/type">AttributeError</span>:
+ <span tal:define="value entry/value"
+ tal:content="python: len(value) < 70 and value or value[:70] + '...'">
+ Application object has no attribute "zzope"</span>
+ </a>
+ </td>
+ <td><a href="."
+ tal:attributes="href string:${view/forget_url}${entry/id}"
+ >Forget this entry</a></td>
+ </tr>
+ </table>
-</div>
+ </div>
+ </form>
-</form>
-
-<p>
-<form action="." method="post"
- tal:attributes="action request/ACTUAL_URL">
-<input type="submit" name="REFRESH" value=" Refresh " />
-</form>
-</p>
+ <p>
+ <form action="." method="post"
+ tal:attributes="action request/ACTUAL_URL">
+ <input type="submit" name="REFRESH" value=" Refresh " />
+ </form>
+ </p>
+ </div>
+</html>
Added: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi.pt
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi.pt (rev 0)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi.pt 2011-11-16 10:58:59 UTC (rev 123372)
@@ -0,0 +1,17 @@
+<metal:macro define-macro="view"><?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+</head>
+<body>
+ Zope
+
+<div class="system-msg" tal:condition="request/manage_tabs_message|nothing"
+ tal:content="request/manage_tabs_message">
+</div>
+
+<div metal:define-slot="body">
+</div>
+</body>
+</html></metal:macro>
Modified: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi_interfaces.pt
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi_interfaces.pt 2011-11-16 10:55:29 UTC (rev 123371)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/templates/zmi_interfaces.pt 2011-11-16 10:58:59 UTC (rev 123372)
@@ -1,27 +1,16 @@
-<html metal:use-macro="context/@@standard_macros/page">
-<body>
+<html metal:use-macro="context/@@zmi/view">
+ <div metal:fill-slot="body">
+ <h1 i18n:translate="heading_edit_marker">Show interfaces</h1>
-<metal:slot metal:fill-slot="body">
-<metal:macro metal:define-macro="heading">
-<h1 i18n:translate="heading_edit_marker">Show Interfaces</h1>
-</metal:macro>
-<metal:macro metal:define-macro="main">
-<p class="form-help formHelp" i18n:translate="">
- This view shows all interfaces provided by
- <b tal:content="string:${context/meta_type|string:unknown} at ${context/absolute_url_path}">Foo at /root/foo_instance</b>
-</p>
+ <p i18n:translate="">
+ This view shows all interfaces provided by
+ <strong tal:content="string:${context/meta_type|string:unknown} at ${context/absolute_url_path}">Foo at /root/foo_instance</strong>
+ </p>
-<fieldset>
- <legend i18n:translate="legend_provided">Provided Interfaces</legend>
- <tal:loop tal:repeat="interface view/getInterfaceNames">
-
- <label class="form-mono"
- tal:content="interface/name" i18n:translate="">INTERFACE</label><br />
- </tal:loop>
-</fieldset>
-
-</metal:macro>
-</metal:slot>
-
-</body>
+ <ul>
+ <li tal:repeat="interface view/getInterfaceNames"
+ tal:content="interface/name" i18n:translate="">dotted.interface.name
+ </li>
+ </ul>
+ </div>
</html>
More information about the checkins
mailing list