/macros/EditionEditRow
Type: /type/macro
macro: value: $def with (page, name, unique=True, right=False)

$ label = i18n.get('/type/edition', name)
$ value = page[name]


$ class_label = (right and "formheader-data-left") or "formheader"
$ class_input = (right and "formheader-data-left") or "formfield"

$ property_type = get_property_type(page.type, name)

<tbody id="tbody_$name">
$if unique:
    <tr>
        <td valign="middle" class="$class_label">$label</td>
        <td valign="top" class="$class_input">$:thinginput(value, name=name, expected_type=property_type)</td>
        <td valign="top" class="formbuttons"></td>
    </tr>
$else:
    $ value = value or [""]
    $for i, v in enumerate(value):
        <tr>
            <td valign="middle" class="$class_label">$label</td>
            <td valign="top" class="$class_input">$:thinginput(v, expected_type=property_type, name=name + '#' + str(i))</td>
            <td valign="top" class="formbuttons-identifier">
                $if i == len(value) - 1:
                    <button class="control" onClick="add_row('$name')" type="button"><img src="/static/images/+.gif" alt="+" width="18" height="18" /></button>
            </td>
        </tr>
        $ label = ""
</tbody>