new.py now can create instances for Plone 2.5.5, Plone 3.0 to Plone 3.3.5. specificWritePermission and specificReadPermission can hold named (string) permissions instead of simple boolean values (which is still allowed). frontPage can call a custom macro. When launching generate.py with -c option, labels prefixed with custom_ are kept.

This commit is contained in:
Gaetan Delannay 2010-08-12 11:56:42 +02:00
parent bfd2357f69
commit dbcadc506d
17 changed files with 188 additions and 126 deletions

View file

@ -455,7 +455,7 @@
</tr>
<tr tal:repeat="change event/changes/items" valign="top">
<td tal:content="python: tool.translate(change[1][1])"></td>
<td tal:define="appyValue python: contextObj.getFormattedValue(change[0], useParamValue=True, value=change[1][0]);
<td tal:define="appyValue python: contextObj.getFieldValue(change[0], useParamValue=True, value=change[1][0]);
appyType python:contextObj.getAppyType(change[0], asDict=True);
severalValues python: (appyType['multiplicity'][1] &gt; 1) or (appyType['multiplicity'][1] == None)">
<span tal:condition="not: severalValues" tal:replace="appyValue"></span>

View file

@ -13,10 +13,10 @@
<table cellpadding="0" cellspacing="0" width="100%">
<tr>
<td>
<a tal:condition="python: len(flavours)==1"
<a tal:condition="python: len(flavours)==1 and rootClasses"
tal:attributes="href python:'%s?type_name=%s&flavourNumber=1' % (queryUrl, ','.join(rootClasses))"
tal:content="python: tool.translate(appName)"></a>
<span tal:condition="python: len(flavours)&gt;1"
<span tal:condition="python: len(flavours)&gt;1 or not rootClasses"
tal:replace="python: tool.translate(appName)"/>
</td>
<td align="right">
@ -159,7 +159,7 @@
<tr>
<td tal:define="label python:'%s_phase_%s' % (contextObj.meta_type, phase['name']);
displayLink python: (phase['phaseStatus'] != 'Future') and ('/portal_factory' not in contextObj.absolute_url()) and (len(phase['pages']) == 1)"
tal:attributes="class python: 'appyPhase step' + phase['phaseStatus']">
tal:attributes="class python: (len(phases) &gt; 1) and ('appyPhase step%s' % phase['phaseStatus']) or 'appyPhase'">
<span class="portletGroup" tal:condition="python: len(phases) &gt; 1">
<a tal:attributes="href python: '%s?page=%s' % (contextObj.getUrl(), phase['pages'][0]);"
tal:condition="displayLink"

View file

@ -6,12 +6,12 @@
<input type="checkbox"
tal:attributes="name python: name + '_visible';
id name;
checked python:contextObj.checkboxChecked(name);
checked python:contextObj.checkboxChecked(name, rawValue);
onClick python:'toggleCheckbox(\'%s\', \'%s_hidden\');;updateSlaves(getMasterValue(this), \'%s\')' % (name, name, widget['id']);
class python: 'noborder ' + widget['master_css']"/>
<input tal:attributes="name name;
id string:${name}_hidden;
value python: test(contextObj.checkboxChecked(name), 'True', 'False')"
value python: test(contextObj.checkboxChecked(name, rawValue), 'True', 'False')"
type="hidden" />&nbsp;
</metal:edit>

View file

