liquid_feedback_frontend

view app/main/index/register.lua @ 746:1da6726198e3

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

Impressum / About Us