liquid_feedback_frontend
changeset 1377:9b9c08e37435
Add drop down registration fields
author | bsw |
---|---|
date | Wed Aug 08 17:34:30 2018 +0200 (2018-08-08) |
parents | 2ff3ae341a6e |
children | 1b630b012aba |
files | app/main/registration/_register_form.lua |
line diff
1.1 --- a/app/main/registration/_register_form.lua Wed Aug 08 17:28:10 2018 +0200 1.2 +++ b/app/main/registration/_register_form.lua Wed Aug 08 17:34:30 2018 +0200 1.3 @@ -86,7 +86,22 @@ 1.4 value = tonumber(request.get_param{ name = "verification_data_" .. field.name .. "_year" }) 1.5 } 1.6 slot.put("<br />") 1.7 - 1.8 + 1.9 + elseif field.type == "dropdown" then 1.10 + local options = { id = "", value = field.label } 1.11 + for i_options, option in ipairs(field.options) do 1.12 + table.insert(options, option) 1.13 + end 1.14 + ui.field.select{ 1.15 + container_attr = { style = "display: inline-block; " }, 1.16 + attr = { class = class }, 1.17 + foreign_records = options, 1.18 + foreign_id = "id", 1.19 + foreign_name = "name", 1.20 + name = "verification_data_" .. field.name, 1.21 + value = tonumber(request.get_param{ name = "verification_data_" .. field.name }) 1.22 + } 1.23 + 1.24 elseif field.type == "image" then 1.25 ui.tag{ tag = "label", content = field.label } 1.26 slot.put(" ")