2 #def databaseList($lst, $default, $onchange, $name, $id, $valueattr, $descattr)
3 <select name="$name" id="$id"#slurp
4 #if $onchange is not None
5 onchange="$onchange"#slurp
9 #if $default then '' else 'selected'
10 value="">None</option>
13 #if $default == getattr(item, valueattr) then 'selected' else ''
14 value="${getattr(item, valueattr)}">
15 ${getattr(item, descattr)}
21 #def cdromList($default="", $onchange=None)
23 $databaseList(sorted($sipb_xen_database.CDROM.select(), key=lambda x: x.description),
24 default, onchange, 'cdrom', 'cdromlist', 'cdrom_id', 'description')
28 #def autoList($default="", $onchange=None)
30 $databaseList(sorted($sipb_xen_database.Autoinstall.select(), key=lambda x: x.description),
31 default, onchange, 'autoinstall', 'autoinstalllist', 'autoinstall_id', 'description')
35 #def vmTypeList($default=None)
36 #for $vmtype in (('linux-hvm', 'HVM'), ('linux', 'ParaVM'), )
39 #if $default == $vmtype[0] then 'checked' else ''
40 type="radio" name="vmtype" value="${vmtype[0]}">${vmtype[1]}</input>
47 #set global $error_text = $error_text + '----\n' + $txt
49 #set global $error_text = $txt
53 #def errorRow($value, $err)
54 #if $err and $err.err_field == $value
56 <td class="error" colspan="2">${str($err)}</td>