Diff

util/dataforms.lua @ 8945:cbeb1a045eb6

util.dataforms: Add support for field descriptions in <desc>
author Kim Alvefur <zash@zash.se>
date Wed, 27 Jun 2018 20:06:13 +0200
parent 8864:cf2f66b233d1
child 8984:fa80b3231a02
line wrap: on
line diff
--- a/util/dataforms.lua	Wed Jun 27 16:00:54 2018 +0100
+++ b/util/dataforms.lua	Wed Jun 27 20:06:13 2018 +0200
@@ -38,6 +38,10 @@
 		-- Add field tag
 		form:tag("field", { type = field_type, var = field.name, label = field.label });
 
+		if field.desc then
+			form:text_tag("desc", field.desc);
+		end
+
 		local value = (data and data[field.name]) or field.value;
 
 		if value then