Update of /cvsroot/archetypes/Archetypes/skins/archetypes/widgets
In directory sc8-pr-cvs1:/tmp/cvs-serv18079/skins/archetypes/widgets
Modified Files:
reference.pt
Log Message:
ReferenceField now supports the multiValued property
Index: reference.pt
===================================================================
RCS file: /cvsroot/archetypes/Archetypes/skins/archetypes/widgets/reference.pt,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** reference.pt 4 Jun 2003 15:36:19 -0000 1.6
--- reference.pt 16 Jun 2003 01:51:48 -0000 1.7
***************
*** 12,20 ****
<div metal:use-macro="here/widgets/field/macros/view">
<div metal:fill-slot="widget_view">
! <a href="#"
! tal:define="obj python:here.archetype_tool.lookupObject(uid =
accessor())"
tal:attributes="href obj/absolute_url"
tal:content="python:obj.Title() or obj.absolute_url(relative=1)"
! tal:condition="python:obj is not None"></a>
</div>
</div>
--- 12,33 ----
<div metal:use-macro="here/widgets/field/macros/view">
<div metal:fill-slot="widget_view">
!
! <a href="#"
! tal:define="obj python:here.archetype_tool.lookupObject(uid =
accessor());"
tal:attributes="href obj/absolute_url"
tal:content="python:obj.Title() or obj.absolute_url(relative=1)"
! tal:condition="python:not field.multiValued and obj is not None">
! </a>
!
! <tal:block tal:condition="python:field.multiValued"
! tal:repeat="obj
python:[here.archetype_tool.lookupObject(uid = uid) for uid in accessor()];">
!
! <a href="#"
!
! tal:attributes="href obj/absolute_url"
! tal:content="python:obj.Title() or
obj.absolute_url(relative=1)"
! tal:condition="python:obj is not None"></a>
! </tal:block>
!
</div>
</div>
***************
*** 26,29 ****
--- 39,43 ----
tal:define="
vocab python:field.Vocabulary(here);
+ fieldName python:test(field.multiValued,fieldName+':list',fieldName);
vlen python: len(vocab);
">
***************
*** 36,42 ****
type="radio"
tal:attributes="name fieldName;
! checked python: str(value) == str(item);
value item;
! tabindex tabindex/next;"
/><span tal:content="python: vocab.getValue(item)"/>
--- 50,58 ----
type="radio"
tal:attributes="name fieldName;
! checked python: field.containsValueAsString(item,value);
value item;
! tabindex tabindex/next;
! type python:test(field.multiValued,'checkbox','radio');
! "
/><span tal:content="python: vocab.getValue(item)"/>
***************
*** 57,65 ****
<div tal:condition="python: vlen >= 4">
<select tal:attributes="name fieldName; id fieldName;
tabindex tabindex/next;">
<option
selected=""
tal:repeat="item vocab"
! tal:attributes="selected python:test(str(value) == str(item),
'selected', None); value item;"
tal:content="python: vocab.getValue(item)"
/>
--- 73,82 ----
<div tal:condition="python: vlen >= 4">
<select tal:attributes="name fieldName; id fieldName;
+ multiple python:test(field.multiValued,'multiple','');
tabindex tabindex/next;">
<option
selected=""
tal:repeat="item vocab"
! tal:attributes="selected
python:test(field.containsValueAsString(item,value), 'selected', None); value
item;"
tal:content="python: vocab.getValue(item)"
/>
-------------------------------------------------------
This SF.NET email is sponsored by: eBay
Great deals on office technology -- on eBay now! Click here:
http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5
|