Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
59106bb1
Commit
59106bb1
authored
Mar 24, 2005
by
Stefan H. Holek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged r9837:9838, r9840:9844, r10062:10063, and r10074:10075 from the Five trunk.
parent
9e315e28
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
143 additions
and
16 deletions
+143
-16
lib/python/Products/Five/CHANGES.txt
lib/python/Products/Five/CHANGES.txt
+7
-0
lib/python/Products/Five/add.pt
lib/python/Products/Five/add.pt
+2
-2
lib/python/Products/Five/browser.py
lib/python/Products/Five/browser.py
+3
-1
lib/python/Products/Five/browserconfigure.py
lib/python/Products/Five/browserconfigure.py
+10
-4
lib/python/Products/Five/configure.zcml
lib/python/Products/Five/configure.zcml
+8
-0
lib/python/Products/Five/edit.pt
lib/python/Products/Five/edit.pt
+2
-5
lib/python/Products/Five/five_template.pt
lib/python/Products/Five/five_template.pt
+2
-2
lib/python/Products/Five/meta.zcml
lib/python/Products/Five/meta.zcml
+6
-0
lib/python/Products/Five/tests/products/FiveTest/configure.zcml
...thon/Products/Five/tests/products/FiveTest/configure.zcml
+42
-2
lib/python/Products/Five/tests/products/FiveTest/meta.zcml
lib/python/Products/Five/tests/products/FiveTest/meta.zcml
+15
-0
lib/python/Products/Five/tests/products/FiveTest/metaconfigure.py
...on/Products/Five/tests/products/FiveTest/metaconfigure.py
+45
-0
lib/python/Products/Five/tests/products/FiveTest/testing.zcml
...python/Products/Five/tests/products/FiveTest/testing.zcml
+1
-0
No files found.
lib/python/Products/Five/CHANGES.txt
View file @
59106bb1
Five Changes
============
* There is now a standard standard_macros. Five page templates can use
context/@@standard_macros/view to get the default site layout.
* The addform and editform directive now supports the widget zcml subdirective,
that previously was ignored.
* Five now supports the vocabulary zcml directive.
Five 0.3 (2005-03-11)
---------------------
...
...
lib/python/Products/Five/add.pt
View file @
59106bb1
<html
metal:use-macro=
"
here/five_template/macros/master
"
>
<html
metal:use-macro=
"
context/@@standard_macros/page
"
>
<body>
<div
metal:fill-slot=
"
main
"
>
<div
metal:fill-slot=
"
body
"
>
<div
metal:define-macro=
"addform"
>
...
...
lib/python/Products/Five/browser.py
View file @
59106bb1
...
...
@@ -143,7 +143,9 @@ class Macros:
raise
KeyError
,
key
class
StandardMacros
(
BrowserView
,
Macros
):
pass
macro_pages
=
(
'five_template'
,
'widget_macros'
,
'form_macros'
,)
class
EditView
(
BrowserView
):
"""Simple edit-view base class
...
...
lib/python/Products/Five/browserconfigure.py
View file @
59106bb1
...
...
@@ -42,6 +42,7 @@ from security import getSecurityInfo, protectClass, protectName,\
initializeClass
from
pagetemplatefile
import
ZopeTwoPageTemplateFile
import
ExtensionClass
def
page
(
_context
,
name
,
permission
,
for_
,
layer
=
'default'
,
template
=
None
,
class_
=
None
,
...
...
@@ -444,13 +445,18 @@ def EditViewFactory(name, schema, label, permission, layer,
class_
.
generated_form
=
ZopeTwoPageTemplateFile
(
default_template
)
# Not the prettiest solution, but it works...
class_
.
__init__
=
EditView
.
__init__
s
.
provideView
(
for_
,
name
,
IBrowserRequest
,
class_
,
layer
)
class
EditFormDirective
(
BaseFormDirective
):
class
FiveFormDirective
(
BaseFormDirective
):
def
_processWidgets
(
self
):
if
self
.
_widgets
:
customWidgetsObject
=
makeClass
(
'CustomWidgetsMixin'
,
(
ExtensionClass
.
Base
,),
self
.
_widgets
)
self
.
bases
=
self
.
bases
+
(
customWidgetsObject
,)
class
EditFormDirective
(
FiveFormDirective
):
view
=
EditView
default_template
=
'edit.pt'
...
...
@@ -494,7 +500,7 @@ def AddViewFactory(name, schema, label, permission, layer,
s
.
provideView
(
for_
,
name
,
IBrowserRequest
,
class_
,
layer
)
class
AddFormDirective
(
Bas
eFormDirective
):
class
AddFormDirective
(
Fiv
eFormDirective
):
view
=
AddView
default_template
=
'add.pt'
...
...
lib/python/Products/Five/configure.zcml
View file @
59106bb1
...
...
@@ -44,6 +44,14 @@
permission="zope.Public"
/>
<browser:page
for="*"
name="standard_macros"
permission="zope2.View"
class=".browser.StandardMacros"
allowed_interface="zope.interface.common.mapping.IItemMapping"
/>
<view
for="*"
factory=".browser.AbsoluteURL"
...
...
lib/python/Products/Five/edit.pt
View file @
59106bb1
<tal:tag
condition=
"view/update"
/>
<html
metal:use-macro=
"here/five_template/macros/master"
>
<body
metal:fill-slot=
"main"
>
<div>
<html
metal:use-macro=
"context/@@standard_macros/page"
>
<body
metal:fill-slot=
"body"
>
<div
metal:define-macro=
"body"
>
...
...
@@ -60,8 +59,6 @@
</form>
</div>
</div>
</body>
...
...
lib/python/Products/Five/five_template.pt
View file @
59106bb1
<html
metal:define-macro=
"
master
"
>
<html
metal:define-macro=
"
page
"
>
<head>
<metal:block
define-slot=
"css_slot"
>
</metal:block>
</head>
<body>
<metal:block
define-slot=
"
main
"
>
<metal:block
define-slot=
"
body
"
>
</metal:block>
</body>
</html>
lib/python/Products/Five/meta.zcml
View file @
59106bb1
...
...
@@ -81,6 +81,12 @@
</meta:complexDirective>
<meta:directive
name="vocabulary"
schema="zope.app.schema.metadirectives.IVocabularyDirective"
handler="zope.app.schema.metaconfigure.vocabulary"
/>
</meta:directives>
<meta:directives namespace="http://namespaces.zope.org/browser">
...
...
lib/python/Products/Five/tests/products/FiveTest/configure.zcml
View file @
59106bb1
...
...
@@ -309,7 +309,22 @@
name="edit.html"
permission="zope2.Public"
/>
<!-- With a widget override -->
<browser:editform
schema=".interfaces.IFieldSimpleContent"
for=".interfaces.IFieldSimpleContent"
name="widgetoverride.html"
permission="zope2.Public"
>
<widget
field="description"
class="zope.app.form.browser.TextAreaWidget"
/>
</browser:editform>
<five:traversable class=".helpers.FiveTraversableFolder" />
<browser:addform
...
...
@@ -318,6 +333,20 @@
name="addsimplecontent.html"
permission="zope2.Public"
/>
<browser:addform
schema=".interfaces.IFieldSimpleContent"
content_factory=".simplecontent.FieldSimpleContent"
name="addwidgetoverride.html"
permission="zope2.Public">
<widget
field="description"
class="zope.app.form.browser.TextAreaWidget"
/>
</browser:addform>
<!-- stuff that we'll override in overrides.zcml -->
...
...
@@ -430,9 +459,20 @@
for="zope.app.container.interfaces.IObjectRemovedEvent"
/>
<!-- Testing the vocabulary directive -->
<vocabulary
name="aVocabulary"
factory="zope.schema.tests.test_vocabulary.SampleVocabulary"
/>
<!-- testing that products meta.zcml statements are picked up. -->
<five:parrot
class=".metaconfigure.NorwegianBlue"
name="Polly"
/>
<!-- as new style classes are ignored, zope.app.form.browser
can be imported -->
<include package="zope.app.form.browser"/>
</configure>
lib/python/Products/Five/tests/products/FiveTest/meta.zcml
0 → 100644
View file @
59106bb1
<configure
xmlns="http://namespaces.zope.org/zope"
xmlns:meta="http://namespaces.zope.org/meta">
<meta:directives namespace="http://namespaces.zope.org/five">
<meta:directive
name="parrot"
schema=".metaconfigure.IParrotDirective"
handler=".metaconfigure.parrot"
/>
</meta:directives>
</configure>
lib/python/Products/Five/tests/products/FiveTest/metaconfigure.py
0 → 100644
View file @
59106bb1
##############################################################################
#
# 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.
#
##############################################################################
"""Parrot directive and support classes
$Id: metaconfigure.py 5287 2004-06-25 11:42:27Z philikon $
"""
from
zope.interface
import
Interface
from
zope.configuration.fields
import
GlobalObject
from
zope.schema
import
TextLine
class
IParrotDirective
(
Interface
):
"""State that a class implements something.
"""
class_
=
GlobalObject
(
title
=
u"Class"
,
required
=
True
)
name
=
TextLine
(
title
=
u"Name"
,
description
=
u"The parrots name."
,
required
=
True
)
def
parrot
(
_context
,
class_
,
name
):
parrot
=
class_
()
parrot
.
pineForFjords
()
class
NorwegianBlue
(
object
):
def
pineForFjords
(
self
):
return
"This parrot is no more!"
lib/python/Products/Five/tests/products/FiveTest/testing.zcml
View file @
59106bb1
...
...
@@ -3,6 +3,7 @@
<redefinePermission from="zope2.Public" to="zope.Public" />
<include file="meta.zcml" />
<include file="configure.zcml" />
<includeOverrides file="overrides.zcml" />
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment