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

This doc was last edited by Administrator October 14, 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
  30
  31
  32
  33
  34
  35
$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"

$if name == "table_of_contents":
    $# display table_of_contents as textbox instead of textarea
    $ property_type = "/type/string"
$else:
    $ 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(property_type, 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(property_type, 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>