2010-08-05 11:23:17 -05:00
|
|
|
<tal:comment replace="nothing">View macro for a String.</tal:comment>
|
|
|
|
<metal:view define-macro="view"
|
2010-08-27 01:59:53 -05:00
|
|
|
tal:define="fmt widget/format">
|
2010-08-05 11:23:17 -05:00
|
|
|
<span tal:condition="python: fmt in (0, 3)"
|
2010-08-12 04:56:42 -05:00
|
|
|
tal:attributes="class widget/master_css; id rawValue">
|
2011-09-20 12:21:48 -05:00
|
|
|
<ul tal:condition="python: value and isMultiple">
|
|
|
|
<li tal:repeat="sv value"><i tal:content="structure sv"></i></li>
|
2010-08-05 11:23:17 -05:00
|
|
|
</ul>
|
2010-08-27 01:59:53 -05:00
|
|
|
<tal:singleValue condition="python: value and not isMultiple">
|
2010-08-05 11:23:17 -05:00
|
|
|
<span tal:condition="python: fmt != 3" tal:replace="structure value"/>
|
|
|
|
<span tal:condition="python: fmt == 3">********</span>
|
|
|
|
</tal:singleValue>
|
|
|
|
</span>
|
|
|
|
<tal:formattedString condition="python: fmt not in (0, 3)">
|
|
|
|
<span tal:condition="python: value and (fmt == 1)"
|
2011-02-23 04:30:44 -06:00
|
|
|
tal:replace="structure python: contextObj.formatText(value, format='html')"/>
|
2010-08-05 11:23:17 -05:00
|
|
|
<span tal:condition="python: value and (fmt == 2)" tal:replace="structure value"/>
|
|
|
|
</tal:formattedString>
|
|
|
|
</metal:view>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Edit macro for a String.</tal:comment>
|
|
|
|
<metal:edit define-macro="edit"
|
|
|
|
tal:define="fmt widget/format;
|
|
|
|
isSelect widget/isSelect;
|
|
|
|
isMaster widget/slaves;
|
2011-05-05 09:44:06 -05:00
|
|
|
isOneLine python: fmt in (0,3);
|
|
|
|
maxChars python: test(widget['maxChars'], widget['maxChars'], '')">
|
2010-08-05 11:23:17 -05:00
|
|
|
|
|
|
|
<tal:choice condition="isSelect">
|
2010-09-02 09:16:08 -05:00
|
|
|
<select tal:define="possibleValues python:contextObj.getPossibleValues(name, withTranslations=True, withBlankValue=True)"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:attributes="name name;
|
|
|
|
id name;
|
2010-09-02 09:16:08 -05:00
|
|
|
multiple python: isMultiple and 'multiple' or '';
|
2010-09-17 08:32:48 -05:00
|
|
|
onchange python: isMaster and ('updateSlaves(getMasterValue(this), \'%s\')' % widget['id']) or '';
|
2010-08-12 04:56:42 -05:00
|
|
|
class widget/master_css;
|
2010-09-02 09:16:08 -05:00
|
|
|
size python: isMultiple and widget['height'] or 1">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option tal:repeat="possibleValue possibleValues"
|
|
|
|
tal:attributes="value python: possibleValue[0];
|
2010-11-22 08:34:04 -06:00
|
|
|
selected python:contextObj.fieldValueSelected(name, possibleValue[0], rawValue);
|
|
|
|
title python: possibleValue[1]"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="python:tool.truncateValue(possibleValue[1], widget)"></option>
|
|
|
|
</select>
|
|
|
|
</tal:choice>
|
|
|
|
<tal:line condition="python: isOneLine and not isSelect">
|
2011-05-05 09:44:06 -05:00
|
|
|
<input tal:attributes="id name; name name; size widget/width; maxlength maxChars;
|
2010-09-02 09:16:08 -05:00
|
|
|
value python: test(inRequest, requestValue, value);
|
2010-11-23 10:25:00 -06:00
|
|
|
style python: 'text-transform:%s' % widget['transform'];
|
2010-09-02 09:16:08 -05:00
|
|
|
type python: (widget['format'] == 3) and 'password' or 'text'"/>
|
2010-08-05 11:23:17 -05:00
|
|
|
</tal:line>
|
|
|
|
<tal:textarea condition="python: fmt == 1">
|
|
|
|
<textarea tal:attributes="id name; name name;
|
|
|
|
cols widget/width;
|
2010-11-23 10:25:00 -06:00
|
|
|
rows widget/height;
|
|
|
|
style python: 'text-transform:%s' % widget['transform'];"
|
2010-08-05 11:23:17 -05:00
|
|
|
tal:content="python: test(inRequest, requestValue, value)">
|
|
|
|
</textarea>
|
|
|
|
</tal:textarea>
|
|
|
|
<tal:rich condition="python: fmt == 2">
|
|
|
|
<tal:editor define="editor python: member.getProperty('wysiwyg_editor','').lower();
|
|
|
|
macrosFile python: path('nocall:here/%s_wysiwyg_support' % editor);
|
|
|
|
fieldName name;
|
|
|
|
inputname name;
|
|
|
|
inputvalue python: test(inRequest, requestValue, value);
|
|
|
|
dummy python: request.set('%s_text_format' % name, 'text/html')">
|
|
|
|
<metal:box use-macro="macrosFile/macros/wysiwygEditorBox"/>
|
|
|
|
</tal:editor>
|
|
|
|
</tal:rich>
|
|
|
|
</metal:edit>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Cell macro for a String.</tal:comment>
|
2010-09-02 09:16:08 -05:00
|
|
|
<metal:cell define-macro="cell"
|
|
|
|
tal:define="multipleValues python: value and isMultiple">
|
|
|
|
<tal:multiple condition="multipleValues"
|
|
|
|
content="python: ', '.join(value)">
|
|
|
|
</tal:multiple>
|
|
|
|
<tal:notMultiple condition="not: multipleValues">
|
2011-09-18 08:00:05 -05:00
|
|
|
<metal:call use-macro="app/skyn/widgets/string/macros/view"/>
|
2010-09-02 09:16:08 -05:00
|
|
|
</tal:notMultiple>
|
2010-08-05 11:23:17 -05:00
|
|
|
</metal:cell>
|
|
|
|
|
|
|
|
<tal:comment replace="nothing">Search macro for a String.</tal:comment>
|
|
|
|
<metal:search define-macro="search">
|
|
|
|
<label tal:attributes="for widgetName" tal:content="python: tool.translate(widget['labelId'])"></label><br>
|
|
|
|
<tal:comment replace="nothing">Show a simple search field for most String fields.</tal:comment>
|
|
|
|
<tal:simpleSearch condition="not: widget/isSelect">
|
2011-05-05 09:44:06 -05:00
|
|
|
<input type="text" tal:define="maxChars python: test(widget['maxChars'], widget['maxChars'], '')"
|
|
|
|
tal:attributes="name python: '%s*string-%s' % (widgetName, widget['transform']);
|
|
|
|
maxlength maxChars;
|
2010-08-05 11:23:17 -05:00
|
|
|
style python: 'text-transform:%s' % widget['transform']"/>
|
|
|
|
</tal:simpleSearch>
|
|
|
|
<tal:comment replace="nothing">Show a multi-selection box for fields whose
|
|
|
|
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>
|
2010-08-12 04:56:42 -05:00
|
|
|
<tal:operator define="operName python: 'o_%s' % name;
|
2010-08-05 11:23:17 -05:00
|
|
|
orName python: '%s_or' % operName;
|
|
|
|
andName python: '%s_and' % operName;"
|
|
|
|
condition="python: widget['multiplicity'][1]!=1">
|
|
|
|
<input type="radio" class="noborder" tal:attributes="name operName; id orName" checked="checked" value="or"/>
|
|
|
|
<label tal:attributes="for orName" tal:content="python: tool.translate('search_or')"></label>
|
|
|
|
<input type="radio" class="noborder" tal:attributes="name operName; id andName" value="and"/>
|
|
|
|
<label tal:attributes="for andName" tal:content="python: tool.translate('search_and')"></label><br/>
|
|
|
|
</tal:operator>
|
|
|
|
<tal:comment replace="nothing">The list of values</tal:comment>
|
2010-12-17 07:46:55 -06:00
|
|
|
<select tal:attributes="name widgetName; size widget/height" multiple="multiple">
|
2010-08-05 11:23:17 -05:00
|
|
|
<option tal:repeat="v python:tool.getPossibleValues(name, withTranslations=True, withBlankValue=False, className=contentType)"
|
2010-11-22 08:34:04 -06:00
|
|
|
tal:attributes="value python:v[0]; title python: v[1]"
|
|
|
|
tal:content="python: tool.truncateValue(v[1], widget)">
|
2010-08-05 11:23:17 -05:00
|
|
|
</option>
|
|
|
|
</select>
|
|
|
|
</tal:selectSearch><br/>
|
|
|
|
</metal:search>
|