--- a/util/dataforms.lua Thu Jul 15 21:14:07 2010 +0200
+++ b/util/dataforms.lua Thu Jul 15 21:31:57 2010 +0200
@@ -67,9 +67,14 @@
form:tag("value"):text(line):up();
end
elseif field_type == "list-single" then
+ local has_default = false;
for _, val in ipairs(value) do
if type(val) == "table" then
form:tag("option", { label = val.label }):tag("value"):text(val.value):up():up();
+ if val.default and (not has_default) then
+ form:tag("value"):text(val.value):up();
+ has_default = true;
+ end
else
form:tag("option", { label= val }):tag("value"):text(tostring(val)):up():up();
end