1 #def databaseList($lst, $default, $onchange, $name, $id, $valueattr, $descattr)
2 <select name="$name" id="$id"#slurp
3 #if $onchange is not None
4 onchange="$onchange"#slurp
8 #if $default then '' else 'selected'
12 #if $default == getattr(item, valueattr) then 'selected' else ''
13 value="${getattr(item, valueattr)}">
14 ${getattr(item, descattr)}
20 #def cdromList($default="", $onchange=None)
21 $databaseList(sorted($sipb_xen_database.CDROM.select(), key=lambda x: x.description),
22 default, onchange, 'cdrom', 'cdromlist', 'cdrom_id', 'description')
25 #def autoList($default="", $onchange=None)
26 $databaseList(sorted($sipb_xen_database.Autoinstall.select(), key=lambda x: x.description),
27 default, onchange, 'autoinstall', 'autoinstalllist', 'autoinstall_id', 'description')
28 ## $databaseList(autos, default, onchange, 'autoinstall', 'autoinstalllist', 'autoinstall_id', 'description')
31 #def vmTypeList($default=None)
32 #for $vmtype in sorted($sipb_xen_database.Type.select(), key=lambda x: x.description)
35 #if $default == $vmtype then 'checked' else ''
36 type="radio" name="vmtype" value="${vmtype.type_id}">${vmtype.description}</input>
43 #set global $error_text = $error_text + '----\n' + $txt
45 #set global $error_text = $txt
49 #def errorRow($value, $err)
50 #if $err and $err.err_field == $value
52 <td class="error" colspan="2">${str($err)}</td>