Software /
code /
prosody
Comparison
util/dataforms.lua @ 6672:d6a60e74f773
util.dataforms: Rename unused loop counter to '_' [luacheck]
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Wed, 06 May 2015 19:43:51 +0100 |
parent | 6668:f6f39c2f1b1f |
child | 6777:5de6b93d0190 |
comparison
equal
deleted
inserted
replaced
6671:2d5e2ed44c22 | 6672:d6a60e74f773 |
---|---|
30 form:tag("title"):text(layout.title):up(); | 30 form:tag("title"):text(layout.title):up(); |
31 end | 31 end |
32 if layout.instructions then | 32 if layout.instructions then |
33 form:tag("instructions"):text(layout.instructions):up(); | 33 form:tag("instructions"):text(layout.instructions):up(); |
34 end | 34 end |
35 for n, field in ipairs(layout) do | 35 for _, field in ipairs(layout) do |
36 local field_type = field.type or "text-single"; | 36 local field_type = field.type or "text-single"; |
37 -- Add field tag | 37 -- Add field tag |
38 form:tag("field", { type = field_type, var = field.name, label = field.label }); | 38 form:tag("field", { type = field_type, var = field.name, label = field.label }); |
39 | 39 |
40 local value = (data and data[field.name]) or field.value; | 40 local value = (data and data[field.name]) or field.value; |