It looks like you're offline.
Open Library logo
additional options menu

This doc was last edited by Administrator April 10, 2008.

plugin upstream
Templates in the website are disabled now. Editing them will not have any effect on the live website.
   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
$def with (page, name, unique=True, right=False)

$ label = _.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"

<tbody id="tbody_$name">
$if unique:
    <tr>
        <td valign="middle" class="$class_label">$label</td>
        <td valign="top" class="$class_input">$:thinginput(get_property_type(page.type, name), name, value)</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(get_property_type(page.type, name), name + '#' + str(i), v)</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>