# HG changeset patch # User Kim Alvefur # Date 1554566822 -7200 # Node ID 0d97cde1c7b0dd05dbfd33a9e76dbce41e160263 # Parent 78d4e631bc5fb4828aae3446b7596bed4cc7678a mod_adhoc_dataforms_demo: Reorder form fields Group similar fields and order by complexity diff -r 78d4e631bc5f -r 0d97cde1c7b0 mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua --- a/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua Sat Apr 06 18:04:29 2019 +0200 +++ b/mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua Sat Apr 06 18:07:02 2019 +0200 @@ -14,15 +14,9 @@ value = "xmpp:prosody.im/spec/util.dataforms#1", }; { - type = "boolean", - label = "boolean-label", - name = "boolean-field", - value = true, - }, - { type = "fixed", label = "fixed-label", - name = "fixed-field", + name = "fixed-field#1", value = "fixed-value", }, { @@ -32,19 +26,34 @@ value = "hidden-value", }, { - type = "jid-multi", - label = "jid-multi-label", - name = "jid-multi-field", - value = { - "jid@multi/value#1", - "jid@multi/value#2", - }, + type = "text-single", + label = "text-single-label", + name = "text-single-field", + value = "text-single-value", + }, + { + type = "text-multi", + label = "text-multi-label", + name = "text-multi-field", + value = "text\nmulti\nvalue", }, { - type = "jid-single", - label = "jid-single-label", - name = "jid-single-field", - value = "jid@single/value", + type = "text-private", + label = "text-private-label", + name = "text-private-field", + value = "text-private-value", + }, + { + type = "boolean", + label = "boolean-label", + name = "boolean-field", + value = true, + }, + { + type = "fixed", + label = "fixed-label", + name = "fixed-field#2", + value = "fixed-value", }, { type = "list-multi", @@ -73,6 +82,21 @@ } }, { + type = "jid-single", + label = "jid-single-label", + name = "jid-single-field", + value = "jid@single/value", + }, + { + type = "jid-multi", + label = "jid-multi-label", + name = "jid-multi-field", + value = { + "jid@multi/value#1", + "jid@multi/value#2", + }, + }, + { type = "list-single", label = "list-single-label", name = "list-single-field", @@ -83,24 +107,6 @@ "list-single-value#3", } }, - { - type = "text-multi", - label = "text-multi-label", - name = "text-multi-field", - value = "text\nmulti\nvalue", - }, - { - type = "text-private", - label = "text-private-label", - name = "text-private-field", - value = "text-private-value", - }, - { - type = "text-single", - label = "text-single-label", - name = "text-single-field", - value = "text-single-value", - }, }) local function handler(fields, err, data) -- luacheck: ignore 212/data