liquid_feedback_frontend
diff app/main/index/register.lua @ 79:26c8177ef348
Support for multiple usage terms accept checkboxes
(including neccessary bugfix in member model)
(including neccessary bugfix in member model)
| author | bsw |
|---|---|
| date | Thu Jul 15 18:27:47 2010 +0200 (2010-07-15) |
| parents | 0ee1e0c42d4c |
| children | c587d8762e62 |
line diff
1.1 --- a/app/main/index/register.lua Wed Jul 14 13:59:54 2010 +0200 1.2 +++ b/app/main/index/register.lua Thu Jul 15 18:27:47 2010 +0200 1.3 @@ -107,6 +107,7 @@ 1.4 } 1.5 1.6 else 1.7 + ui.field.hidden{ name = "step", value = "5" } 1.8 slot.put_into("title", _"Step 5/5: Terms of use and password") 1.9 slot.select("actions", function() 1.10 ui.link{ 1.11 @@ -126,10 +127,37 @@ 1.12 ui.container{ 1.13 attr = { class = "wiki use_terms" }, 1.14 content = function() 1.15 - slot.put(format.wiki_text(config.use_terms)) 1.16 + if config.use_terms_html then 1.17 + slot.put(config.use_terms_html) 1.18 + else 1.19 + slot.put(format.wiki_text(config.use_terms)) 1.20 + end 1.21 end 1.22 } 1.23 + 1.24 + for i, checkbox in ipairs(config.use_terms_checkboxes) do 1.25 + slot.put("<br />") 1.26 + ui.tag{ 1.27 + tag = "div", 1.28 + content = function() 1.29 + ui.tag{ 1.30 + tag = "input", 1.31 + attr = { 1.32 + type = "checkbox", 1.33 + name = "use_terms_checkbox_" .. checkbox.name, 1.34 + value = "1", 1.35 + style = "float: left;", 1.36 + checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil 1.37 + } 1.38 + } 1.39 + slot.put(" ") 1.40 + slot.put(checkbox.html) 1.41 + end 1.42 + } 1.43 + end 1.44 + 1.45 slot.put("<br />") 1.46 + 1.47 ui.field.text{ 1.48 label = _'Email address', 1.49 value = param.get("notify_email"), 1.50 @@ -148,15 +176,6 @@ 1.51 1.52 ui.tag{ 1.53 tag = "p", 1.54 - content = _"I accept the terms of use by checking the following checkbox:" 1.55 - } 1.56 - ui.field.boolean{ 1.57 - label = _"Terms accepted", 1.58 - name = "use_terms_accepted", 1.59 - } 1.60 - 1.61 - ui.tag{ 1.62 - tag = "p", 1.63 content = _"Please choose a password and enter it twice. The password is case sensitive." 1.64 } 1.65 ui.field.password{