Skip to content

Commit

Permalink
+/- buttons are inside fieldset for better ergonomy
Browse files Browse the repository at this point in the history
  • Loading branch information
thomasdesvenain committed Nov 2, 2008
1 parent 4df3727 commit f6d2b3d
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 20 deletions.
15 changes: 9 additions & 6 deletions Products/CompoundField/skins/CompoundField/ArrayWidget.pt
Expand Up @@ -28,14 +28,17 @@

<tal:block tal:define="fsize python:field.getSize(here)+1;ssize python:field.getSize(here)-1">
<fieldset>
<tal:block tal:repeat="f python:field.getFields()[1:fsize]">
<input metal:use-macro="python:here.widget(f.getName(), field=f, mode='edit')" />
</tal:block>
<div>
<tal:block tal:repeat="f python:field.getFields()[1:fsize]">
<input metal:use-macro="python:here.widget(f.getName(), field=f, mode='edit')" />
</tal:block>
</div>
<div class="arraywidget-addremovebuttons">
<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$fsize" >+</a>
<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$ssize" >-</a>
</div>
</fieldset>

<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$fsize" >+</a>
<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$ssize" >-</a>

</tal:block>

</div>
Expand Down
35 changes: 21 additions & 14 deletions Products/CompoundField/skins/CompoundField/EnhancedArrayWidget.pt
Expand Up @@ -77,24 +77,31 @@
}
">
dummy
</script>
<fieldset tal:attributes="id targetElemId">
</script>
<fieldset>
<div tal:attributes="id targetElemId">
<tal:block tal:repeat="f python:fields[1:fsize]">
<input metal:use-macro="python:here.widget(f.getName(), field=f, mode='edit')" />
</tal:block>

</div>
<div class="arraywidget-addremovebuttons" style="margin-top: 12px; text-align: right">
<script type="text/javascript"
tal:content="structure string: document.write('<input class=\'context\' type=\'button\' onclick=\'removeArrayElement${fieldnamePostfix}()\' value=\'-\'/>');">dummy</script>
<script type="text/javascript"
tal:content="structure string: document.write('<input class=\'context\' type=\'button\' onclick=\'addArrayElement${fieldnamePostfix}()\' value=\'+\'/>');">dummy</script>

<input type=hidden id='' value='0' name=''
tal:attributes="id sizeFieldName;
name sizeFieldName;
value actualSize;" />
<noscript>
<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$fsize" >+</a>
<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$ssize" >-</a>
</noscript>
</div>
</fieldset>
<script type="text/javascript"
tal:content="structure string: document.write('<input class=\'context\' type=\'button\' onclick=\'addArrayElement${fieldnamePostfix}()\' value=\'+\'/>');">dummy</script>
<script type="text/javascript"
tal:content="structure string: document.write('<input class=\'context\' type=\'button\' onclick=\'removeArrayElement${fieldnamePostfix}()\' value=\'-\'/>');">dummy</script>
<input type=hidden id='' value='0' name=''
tal:attributes="id sizeFieldName;
name sizeFieldName;
value actualSize;" />
<noscript>
<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$fsize" >+</a>
<a tal:attributes="href string:${here/absolute_url}/arrayfield_resize?fieldname=${field/getName}&size=$ssize" >-</a>
</noscript>

</tal:block>

</div>
Expand Down

0 comments on commit f6d2b3d

Please sign in to comment.