@ -15,7 +15,7 @@
<tal:days repeat="day days">
<option tal:define="zDay python: str(day).zfill(2)"
tal:attributes="value zDay;
selected python:contextObj.dateValueSelected(name, 'day', day)"
selected python:contextObj.dateValueSelected(name, 'day', day, rawValue)"
tal:content="zDay"></option>
</tal:days>
</select>
@ -28,7 +28,7 @@
<tal:months repeat="month months">
<option tal:define="zMonth python: str(month).zfill(2)"
tal:attributes="value zMonth;
selected python:contextObj.dateValueSelected(name, 'month', month)"
selected python:contextObj.dateValueSelected(name, 'month', month, rawValue)"
tal:content="zMonth"></option>
</tal:months>
</select>
@ -39,7 +39,7 @@
<option value="">-</option>
<option tal:repeat="year years"
tal:attributes="value year;
selected python:contextObj.dateValueSelected(name, 'year', year)"
selected python:contextObj.dateValueSelected(name, 'year', year, rawValue)"
tal:content="year"></option>
</select>
<tal:comment replace="nothing">The icon for displaying the date chooser</tal:comment>
@ -53,7 +53,7 @@
<tal:hours repeat="hour hours">
<option tal:define="zHour python: str(hour).zfill(2)"
tal:attributes="value zHour;
selected python:contextObj.dateValueSelected(name, 'hour', hour)"
selected python:contextObj.dateValueSelected(name, 'hour', hour, rawValue)"
tal:content="zHour"></option>
</tal:hours>
</select> :
@ -64,7 +64,7 @@
<tal:minutes repeat="minute minutes">
<option tal:define="zMinute python: str(minute).zfill(2)"
tal:attributes="value zMinute;
selected python:contextObj.dateValueSelected(name, 'minute', minute)"
selected python:contextObj.dateValueSelected(name, 'minute', minute, rawValue)"
tal:content="zMinute"></option>
</tal:minutes>
</select>

View file

@ -54,7 +54,8 @@
tal:define="contextMacro python: portal.skyn.widgets;
layout python: widget['layouts'][layoutType];
name widget/name;
value python: contextObj.getFormattedValue(name);
value python: contextObj.getFieldValue(name);
rawValue python: contextObj.getFieldValue(name, formatted=False);
requestValue python: request.get(name, None);
inRequest python: request.has_key(name);
errors errors | python: ();

View file

@ -4,8 +4,7 @@
maxMult python: widget['multiplicity'][1];
severalValues python: (maxMult == None) or (maxMult &gt; 1)">
<span tal:condition="python: fmt in (0, 3)"
tal:attributes="class widget/master_css;
id python: contextObj.getFormattedValue(name, forMasterId=True)">
tal:attributes="class widget/master_css; id rawValue">
<ul class="appyList" tal:condition="python: value and severalValues">
<li class="appyBullet" tal:repeat="sv value"><i tal:content="structure sv"></i></li>
</ul>
@ -29,15 +28,17 @@
isOneLine python: fmt in (0,3)">
<tal:choice condition="isSelect">
<select tal:define="possibleValues python:contextObj.getPossibleValues(name, withTranslations=True, withBlankValue=True)"
<select tal:define="possibleValues python:contextObj.getPossibleValues(name, withTranslations=True, withBlankValue=True);
multiValued python: (widget['multiplicity'][1] != 1) and True or False"
tal:attributes="name name;
id name;
multiple python: test(widget['multiplicity'][1] != 1, 'multiple', '');
onchange python: test(isMaster, 'javascript:updateSlaves(getMasterValue(this), \'%s\')' % widget['id'], '');
class widget/master_css">
multiple python: multiValued and 'multiple' or '';
onchange python: isMaster and ('javascript:updateSlaves(getMasterValue(this), \'%s\')' % widget['id']) or '';
class widget/master_css;
size python: multiValued and widget['height'] or 1">
<option tal:repeat="possibleValue possibleValues"
tal:attributes="value python: possibleValue[0];
selected python:contextObj.fieldValueSelected(name, possibleValue[0])"
selected python:contextObj.fieldValueSelected(name, possibleValue[0], rawValue)"
tal:content="python:tool.truncateValue(possibleValue[1], widget)"></option>
</select>
</tal:choice>
@ -83,7 +84,7 @@
validator defines a list of values, with a "AND/OR" checkbox.</tal:comment>
<tal:selectSearch condition="widget/isSelect">
<tal:comment replace="nothing">The "and" / "or" radio buttons</tal:comment>
<tal:operator define="operName python: 'o_%s' % fieldName;
<tal:operator define="operName python: 'o_%s' % name;
orName python: '%s_or' % operName;
andName python: '%s_and' % operName;"
condition="python: widget['multiplicity'][1]!=1">