liquid_feedback_frontend
diff app/main/index/register.lua @ 1045:701a5cf6b067
Imported LiquidFeedback Frontend 3.0 branch
| author | bsw |
|---|---|
| date | Thu Jul 10 01:19:48 2014 +0200 (2014-07-10) |
| parents | 03b0ac783fe0 |
| children | 58f48a8a202a |
line diff
1.1 --- a/app/main/index/register.lua Thu Jul 10 01:02:43 2014 +0200 1.2 +++ b/app/main/index/register.lua Thu Jul 10 01:19:48 2014 +0200 1.3 @@ -7,7 +7,7 @@ 1.4 local login = param.get("login") 1.5 1.6 ui.form{ 1.7 - attr = { class = "vertical" }, 1.8 + attr = { class = "section vertical" }, 1.9 module = 'index', 1.10 action = 'register', 1.11 params = { 1.12 @@ -19,30 +19,27 @@ 1.13 content = function() 1.14 1.15 if not code then 1.16 + ui.field.hidden{ name = "step", value = 1 } 1.17 ui.title(_"Registration (step 1 of 3: Invite code)") 1.18 - ui.actions(function() 1.19 + ui.sectionHead( function() 1.20 + ui.heading { level = 1, content = _"Please enter the invite code you've received" } 1.21 + end ) 1.22 + ui.sectionRow( function() 1.23 + ui.field.text{ 1.24 + label = _'Invite code', 1.25 + name = 'code', 1.26 + value = param.get("invite") 1.27 + } 1.28 + ui.submit{ 1.29 + text = _'proceed with registration' 1.30 + } 1.31 + slot.put(" ") 1.32 ui.link{ 1.33 - content = function() 1.34 - slot.put(_"Cancel registration") 1.35 - end, 1.36 + content = _"cancel registration", 1.37 module = "index", 1.38 view = "index" 1.39 } 1.40 - end) 1.41 - ui.field.hidden{ name = "step", value = 1 } 1.42 - ui.tag{ 1.43 - tag = "p", 1.44 - content = _"Please enter the invite code you've received." 1.45 - } 1.46 - ui.field.text{ 1.47 - label = _'Invite code', 1.48 - name = 'code', 1.49 - value = param.get("invite") 1.50 - } 1.51 - ui.submit{ 1.52 - text = _'Proceed with registration' 1.53 - } 1.54 - 1.55 + end ) 1.56 else 1.57 local member = Member:new_selector() 1.58 :add_where{ "invite_code = ?", code } 1.59 @@ -53,79 +50,145 @@ 1.60 if not member.notify_email and not notify_email or not member.name and not name or not member.login and not login or step == 1 then 1.61 ui.title(_"Registration (step 2 of 3: Personal information)") 1.62 ui.field.hidden{ name = "step", value = 2 } 1.63 - ui.actions(function() 1.64 + 1.65 + ui.sectionHead( function() 1.66 + ui.heading { level = 1, content = _"Check and enter personal data" } 1.67 + end ) 1.68 + ui.sectionRow( function() 1.69 + ui.tag{ 1.70 + tag = "p", 1.71 + content = _"This invite key is connected with the following information:" 1.72 + } 1.73 + 1.74 + execute.view{ module = "member", view = "_profile", params = { member = member, for_registration = true } } 1.75 + 1.76 + if not config.locked_profile_fields.notify_email then 1.77 + ui.tag{ 1.78 + tag = "p", 1.79 + content = _"Please enter your email address. This address will be used for automatic notifications (if you request them) and in case you've lost your password. This address will not be published. After registration you will receive an email with a confirmation link." 1.80 + } 1.81 + ui.field.text{ 1.82 + label = _'Email address', 1.83 + name = 'notify_email', 1.84 + value = param.get("notify_email") or member.notify_email 1.85 + } 1.86 + end 1.87 + if not config.locked_profile_fields.name then 1.88 + ui.tag{ 1.89 + tag = "p", 1.90 + content = _"Please choose a name, i.e. your real name or your nick name. This name will be shown to others to identify you." 1.91 + } 1.92 + ui.field.text{ 1.93 + label = _'Screen name', 1.94 + name = 'name', 1.95 + value = param.get("name") or member.name 1.96 + } 1.97 + end 1.98 + if not config.locked_profile_fields.login then 1.99 + ui.tag{ 1.100 + tag = "p", 1.101 + content = _"Please choose a login name. This name will not be shown to others and is used only by you to login into the system. The login name is case sensitive." 1.102 + } 1.103 + ui.field.text{ 1.104 + label = _'Login name', 1.105 + name = 'login', 1.106 + value = param.get("login") or member.login 1.107 + } 1.108 + end 1.109 + ui.submit{ 1.110 + text = _'proceed with registration' 1.111 + } 1.112 + slot.put(" ") 1.113 ui.link{ 1.114 - content = function() 1.115 - slot.put(_"One step back") 1.116 - end, 1.117 + content = _"one step back", 1.118 module = "index", 1.119 view = "register", 1.120 params = { 1.121 invite = code 1.122 } 1.123 } 1.124 - slot.put(" · ") 1.125 + slot.put(" ") 1.126 ui.link{ 1.127 - content = function() 1.128 - slot.put(_"Cancel registration") 1.129 - end, 1.130 + content = _"cancel registration", 1.131 module = "index", 1.132 view = "index" 1.133 } 1.134 - end) 1.135 - 1.136 - ui.tag{ 1.137 - tag = "p", 1.138 - content = _"This invite key is connected with the following information:" 1.139 - } 1.140 - 1.141 - execute.view{ module = "member", view = "_profile", params = { member = member, include_private_data = true } } 1.142 - 1.143 - if not config.locked_profile_fields.notify_email then 1.144 - ui.tag{ 1.145 - tag = "p", 1.146 - content = _"Please enter your email address. This address will be used for automatic notifications (if you request them) and in case you've lost your password. This address will not be published. After registration you will receive an email with a confirmation link." 1.147 - } 1.148 - ui.field.text{ 1.149 - label = _'Email address', 1.150 - name = 'notify_email', 1.151 - value = param.get("notify_email") or member.notify_email 1.152 - } 1.153 - end 1.154 - if not config.locked_profile_fields.name then 1.155 - ui.tag{ 1.156 - tag = "p", 1.157 - content = _"Please choose a name, i.e. your real name or your nick name. This name will be shown to others to identify you." 1.158 - } 1.159 - ui.field.text{ 1.160 - label = _'Screen name', 1.161 - name = 'name', 1.162 - value = param.get("name") or member.name 1.163 - } 1.164 - end 1.165 - if not config.locked_profile_fields.login then 1.166 - ui.tag{ 1.167 - tag = "p", 1.168 - content = _"Please choose a login name. This name will not be shown to others and is used only by you to login into the system. The login name is case sensitive." 1.169 - } 1.170 - ui.field.text{ 1.171 - label = _'Login name', 1.172 - name = 'login', 1.173 - value = param.get("login") or member.login 1.174 - } 1.175 - end 1.176 - ui.submit{ 1.177 - text = _'Proceed with registration' 1.178 - } 1.179 + end ) 1.180 else 1.181 1.182 ui.field.hidden{ name = "step", value = "3" } 1.183 ui.title(_"Registration (step 3 of 3: Terms of use and password)") 1.184 - ui.actions(function() 1.185 - ui.link{ 1.186 + ui.sectionHead( function() 1.187 + ui.heading { level = 1, content = _"Read and accept the terms and choose a password" } 1.188 + end ) 1.189 + ui.sectionRow( function() 1.190 + ui.container{ 1.191 + attr = { class = "wiki use_terms" }, 1.192 content = function() 1.193 - slot.put(_"One step back") 1.194 - end, 1.195 + slot.put(config.use_terms) 1.196 + end 1.197 + } 1.198 + 1.199 + member.notify_email = notify_email or member.notify_email 1.200 + member.name = name or member.name 1.201 + member.login = login or member.login 1.202 + 1.203 + execute.view{ module = "member", view = "_profile", params = { 1.204 + member = member, include_private_data = true 1.205 + } } 1.206 + 1.207 + for i, checkbox in ipairs(config.use_terms_checkboxes) do 1.208 + slot.put("<br />") 1.209 + ui.tag{ 1.210 + tag = "div", 1.211 + content = function() 1.212 + ui.tag{ 1.213 + tag = "input", 1.214 + attr = { 1.215 + type = "checkbox", 1.216 + id = "use_terms_checkbox_" .. checkbox.name, 1.217 + name = "use_terms_checkbox_" .. checkbox.name, 1.218 + value = "1", 1.219 + style = "float: left;", 1.220 + checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil 1.221 + } 1.222 + } 1.223 + slot.put(" ") 1.224 + ui.tag{ 1.225 + tag = "label", 1.226 + attr = { ['for'] = "use_terms_checkbox_" .. checkbox.name }, 1.227 + content = function() slot.put(checkbox.html) end 1.228 + } 1.229 + end 1.230 + } 1.231 + end 1.232 + 1.233 + slot.put("<br />") 1.234 + 1.235 + ui.tag{ 1.236 + tag = "p", 1.237 + content = _"Please choose a password and enter it twice. The password is case sensitive." 1.238 + } 1.239 + ui.field.text{ 1.240 + readonly = true, 1.241 + label = _'Login name', 1.242 + name = 'login', 1.243 + value = member.login 1.244 + } 1.245 + ui.field.password{ 1.246 + label = _'Password', 1.247 + name = 'password1', 1.248 + } 1.249 + ui.field.password{ 1.250 + label = _'Password (repeat)', 1.251 + name = 'password2', 1.252 + } 1.253 + ui.submit{ 1.254 + text = _'activate account' 1.255 + } 1.256 + slot.put(" ") 1.257 + ui.link{ 1.258 + content = _"one step back", 1.259 module = "index", 1.260 view = "register", 1.261 params = { 1.262 @@ -136,83 +199,13 @@ 1.263 step = 1 1.264 } 1.265 } 1.266 - slot.put(" · ") 1.267 + slot.put(" ") 1.268 ui.link{ 1.269 - content = function() 1.270 - slot.put(_"Cancel registration") 1.271 - end, 1.272 + content = _"cancel registration", 1.273 module = "index", 1.274 view = "index" 1.275 } 1.276 - end) 1.277 - ui.container{ 1.278 - attr = { class = "wiki use_terms" }, 1.279 - content = function() 1.280 - if config.use_terms_html then 1.281 - slot.put(config.use_terms_html) 1.282 - else 1.283 - slot.put(format.wiki_text(config.use_terms)) 1.284 - end 1.285 - end 1.286 - } 1.287 - 1.288 - member.notify_email = notify_email or member.notify_email 1.289 - member.name = name or member.name 1.290 - member.login = login or member.login 1.291 - 1.292 - execute.view{ module = "member", view = "_profile", params = { 1.293 - member = member, include_private_data = true 1.294 - } } 1.295 - 1.296 - for i, checkbox in ipairs(config.use_terms_checkboxes) do 1.297 - slot.put("<br />") 1.298 - ui.tag{ 1.299 - tag = "div", 1.300 - content = function() 1.301 - ui.tag{ 1.302 - tag = "input", 1.303 - attr = { 1.304 - type = "checkbox", 1.305 - id = "use_terms_checkbox_" .. checkbox.name, 1.306 - name = "use_terms_checkbox_" .. checkbox.name, 1.307 - value = "1", 1.308 - style = "float: left;", 1.309 - checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil 1.310 - } 1.311 - } 1.312 - slot.put(" ") 1.313 - ui.tag{ 1.314 - tag = "label", 1.315 - attr = { ['for'] = "use_terms_checkbox_" .. checkbox.name }, 1.316 - content = function() slot.put(checkbox.html) end 1.317 - } 1.318 - end 1.319 - } 1.320 - end 1.321 - 1.322 - slot.put("<br />") 1.323 - 1.324 - ui.tag{ 1.325 - tag = "p", 1.326 - content = _"Please choose a password and enter it twice. The password is case sensitive." 1.327 - } 1.328 - ui.field.text{ 1.329 - readonly = true, 1.330 - label = _'Login name', 1.331 - name = 'login', 1.332 - value = member.login 1.333 - } 1.334 - ui.field.password{ 1.335 - label = _'Password', 1.336 - name = 'password1', 1.337 - } 1.338 - ui.field.password{ 1.339 - label = _'Password (repeat)', 1.340 - name = 'password2', 1.341 - } 1.342 - ui.submit{ 1.343 - text = _'Activate account' 1.344 - } 1.345 + end ) 1.346 end 1.347 end 1.348 end