Diff

mod_adhoc_dataforms_demo/mod_adhoc_dataforms_demo.lua @ 3556:0d97cde1c7b0

mod_adhoc_dataforms_demo: Reorder form fields Group similar fields and order by complexity
author Kim Alvefur <zash@zash.se>
date Sat, 06 Apr 2019 18:07:02 +0200
parent 3555:78d4e631bc5f
child 3557:54b4b020de4c
line wrap: on
line diff
--- 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