[Zope3-checkins] SVN: Zope3/branches/roger-bostonskin2/src/zope/
Boston skin implementation
Roger Ineichen
roger at projekt01.ch
Sun Oct 30 20:37:24 EST 2005
Log message for revision 39758:
Boston skin implementation
Move simply viewlets to the viewlets package
Added ftests
Changed:
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/README.txt
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/ftests.py
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml
A Zope3/branches/roger-bostonskin2/src/zope/app/boston/ftests.py
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo/browser/views.py
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/css.pt
D Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree/
A Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.css
A Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.pt
U Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml
U Zope3/branches/roger-bostonskin2/src/zope/viewlet/css_viewlet.pt
-=-
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/README.txt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/README.txt 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/README.txt 2005-10-31 01:37:24 UTC (rev 39758)
@@ -1,40 +1,47 @@
-===================
-The Boston ZMI Skin
-===================
+===============
+The Boston Skin
+===============
The Boston skin is a new UI for the Zope Management Interface called ZMI.
-Feel free to write comments, ideas and wishes to the zope3-dev mailinglist.
+Feel free to write comments, ideas and wishes to the zope3-dev mailinglist.
+
+ >>> from zope.testbrowser import Browser
+ >>> browser = Browser()
+ >>> browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+ >>> browser.handleErrors = False
+Check if the css viewlet is available in the Boston skin.
-Requirements
--------------
+ >>> browser.open('http://localhost/++skin++Boston/@@contents.html')
+ >>> browser.url
+ 'http://localhost/++skin++Boston/@@contents.html'
+ >>> browser.contents
+ '...href="http://localhost/++skin++Boston/@@/skin.css"...'
+ >>> browser.contents
+ '...href="http://localhost/++skin++Boston/@@/widget.css"...'
+ >>> browser.contents
+ '...href="http://localhost/++skin++Boston/@@/toolbar.css"...'
+ >>> browser.contents
+ '...href="http://localhost/++skin++Boston/@@/xmltree.css"...'
- - Offer a concept for registering aditional javascripts
+Check if the javascript viewlet is available in the Boston skin.
- - Offer a concept for registering additional CSS style sheets
+ >>> browser.open('http://localhost/++skin++Boston/@@contents.html')
+ >>> browser.url
+ 'http://localhost/++skin++Boston/@@contents.html'
+ >>> browser.contents
+ '...src="http://localhost/++skin++Boston/@@/boston.js"...'
+ >>> browser.contents
+ '...src="http://localhost/++skin++Boston/@@/xmltree.js"...'
- - Offer a concept for registering own boxes under the navigation
-
- - Works in newer browser on each plattform, especially linux, windows, mac
+Check if the left viewlet is available in the Boston skin.
- - Works in newest version of the following browsers: IE, firefox (gecko),
- Safari (KHTML/KJS)
-
-
-Dont's
-------
-
- - Must not work on older browsers, new technologies are fine but only if
- they support the plattform and browsers described above.
-
- - Must not support accessibility requirments. Please let me know, if
- somebody needs this. If so, we can implement a seperate ZMI skin for
- supporting fully accessibility support.
-
-
-Miscellaneous
--------------
-
- Different ideas of the Boston skin where born on the IRC with Stephan
- Richter. It's usual to name a skin like the town where the skin was
- born. We decide to name it Boston because Stephan lives there.
+ >>> browser.open('http://localhost/++skin++Boston/@@contents.html')
+ >>> browser.url
+ 'http://localhost/++skin++Boston/@@contents.html'
+ >>> browser.contents
+ '...id="ToolBar"...'
+ >>> browser.contents
+ '...id="xmltree"...'
+ >>> browser.contents
+ '...id="addinginfo"...'
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/__init__.py 2005-10-31 01:37:24 UTC (rev 39758)
@@ -18,6 +18,7 @@
from zope.publisher.interfaces.browser import IBrowserRequest
from zope.publisher.interfaces.browser import IDefaultBrowserLayer
+from zope.viewlet import manager
from zope.viewlet import viewlet
from zope.viewlet.interfaces import IViewletManager
@@ -53,6 +54,22 @@
"""Left viewlet manager."""
+class LeftViewletManager(manager.ViewletManagerBase):
+ """Ordered viewlet."""
+
+ def sort(self, viewlets):
+ """Sort the viewlets on their weight."""
+ return sorted(viewlets, lambda x, y: cmp(x[1].getWeight(), y[1].getWeight()))
+
+
+class OrderedViewlet(viewlet.ViewletBase):
+ """Ordered viewlet."""
+
+ def getWeight(self):
+ """REturns the weight of the viewlet."""
+ return int(self.weight)
+
+
BostonSkinCSSViewlet = viewlet.CSSViewlet('skin.css', 'all')
BostonWidgetCSSViewlet = viewlet.CSSViewlet('widget.css', 'all')
@@ -62,3 +79,5 @@
BostonToolBarCSSViewlet = viewlet.CSSViewlet('toolbar.css', 'all')
BostonJavascriptViewlet = viewlet.JavaScriptViewlet('boston.js')
+
+BostonXMLTreeJavaScriptViewlet = viewlet.JavaScriptViewlet('xmltree.js')
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/ftests.py
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/ftests.py 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/browser/ftests.py 2005-10-31 01:37:24 UTC (rev 39758)
@@ -57,13 +57,13 @@
def test_css_pagelets(self):
response = self.publish('/++skin++Boston/', basic='mgr:mgrpw')
self.assertEqual(response.getStatus(), 200)
- self.assert_(response.getBody().find('@import url(http://localhost/++skin++Boston/@@/skin.css)') != -1)
- self.assert_(response.getBody().find('@import url(http://localhost/++skin++Boston/@@/widget.css)') != -1)
+ self.assert_(response.getBody().find('href="http://localhost/++skin++Boston/@@/skin.css"') != -1)
+ self.assert_(response.getBody().find('href="http://localhost/++skin++Boston/@@/widget.css"') != -1)
def test_javascrip_pagelets(self):
response = self.publish('/++skin++Boston/', basic='mgr:mgrpw')
self.assertEqual(response.getStatus(), 200)
- self.assert_(response.getBody().find('src="http://localhost/++skin++Boston/@@/toggle.js') != -1)
+ self.assert_(response.getBody().find('src="http://localhost/++skin++Boston/@@/boston.js"') != -1)
def test_left_boxes(self):
# Add a folder
@@ -76,20 +76,14 @@
response = self.publish('/++skin++Boston/', basic='mgr:mgrpw')
self.assertEqual(response.getStatus(), 200)
- # test zmitree cookie box
- self.assert_(response.getBody().find('id="zmicookietreebox"') != -1)
+ # test xmltree box
+ self.assert_(response.getBody().find('id="xmltree"') != -1)
- # test add box
- self.assert_(response.getBody().find('id="addbox"') != -1)
+ # test addinginfo box
+ self.assert_(response.getBody().find('id="addinginfo"') != -1)
- # test tooltip box. Ah I found one in the role permission view
- response = self.publish('/++skin++Boston/++etc++site/@@AllRolePermissions.html',
- basic='mgr:mgrpw')
- self.assertEqual(response.getStatus(), 200)
- self.assert_(response.getBody().find('id="tooltipbox"') != -1)
-
def test_suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestBostonSkin))
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/configure.zcml 2005-10-31 01:37:24 UTC (rev 39758)
@@ -48,6 +48,7 @@
<viewletManager
name="zope.app.boston.ILeft"
provides="zope.app.boston.ILeft"
+ class="zope.app.boston.LeftViewletManager"
layer="zope.app.boston.boston"
permission="zope.Public"
/>
Added: Zope3/branches/roger-bostonskin2/src/zope/app/boston/ftests.py
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/ftests.py 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/ftests.py 2005-10-31 01:37:24 UTC (rev 39758)
@@ -0,0 +1,32 @@
+##############################################################################
+#
+# Copyright (c) 2003, 2004,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.
+#
+##############################################################################
+"""Functional Tests for Boston skin.
+
+$Id:$
+"""
+import unittest
+
+from zope.testing import doctest
+from zope.app.testing.functional import FunctionalDocFileSuite
+
+
+def test_suite():
+ return unittest.TestSuite((
+ FunctionalDocFileSuite(
+ "README.txt",
+ optionflags=doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE),
+ ))
+
+if __name__ == '__main__':
+ unittest.main(defaultTest='test_suite')
\ No newline at end of file
Property changes on: Zope3/branches/roger-bostonskin2/src/zope/app/boston/ftests.py
___________________________________________________________________
Name: svn:keywords
+ Id
Name: svn:eol-style
+ native
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo/browser/views.py
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo/browser/views.py 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo/browser/views.py 2005-10-31 01:37:24 UTC (rev 39758)
@@ -22,11 +22,12 @@
from zope.app.zapi import queryMultiAdapter
from zope.app.i18n import ZopeMessageFactory as _
+from zope.app.boston import OrderedViewlet
from zope.app.boston.viewlets.addinginfo.interfaces import IAddingInfoViewlet
-class AddingInfoViewlet(object):
+class AddingInfoViewlet(OrderedViewlet):
"""I18n info viewlet."""
implements(IAddingInfoViewlet)
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/addinginfo.zcml 2005-10-31 01:37:24 UTC (rev 39758)
@@ -11,7 +11,7 @@
class=".addinginfo.browser.views.AddingInfoViewlet"
template="addinginfo/browser/viewlet.pt"
layer="zope.app.boston.boston"
- weight="11"
+ weight="2"
/>
</configure>
\ No newline at end of file
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/configure.zcml 2005-10-31 01:37:24 UTC (rev 39758)
@@ -2,8 +2,11 @@
xmlns="http://namespaces.zope.org/zope"
xmlns:browser="http://namespaces.zope.org/browser">
+ <!-- ToolBar viewlets -->
+ <include file="toolbar.zcml" />
+
+ <!-- Left viewlets -->
<include file="xmltree.zcml" />
<include file="addinginfo.zcml" />
- <include file="toolbar.zcml" />
</configure>
Deleted: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/css.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/css.pt 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/toolbar/browser/css.pt 2005-10-31 01:37:24 UTC (rev 39758)
@@ -1,4 +0,0 @@
-<style type="text/css" media="all"
- tal:content="string: @import url(${context/++resource++toolbar.css});">
- @import url(toolbar.css);
-</style>
Added: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.css
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.css 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.css 2005-10-31 01:37:24 UTC (rev 39758)
@@ -0,0 +1,34 @@
+/* Styles for xmltree
+*/
+
+#navtreecontents a {
+ cursor: pointer;
+ height: 20px;
+}
+
+#navtreecontents loading {
+ display: block;
+ padding-left: 31px;
+ height: 18px;
+}
+
+#navtreecontents expand {
+ background-repeat: no-repeat;
+ padding-left: 14px;
+ display: inline;
+ cursor: pointer;
+ }
+
+#navtreecontents icon {
+ background-repeat: no-repeat;
+ padding-left: 20px;
+ display: inline;
+ cursor: auto;
+ }
+
+#navtreecontents collection {
+ display: block;
+ margin-left: 10px;
+/* border: red solid 1pt; */
+ height: auto;
+}
\ No newline at end of file
Property changes on: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.css
___________________________________________________________________
Name: svn:eol-style
+ native
Added: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.pt 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.pt 2005-10-31 01:37:24 UTC (rev 39758)
@@ -0,0 +1,26 @@
+<div class="slotbox" id="xmltree">
+ <div class="header">
+ <div class="title" i18n:translate="">Navigation</div>
+ </div>
+ <div class="body">
+ <metal:tree>
+ <div class="box" id="navigationTree">
+ <h4 i18n:translate="">Navigation</h4>
+ <div xmlns="http://www.zope.org/zope3xmltree"
+ id="navtreecontents"
+ class="body"
+ onclick="treeclicked(event);"
+ i18n:translate="">Loading...
+ </div>
+ </div>
+ </metal:tree>
+ <script type="text/javascript"
+ tal:attributes="language string:JavaScript"
+ tal:define="rooturl request/getApplicationURL;
+ thisbaseurl request/URL/-1"
+ tal:content="structure string:
+ loadtree('${rooturl}/', '${thisbaseurl}/');;">
+ </script>
+ </div>
+</div>
+
Property changes on: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.pt
___________________________________________________________________
Name: svn:eol-style
+ native
Modified: Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/app/boston/viewlets/xmltree.zcml 2005-10-31 01:37:24 UTC (rev 39758)
@@ -23,7 +23,7 @@
<resource
name="xmltree.css"
- file="xmltree/browser/xmltree.css"
+ file="xmltree.css"
layer="zope.app.boston.boston"
/>
@@ -31,8 +31,8 @@
name="xmltree.css"
for="*"
manager="zope.app.boston.ICSS"
+ class="..BostonXMLTreeCSSViewlet"
permission="zope.Public"
- class="..BostonXMLTreeCSSViewlet"
layer="zope.app.boston.boston"
weight="0"
/>
@@ -41,7 +41,7 @@
name="xmltree"
for="*"
manager="zope.app.boston.IJavaScript"
- template="xmltree/browser/javascript.pt"
+ class="..BostonXMLTreeJavaScriptViewlet"
permission="zope.View"
layer="zope.app.boston.boston"
/>
@@ -50,7 +50,8 @@
name="xmltree"
for="*"
manager="zope.app.boston.ILeft"
- template="xmltree/browser/viewlet.pt"
+ class="zope.app.boston.OrderedViewlet"
+ template="xmltree.pt"
permission="zope.View"
layer="zope.app.boston.boston"
weight="1"
Modified: Zope3/branches/roger-bostonskin2/src/zope/viewlet/css_viewlet.pt
===================================================================
--- Zope3/branches/roger-bostonskin2/src/zope/viewlet/css_viewlet.pt 2005-10-31 01:13:10 UTC (rev 39757)
+++ Zope3/branches/roger-bostonskin2/src/zope/viewlet/css_viewlet.pt 2005-10-31 01:37:24 UTC (rev 39758)
@@ -1,4 +1,4 @@
<link type="text/css" rel="stylesheet" href="somestyle.css" media="all"
tal:attributes="rel view/getRel;
- href view/getURL;
- media view/getMedia" />
+ media view/getMedia;
+ href view/getURL" />
More information about the Zope3-Checkins
mailing list