liquid_feedback_frontend

annotate app/main/index/register.lua @ 742:b8b205e65c6d

Optical enhancements
author bsw
date Thu Jun 28 22:26:26 2012 +0200 (2012-06-28)
parents 6e4392a4ed9b
children 7a452bd3d0df
rev   line source
bsw@441 1 execute.view{ module = "index", view = "_lang_chooser" }
bsw@441 2
bsw@286 3 local step = param.get("step", atom.integer)
bsw/jbe@5 4 local code = param.get("code")
bsw/jbe@6 5 local notify_email = param.get("notify_email")
bsw/jbe@5 6 local name = param.get("name")
bsw/jbe@5 7 local login = param.get("login")
bsw/jbe@5 8
bsw/jbe@5 9 ui.form{
bsw/jbe@6 10 attr = { class = "vertical" },
bsw/jbe@5 11 module = 'index',
bsw/jbe@5 12 action = 'register',
bsw/jbe@5 13 params = {
bsw/jbe@5 14 code = code,
bsw/jbe@6 15 notify_email = notify_email,
bsw/jbe@5 16 name = name,
bsw/jbe@5 17 login = login
bsw/jbe@5 18 },
bsw/jbe@5 19 content = function()
bsw/jbe@5 20
bsw/jbe@5 21 if not code then
bsw@742 22 ui.actions(function()
bsw@742 23 ui.link{
bsw@742 24 content = function()
bsw@742 25 slot.put(_"One step back")
bsw@742 26 end,
bsw@742 27 module = "index",
bsw@742 28 view = "register",
bsw@742 29 params = {
bsw@742 30 }
bsw@742 31 }
bsw@742 32 ui.link{
bsw@742 33 content = function()
bsw@742 34 slot.put(_"Cancel registration")
bsw@742 35 end,
bsw@742 36 module = "index",
bsw@742 37 view = "index"
bsw@742 38 }
bsw@742 39 end)
bsw@740 40 ui.title(_"Registration (step 1 of 3: Invite code)")
bsw@286 41 ui.field.hidden{ name = "step", value = 1 }
bsw/jbe@5 42 ui.tag{
bsw/jbe@5 43 tag = "p",
bsw/jbe@5 44 content = _"Please enter the invite code you've received."
bsw/jbe@5 45 }
bsw/jbe@5 46 ui.field.text{
bsw@286 47 label = _'Invite code',
bsw@286 48 name = 'code',
bsw/jbe@6 49 value = param.get("invite")
bsw/jbe@6 50 }
bsw/jbe@6 51
bsw/jbe@5 52 else
bsw@286 53 local member = Member:new_selector()
bsw@286 54 :add_where{ "invite_code = ?", code }
bsw@286 55 :add_where{ "activated ISNULL" }
bsw@286 56 :optional_object_mode()
bsw@286 57 :for_update()
bsw@286 58 :exec()
bsw@286 59
bsw@286 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
bsw@740 61 ui.title(_"Registration (step 2 of 3: Personal information)")
bsw@286 62 ui.field.hidden{ name = "step", value = 2 }
bsw@741 63 ui.actions(function()
bsw@286 64 ui.link{
bsw@286 65 content = function()
bsw@286 66 slot.put(_"One step back")
bsw@286 67 end,
bsw@286 68 module = "index",
bsw@286 69 view = "register",
bsw@286 70 params = {
bsw@286 71 }
bsw/jbe@6 72 }
bsw@742 73 ui.link{
bsw@742 74 content = function()
bsw@742 75 slot.put(_"Cancel registration")
bsw@742 76 end,
bsw@742 77 module = "index",
bsw@742 78 view = "index"
bsw@742 79 }
bsw@286 80 end)
bsw@286 81
bsw@286 82 ui.tag{
bsw@286 83 tag = "p",
bsw@286 84 content = _"This invite key is connected with the following information:"
bsw/jbe@6 85 }
bsw@286 86
bsw@286 87 execute.view{ module = "member", view = "_profile", params = { member = member, include_private_data = true } }
bsw@79 88
bsw@286 89 if not config.locked_profile_fields.notify_email then
bsw@286 90 ui.tag{
bsw@286 91 tag = "p",
bsw@286 92 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@286 93 }
bsw@286 94 ui.field.text{
bsw@286 95 label = _'Email address',
bsw@286 96 name = 'notify_email',
bsw@286 97 value = param.get("notify_email") or member.notify_email
bsw@286 98 }
bsw@286 99 end
bsw@286 100 if not config.locked_profile_fields.name then
bsw@286 101 ui.tag{
bsw@286 102 tag = "p",
bsw@286 103 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@286 104 }
bsw@286 105 ui.field.text{
bsw@286 106 label = _'Screen name',
bsw@286 107 name = 'name',
bsw@286 108 value = param.get("name") or member.name
bsw@286 109 }
bsw@286 110 end
bsw@286 111 if not config.locked_profile_fields.login then
bsw@286 112 ui.tag{
bsw@286 113 tag = "p",
bsw@286 114 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@286 115 }
bsw@286 116 ui.field.text{
bsw@286 117 label = _'Login name',
bsw@286 118 name = 'login',
bsw@286 119 value = param.get("login") or member.login
bsw@286 120 }
bsw@286 121 end
bsw@286 122 else
bsw@286 123
bsw@286 124 ui.field.hidden{ name = "step", value = "3" }
bsw@740 125 ui.title(_"Registration (step 3 of 3: Terms of use and password)")
bsw@741 126 ui.actions(function()
bsw@286 127 ui.link{
bsw@286 128 content = function()
bsw@286 129 slot.put(_"One step back")
bsw@286 130 end,
bsw@286 131 module = "index",
bsw@286 132 view = "register",
bsw@286 133 params = {
bsw@286 134 code = code,
bsw@286 135 notify_email = notify_email,
bsw@286 136 name = name,
bsw@286 137 login = login,
bsw@286 138 step = 1
bsw@286 139 }
bsw@286 140 }
bsw@742 141 ui.link{
bsw@742 142 content = function()
bsw@742 143 slot.put(_"Cancel registration")
bsw@742 144 end,
bsw@742 145 module = "index",
bsw@742 146 view = "index"
bsw@742 147 }
bsw@286 148 end)
bsw@286 149 ui.container{
bsw@286 150 attr = { class = "wiki use_terms" },
bsw@79 151 content = function()
bsw@286 152 if config.use_terms_html then
bsw@286 153 slot.put(config.use_terms_html)
bsw@286 154 else
bsw@286 155 slot.put(format.wiki_text(config.use_terms))
bsw@286 156 end
bsw@79 157 end
bsw@79 158 }
bsw@79 159
bsw@739 160 member.notify_email = notify_email or member.notify_email
bsw@739 161 member.name = name or member.name
bsw@739 162 member.login = login or member.login
bsw@739 163
bsw@739 164 execute.view{ module = "member", view = "_profile", params = {
bsw@739 165 member = member, include_private_data = true
bsw@739 166 } }
bsw@739 167
bsw@286 168 for i, checkbox in ipairs(config.use_terms_checkboxes) do
bsw@286 169 slot.put("<br />")
bsw@286 170 ui.tag{
bsw@286 171 tag = "div",
bsw@286 172 content = function()
bsw@286 173 ui.tag{
bsw@286 174 tag = "input",
bsw@286 175 attr = {
bsw@286 176 type = "checkbox",
bsw@398 177 id = "use_terms_checkbox_" .. checkbox.name,
bsw@286 178 name = "use_terms_checkbox_" .. checkbox.name,
bsw@286 179 value = "1",
bsw@286 180 style = "float: left;",
bsw@286 181 checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil
bsw@286 182 }
bsw@286 183 }
bsw@286 184 slot.put("&nbsp;")
bsw@398 185 ui.tag{
bsw@398 186 tag = "label",
bsw@398 187 attr = { ['for'] = "use_terms_checkbox_" .. checkbox.name },
bsw@398 188 content = function() slot.put(checkbox.html) end
bsw@398 189 }
bsw@286 190 end
bsw@286 191 }
bsw@286 192 end
bsw@79 193
bsw@286 194 slot.put("<br />")
bsw/jbe@6 195
bsw@286 196 ui.tag{
bsw@286 197 tag = "p",
bsw@286 198 content = _"Please choose a password and enter it twice. The password is case sensitive."
bsw@286 199 }
bsw@286 200 ui.field.password{
bsw@286 201 label = _'Password',
bsw@286 202 name = 'password1',
bsw@286 203 }
bsw@286 204 ui.field.password{
bsw@286 205 label = _'Password (repeat)',
bsw@286 206 name = 'password2',
bsw@286 207 }
bsw/jbe@5 208
bsw@286 209 end
bsw/jbe@5 210 end
bsw/jbe@5 211
bsw@286 212 ui.submit{
bsw@740 213 text = _'Create account'
bsw@286 214 }
bsw/jbe@5 215 end
bsw/jbe@5 216 }
bsw/jbe@5 217
bsw/jbe@5 218

Impressum / About Us