bsw@441: execute.view{ module = "index", view = "_lang_chooser" } bsw@441: bsw@286: local step = param.get("step", atom.integer) bsw/jbe@5: local code = param.get("code") bsw/jbe@6: local notify_email = param.get("notify_email") bsw/jbe@5: local name = param.get("name") bsw/jbe@5: local login = param.get("login") bsw/jbe@5: bsw/jbe@5: ui.form{ bsw@1045: attr = { class = "section vertical" }, bsw/jbe@5: module = 'index', bsw/jbe@5: action = 'register', bsw/jbe@5: params = { bsw/jbe@5: code = code, bsw/jbe@6: notify_email = notify_email, bsw/jbe@5: name = name, bsw/jbe@5: login = login bsw/jbe@5: }, bsw/jbe@5: content = function() bsw/jbe@5: bsw/jbe@5: if not code then bsw@1045: ui.field.hidden{ name = "step", value = 1 } bsw@743: ui.title(_"Registration (step 1 of 3: Invite code)") bsw@1045: ui.sectionHead( function() bsw@1045: ui.heading { level = 1, content = _"Please enter the invite code you've received" } bsw@1045: end ) bsw@1045: ui.sectionRow( function() bsw@1045: ui.field.text{ bsw@1045: label = _'Invite code', bsw@1045: name = 'code', bsw@1045: value = param.get("invite") bsw@1045: } bsw@1045: ui.submit{ bsw@1045: text = _'proceed with registration' bsw@1045: } bsw@1045: slot.put(" ") bsw@742: ui.link{ bsw@1045: content = _"cancel registration", bsw@742: module = "index", bsw@742: view = "index" bsw@742: } bsw@1045: end ) bsw/jbe@5: else bsw@286: local member = Member:new_selector() bsw@286: :add_where{ "invite_code = ?", code } bsw@286: :add_where{ "activated ISNULL" } bsw@286: :optional_object_mode() bsw@286: :exec() bsw@286: bsw@286: 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 bsw@740: ui.title(_"Registration (step 2 of 3: Personal information)") bsw@286: ui.field.hidden{ name = "step", value = 2 } bsw@1045: bsw@1045: ui.sectionHead( function() bsw@1045: ui.heading { level = 1, content = _"Check and enter personal data" } bsw@1045: end ) bsw@1045: ui.sectionRow( function() bsw@1045: ui.tag{ bsw@1045: tag = "p", bsw@1045: content = _"This invite key is connected with the following information:" bsw@1045: } bsw@1045: bsw@1045: execute.view{ module = "member", view = "_profile", params = { member = member, for_registration = true } } bsw@1045: bsw@1045: if not config.locked_profile_fields.notify_email then bsw@1045: ui.tag{ bsw@1045: tag = "p", bsw@1045: 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." bsw@1045: } bsw@1045: ui.field.text{ bsw@1045: label = _'Email address', bsw@1045: name = 'notify_email', bsw@1045: value = param.get("notify_email") or member.notify_email bsw@1045: } bsw@1045: end bsw@1045: if not config.locked_profile_fields.name then bsw@1045: ui.tag{ bsw@1045: tag = "p", bsw@1045: content = _"Please choose a name, i.e. your real name or your nick name. This name will be shown to others to identify you." bsw@1045: } bsw@1045: ui.field.text{ bsw@1045: label = _'Screen name', bsw@1045: name = 'name', bsw@1045: value = param.get("name") or member.name bsw@1045: } bsw@1045: end bsw@1045: if not config.locked_profile_fields.login then bsw@1045: ui.tag{ bsw@1045: tag = "p", bsw@1045: 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." bsw@1045: } bsw@1045: ui.field.text{ bsw@1045: label = _'Login name', bsw@1045: name = 'login', bsw@1045: value = param.get("login") or member.login bsw@1045: } bsw@1045: end bsw@1045: ui.submit{ bsw@1045: text = _'proceed with registration' bsw@1045: } bsw@1045: slot.put(" ") bsw@286: ui.link{ bsw@1045: content = _"one step back", bsw@745: module = "index", bsw@745: view = "register", bsw@745: params = { bsw@750: invite = code bsw@745: } bsw@745: } bsw@1045: slot.put(" ") bsw@745: ui.link{ bsw@1045: content = _"cancel registration", bsw@742: module = "index", bsw@742: view = "index" bsw@742: } bsw@1045: end ) bsw@286: else bsw@286: bsw@286: ui.field.hidden{ name = "step", value = "3" } bsw@740: ui.title(_"Registration (step 3 of 3: Terms of use and password)") bsw@1045: ui.sectionHead( function() bsw@1045: ui.heading { level = 1, content = _"Read and accept the terms and choose a password" } bsw@1045: end ) bsw@1045: ui.sectionRow( function() bsw@1045: ui.container{ bsw@1045: attr = { class = "wiki use_terms" }, bsw@286: content = function() bsw@1045: slot.put(config.use_terms) bsw@1045: end bsw@1045: } bsw@1045: bsw@1045: member.notify_email = notify_email or member.notify_email bsw@1045: member.name = name or member.name bsw@1045: member.login = login or member.login bsw@1045: bsw@1045: execute.view{ module = "member", view = "_profile", params = { bsw@1045: member = member, include_private_data = true bsw@1045: } } bsw@1045: bsw@1045: for i, checkbox in ipairs(config.use_terms_checkboxes) do bsw@1045: slot.put("
") bsw@1045: ui.tag{ bsw@1045: tag = "div", bsw@1045: content = function() bsw@1045: ui.tag{ bsw@1045: tag = "input", bsw@1045: attr = { bsw@1045: type = "checkbox", bsw@1045: id = "use_terms_checkbox_" .. checkbox.name, bsw@1045: name = "use_terms_checkbox_" .. checkbox.name, bsw@1045: value = "1", bsw@1045: style = "float: left;", bsw@1045: checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil bsw@1045: } bsw@1045: } bsw@1045: slot.put(" ") bsw@1045: ui.tag{ bsw@1045: tag = "label", bsw@1045: attr = { ['for'] = "use_terms_checkbox_" .. checkbox.name }, bsw@1045: content = function() slot.put(checkbox.html) end bsw@1045: } bsw@1045: end bsw@1045: } bsw@1045: end bsw@1045: bsw@1045: slot.put("
") bsw@1045: bsw@1045: ui.tag{ bsw@1045: tag = "p", bsw@1045: content = _"Please choose a password and enter it twice. The password is case sensitive." bsw@1045: } bsw@1045: ui.field.text{ bsw@1045: readonly = true, bsw@1045: label = _'Login name', bsw@1045: name = 'login', bsw@1045: value = member.login bsw@1045: } bsw@1045: ui.field.password{ bsw@1045: label = _'Password', bsw@1045: name = 'password1', bsw@1045: } bsw@1045: ui.field.password{ bsw@1045: label = _'Password (repeat)', bsw@1045: name = 'password2', bsw@1045: } bsw@1045: ui.submit{ bsw@1045: text = _'activate account' bsw@1045: } bsw@1045: slot.put(" ") bsw@1045: ui.link{ bsw@1045: content = _"one step back", bsw@286: module = "index", bsw@286: view = "register", bsw@286: params = { bsw@286: code = code, bsw@286: notify_email = notify_email, bsw@286: name = name, bsw@286: login = login, bsw@286: step = 1 bsw@286: } bsw@286: } bsw@1045: slot.put(" ") bsw@742: ui.link{ bsw@1045: content = _"cancel registration", bsw@742: module = "index", bsw@742: view = "index" bsw@742: } bsw@1045: end ) bsw@286: end bsw/jbe@5: end bsw/jbe@5: end bsw/jbe@5: } bsw/jbe@5: bsw/jbe@5: