[Zope3-checkins] SVN: Zope3/trunk/ Applied changes from issue 339.
Stephan Richter
srichter at cosmos.phy.tufts.edu
Mon Feb 28 18:18:37 EST 2005
Log message for revision 29352:
Applied changes from issue 339.
Changed:
U Zope3/trunk/doc/CHANGES.txt
U Zope3/trunk/doc/TODO.txt
U Zope3/trunk/src/zope/app/form/browser/ftests/support.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py
U Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py
U Zope3/trunk/src/zope/app/form/browser/objectwidget.pt
U Zope3/trunk/src/zope/app/form/browser/sequencewidget.py
U Zope3/trunk/src/zope/app/form/browser/widget_macros.pt
U Zope3/trunk/src/zope/app/rotterdam/zope3.css
-=-
Modified: Zope3/trunk/doc/CHANGES.txt
===================================================================
--- Zope3/trunk/doc/CHANGES.txt 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/doc/CHANGES.txt 2005-02-28 23:18:37 UTC (rev 29352)
@@ -293,6 +293,8 @@
Restructuring
+ - Applied changes suggested in issue 339: Improvements to generated forms
+
- Deprecated `zope.app.introspector`. You should use the public apidoc
utilities isntead. A new "Introspector" tab was implemented that
redirects you to the correct code browser documentation screen.
Modified: Zope3/trunk/doc/TODO.txt
===================================================================
--- Zope3/trunk/doc/TODO.txt 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/doc/TODO.txt 2005-02-28 23:18:37 UTC (rev 29352)
@@ -88,8 +88,6 @@
* 336: zpkg: defining 'zpkgsetup' resource shouldn't be necessary
-* 339: Improvements to generated forms
-
* 340: Adding a big file eats a lot of memory / memory leak?
* 344: PAU registration error
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/support.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/support.py 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/support.py 2005-02-28 23:18:37 UTC (rev 29352)
@@ -84,7 +84,7 @@
def validationErrorExists(field, error_msg, source):
return patternExists(
- 'name="field.%s".*%s' % (field, error_msg), source, re.DOTALL)
+ '%s.*name="field.%s"' % (error_msg, field), source, re.DOTALL)
def missingInputErrorExists(field, source):
@@ -94,7 +94,7 @@
def invalidValueErrorExists(field, source):
# assumes this error is displayed for select elements
return patternExists(
- 'name="field.%s".*</select>.*Invalid value' % field,
+ 'Invalid value.*name="field.%s".*</select>' % field,
source, re.DOTALL)
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_datetimewidget.py 2005-02-28 23:18:37 UTC (rev 29352)
@@ -35,11 +35,6 @@
class IDatetimeTest(Interface):
- d1 = Datetime(
- required=True,
- min=datetime(2003, 1, 1, tzinfo=tzinfo(0)),
- max=datetime(2020, 12, 31, tzinfo=tzinfo(0)))
-
d2 = Datetime(
required=False)
@@ -50,6 +45,11 @@
datetime(2003, 10, 15, tzinfo=tzinfo(0))),
missing_value=datetime(2000, 1, 1, tzinfo=tzinfo(0)))
+ d1 = Datetime(
+ required=True,
+ min=datetime(2003, 1, 1, tzinfo=tzinfo(0)),
+ max=datetime(2020, 12, 31, tzinfo=tzinfo(0)))
+
registerEditForm(IDatetimeTest)
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_floatwidget.py 2005-02-28 23:18:37 UTC (rev 29352)
@@ -34,7 +34,7 @@
class IFloatTest(Interface):
f1 = Float(
- required=True,
+ required=False,
min=1.1,
max=10.1)
@@ -42,7 +42,7 @@
required=False)
f3 = Choice(
- required=False,
+ required=True,
values=(0.0, 1.1, 2.1, 3.1, 5.1, 7.1, 11.1),
missing_value=0)
@@ -113,17 +113,17 @@
# submit missing values for f2 and f3
response = self.publish('/test/edit.html', form={
'UPDATE_SUBMIT' : '',
- 'field.f1' : '1.1',
+ 'field.f1' : '',
'field.f2' : '',
- 'field.f3-empty-marker' : '1' })
+ 'field.f3' : '1.1' })
self.assertEqual(response.getStatus(), 200)
self.assert_(updatedMsgExists(response.getBody()))
# check new values in object
object = traverse(self.getRootFolder(), 'test')
- self.assertEqual(object.f1, 1.1)
+ self.assertEqual(object.f1, None)
self.assertEqual(object.f2, None) # None is default missing_value
- self.assertEqual(object.f3, 0) # 0 is from f3.missing_value=0
+ self.assertEqual(object.f3, 1.1) # 0 is from f3.missing_value=0
def test_required_validation(self):
@@ -139,9 +139,9 @@
self.assertEqual(response.getStatus(), 200)
# confirm error msgs
- self.assert_(missingInputErrorExists('f1', response.getBody()))
+ self.assert_(not missingInputErrorExists('f1', response.getBody()))
self.assert_(not missingInputErrorExists('f2', response.getBody()))
- self.assert_(not missingInputErrorExists('f3', response.getBody()))
+ self.assert_(missingInputErrorExists('f3', response.getBody()))
def test_invalid_allowed_value(self):
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_intwidget.py 2005-02-28 23:18:37 UTC (rev 29352)
@@ -33,11 +33,6 @@
class IIntTest(Interface):
- i1 = Int(
- required=True,
- min=1,
- max=10)
-
i2 = Int(
required=False)
@@ -46,6 +41,11 @@
values=(0, 1, 2, 3, 5, 7, 11),
missing_value=0)
+ i1 = Int(
+ required=True,
+ min=1,
+ max=10)
+
registerEditForm(IIntTest)
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textareawidget.py 2005-02-28 23:18:37 UTC (rev 29352)
@@ -32,11 +32,6 @@
class ITextTest(Interface):
- s1 = Text(
- required=True,
- min_length=2,
- max_length=10)
-
s2 = Text(
required=False,
missing_value=u'')
@@ -44,6 +39,11 @@
s3 = Text(
required=False)
+ s1 = Text(
+ required=True,
+ min_length=2,
+ max_length=10)
+
registerEditForm(ITextTest)
Modified: Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/ftests/test_textwidget.py 2005-02-28 23:18:37 UTC (rev 29352)
@@ -30,11 +30,6 @@
class ITextLineTest(Interface):
- s1 = TextLine(
- required=True,
- min_length=2,
- max_length=10)
-
s2 = TextLine(
required=False,
missing_value=u'')
@@ -43,6 +38,11 @@
required=False,
values=(u'Bob', u'is', u'Your', u'Uncle'))
+ s1 = TextLine(
+ required=True,
+ min_length=2,
+ max_length=10)
+
registerEditForm(ITextLineTest)
Modified: Zope3/trunk/src/zope/app/form/browser/objectwidget.pt
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/objectwidget.pt 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/objectwidget.pt 2005-02-28 23:18:37 UTC (rev 29352)
@@ -1,6 +1,6 @@
<fieldset>
<legend tal:content="context/legendTitle">The Legend</legend>
- <tal:block repeat="widget context/subwidgets">
+ <div class="row" tal:repeat="widget context/subwidgets">
<metal:block use-macro="context/@@form_macros/widget_row" />
- </tal:block>
+ </div>
</fieldset>
Modified: Zope3/trunk/src/zope/app/form/browser/sequencewidget.py
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/sequencewidget.py 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/sequencewidget.py 2005-02-28 23:18:37 UTC (rev 29352)
@@ -70,8 +70,8 @@
render.append('<tr><td>')
if num_items > min_length:
render.append(
- '<input type="checkbox" name="%s.remove_%d" />' % (
- self.name, i)
+ '<input class="editcheck" type="checkbox" '
+ 'name="%s.remove_%d" />' %(self.name, i)
)
widget = self._getWidget(i)
widget.setRenderedValue(value)
Modified: Zope3/trunk/src/zope/app/form/browser/widget_macros.pt
===================================================================
--- Zope3/trunk/src/zope/app/form/browser/widget_macros.pt 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/form/browser/widget_macros.pt 2005-02-28 23:18:37 UTC (rev 29352)
@@ -8,13 +8,13 @@
tal:attributes="for widget/name; title widget/hint"
tal:content="widget/label">The Label</label>
</div>
+ <tal:block define="error widget/error"
+ condition="error" content="structure error">
+ The Error
+ </tal:block>
<div class="field" tal:content="structure widget">
<input type="text" style="width:100%"/>
</div>
- <div class="error" tal:define="error widget/error"
- tal:condition="error" tal:content="structure error">
- The Error
- </div>
</metal:block>
</div>
</metal:block>
Modified: Zope3/trunk/src/zope/app/rotterdam/zope3.css
===================================================================
--- Zope3/trunk/src/zope/app/rotterdam/zope3.css 2005-02-28 21:45:31 UTC (rev 29351)
+++ Zope3/trunk/src/zope/app/rotterdam/zope3.css 2005-02-28 23:18:37 UTC (rev 29352)
@@ -113,7 +113,7 @@
font-size: 80%;
}
-ul {
+ul {
line-height: 1.5em;
/* list-style-image: url("bullet.gif"); */
margin-left: 2em;
@@ -130,7 +130,7 @@
}
dt {
- font-weight: bold;
+ font-weight: bold;
}
dd {
@@ -141,8 +141,12 @@
fieldset {
border: 1px solid #A0A0A0;
+ /*
margin: 2em 0em 1em 0em;
padding: 1em 0em;
+ */
+ margin: 0em 0em 2em 0em;
+ padding: 0 1em 1em 1em;
}
legend {
@@ -264,17 +268,17 @@
}
#actions {
- color: Black;
background: #369;
- text-align: right;
border-left: 1px solid #369;
border-right: 1px solid #369;
+ padding: 0.3em;
+ color: Black;
border-collapse: collapse;
- padding: 0.3em 0.2em;
}
#actions a {
color: White;
+ float: right;
border-left: 1px dashed white;
padding: 0 0.5em;
}
@@ -306,8 +310,8 @@
}
#content {
- float: left;
- width: 100%;
+ float: left;
+ /* width: 75%; */
}
#context_information {
@@ -329,36 +333,67 @@
clear: both;
}
+input.textType {
+ width: 88%; /* Same as textarea */
+}
+
+input.editcheck {
+ float:left;
+ position:relative;
+ top:1em;
+}
+
div.row {
- clear: both;
+ padding-top: 1em;
+}
+
+/*
+div.label {
+ #clear: both;
padding-top: 10px;
}
+*/
+
/* XXX: div.row div.field doesn't appear to be selecting. div.row div
is a workaround */
-div.row div {
- float: left;
+/* This seems to work in Firefox 1.0 and IE6. */
+
+div.row div.field {
+ clear: left;
+ padding-top: 1px;
}
+
div.row div.label {
- text-align: right;
- width: 100px;
- margin-right: 0.8em;
- font-weight: bold;
+ background: #369;
+ color: #fff;
+ padding: 0.1em 0.5em 0.1em 0.5em; /* Same as .itemViews */
+ border: 1px solid #369; /* Same as .itemViews */
+ margin: 0;
+ float: left;
+ clear: both;
}
-div.row div.error {
+
+div.row span.error {
+ background: red;
+ color: white;
+ padding: 0.1em 0.5em 0.1em 0.5em; /* Same as .itemViews */
+ border: 1px solid red; /* Same as .itemViews */
+ margin: 0;
float: left;
- color: red;
- margin-left: 0.8em;
+ clear: both;
}
+/*
div.row div.error:before {
content: "\2190 "; /* Left pointing arrow */
}
+*/
div.box {
margin: 0em 0em 2em 0em;
padding: 0em;
}
-div.box h4 {
+div.box h4 {
background: #CCCCCC;
border: 1px solid #CCCCCC;
border-style: solid solid none solid;
@@ -381,9 +416,9 @@
padding: 0.5em;
}
-div.box h1,
-div.box h2,
-div.box h3,
+div.box h1,
+div.box h2,
+div.box h3,
div.box h4 {
margin: 0;
}
@@ -503,15 +538,18 @@
text-align: left;
}
+
/*colorize the matrix table used in grant.html*/
table.matrix td.default {
background: green;
}
+
table.matrix td.changed {
background: red;
}
+
div.spacer {
clear: both;
}
@@ -546,9 +584,9 @@
/* Style for page error divs. Use this for displaying errors for a
page as a whole.
*/
-div.page_error {
- background: #FFCE7B;
- font: bold 80% Verdana, Helvetica, Arial, sans-serif;
- padding: 0.5em 1em;
- vertical-align: middle;
+div.page_error {
+ background: #FFCE7B;
+ font: bold 80% Verdana, Helvetica, Arial, sans-serif;
+ padding: 0.5em 1em;
+ vertical-align: middle;
}
More information about the Zope3-Checkins
mailing list