[Checkins] SVN: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/ Stub database chooser view.
Charlie Clark
charlie at begeistert.org
Wed Nov 16 16:10:52 UTC 2011
Log message for revision 123388:
Stub database chooser view.
Changed:
A Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py
U Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/configure.zcml
A Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/templates/choose.pt
-=-
Added: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py (rev 0)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py 2011-11-16 16:10:51 UTC (rev 123388)
@@ -0,0 +1,30 @@
+##############################################################################
+#
+# 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.
+#
+##############################################################################
+"""
+Choose ZODB to manage
+"""
+
+class View(object):
+
+ def __init__(self, context, request):
+ self.context = context
+ self.request = request
+
+ def __call__(self):
+ return self.index()
+
+ def getDatabaseNames(self, quote=True):
+ return (('Main', 'main'),
+ ('Temporary', 'temporary')
+ )
\ No newline at end of file
Property changes on: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/choose.py
___________________________________________________________________
Added: svn:eol-style
+ native
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 16:00:43 UTC (rev 123387)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/configure.zcml 2011-11-16 16:10:51 UTC (rev 123388)
@@ -1,8 +1,18 @@
<configure xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser">
+
<browser:page
for="*"
+ name="zodb_choose.html"
+ template="templates/choose.pt"
+ class=".choose.View"
+ permission="zope2.ManageProperties"
+ layer="zmi.core.browser.skin.IZMISkin"
+ />
+
+ <browser:page
+ for="*"
name="zodb_overview.html"
template="templates/overview.pt"
class=".overview.View"
Added: Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/templates/choose.pt
===================================================================
--- Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/templates/choose.pt (rev 0)
+++ Sandbox/jens/zmi.core/trunk/src/zmi/core/browser/database/templates/choose.pt 2011-11-16 16:10:51 UTC (rev 123388)
@@ -0,0 +1,23 @@
+<html>
+
+<title>Database Management</title>
+
+<body>
+
+<h1>Databases</h1>
+<p>Select a database to manage</p>
+
+<ul tal:define="databases python:view.getDatabaseNames(quote=True);">
+ <li tal:repeat="info databases">
+ <a tal:define="name python: info[0];
+ qname python: info[1]"
+ tal:content="name"
+ tal:attributes="href string:${context/absolute_url}/${qname}/manage_main">Database name
+ </a>
+ </li>
+</ul>
+
+
+
+</body>
+</html>
\ No newline at end of file
More information about the checkins
mailing list