liquid_feedback_frontend
changeset 1391:68eb999c7bfb
Changed style of register image upload
author | bsw |
---|---|
date | Mon Aug 13 19:17:47 2018 +0200 (2018-08-13) |
parents | 3bbf39ad3d3e |
children | 41e3da074385 |
files | app/main/registration/_register_form.lua |
line diff
1.1 --- a/app/main/registration/_register_form.lua Fri Aug 10 14:10:43 2018 +0200 1.2 +++ b/app/main/registration/_register_form.lua Mon Aug 13 19:17:47 2018 +0200 1.3 @@ -106,11 +106,22 @@ 1.4 1.5 elseif field.type == "image" then 1.6 slot.put("<br />") 1.7 - ui.tag{ tag = "label", attr = { style = "vertical-align: bottom; border-bottom: 1px solid rgba(0,0,0, 0.12); color: #777; font-size: 16px;" }, content = field.label .. ":" } 1.8 - slot.put(" ") 1.9 - ui.tag{ tag = "input", attr = { type = "file", name = "verification_data_" .. field.name } } 1.10 + ui.tag{ tag = "label", attr = { style = "display: block; vertical-align: bottom; border-bottom: 1px solid rgba(0,0,0, 0.12); color: #777; font-size: 16px;" }, content = field.label .. ":" } 1.11 + ui.script{ script = [[ 1.12 + function getFile(){ 1.13 + document.getElementById("upfile").click(); 1.14 + } 1.15 + function fileChoosen(obj){ 1.16 + var file = obj.value; 1.17 + var fileName = file.split("\\"); 1.18 + document.getElementById("fileBtn").innerHTML = fileName[fileName.length-1]; 1.19 + event.preventDefault(); 1.20 + } 1.21 + ]] } 1.22 + ui.tag{ attr = { id = "fileBtn", onclick = "getFile();"}, content = field.upload_label } 1.23 + ui.tag{ tag = "input", attr = { style = "display: none;", type = "file", name = "verification_data_" .. field.name, onchange = "fileChoosen(this);" } } 1.24 if field.optional_checkbox then 1.25 - slot.put("<br /><br />") 1.26 + slot.put(" ") 1.27 ui.tag{ tag = "label", attr = { 1.28 class = "mdl-checkbox mdl-js-checkbox mdl-js-ripple-effect", 1.29 ["for"] = "verification_data_" .. field.name .. "_optout"