aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-06-27 20:06:13 +0200
committerKim Alvefur <zash@zash.se>2018-06-27 20:06:13 +0200
commitcecc562ac0f755a234fb82848a388354b0e14989 (patch)
tree0a6af54d48d2da5084deae9c17acb48e55dc172f
parent0a92cbb3721bb24932c38cb261afcbf4e01f6362 (diff)
downloadprosody-cecc562ac0f755a234fb82848a388354b0e14989.tar.gz
prosody-cecc562ac0f755a234fb82848a388354b0e14989.zip
util.dataforms: Add support for field descriptions in <desc>
-rw-r--r--util/dataforms.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/util/dataforms.lua b/util/dataforms.lua
index 7b832f78..e48f6879 100644
--- a/util/dataforms.lua
+++ b/util/dataforms.lua
@@ -38,6 +38,10 @@ function form_t.form(layout, data, formtype)
-- 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