liquid_feedback_frontend

view app/main/index/register.lua @ 963:03b0ac783fe0

Removed unnecessary lock
author bsw
date Thu Feb 21 18:56:59 2013 +0100 (2013-02-21)
parents ff4ee93abdb8
children 701a5cf6b067
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 }
42 ui.submit{
43 text = _'Proceed with registration'
44 }
46 else
47 local member = Member:new_selector()
48 :add_where{ "invite_code = ?", code }
49 :add_where{ "activated ISNULL" }
50 :optional_object_mode()
51 :exec()
53 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
54 ui.title(_"Registration (step 2 of 3: Personal information)")
55 ui.field.hidden{ name = "step", value = 2 }
56 ui.actions(function()
57 ui.link{
58 content = function()
59 slot.put(_"One step back")
60 end,
61 module = "index",
62 view = "register",
63 params = {
64 invite = code
65 }
66 }
67 slot.put(" · ")
68 ui.link{
69 content = function()
70 slot.put(_"Cancel registration")
71 end,
72 module = "index",
73 view = "index"
74 }
75 end)
77 ui.tag{
78 tag = "p",
79 content = _"This invite key is connected with the following information:"
80 }
82 execute.view{ module = "member", view = "_profile", params = { member = member, include_private_data = true } }
84 if not config.locked_profile_fields.notify_email then
85 ui.tag{
86 tag = "p",
87 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."
88 }
89 ui.field.text{
90 label = _'Email address',
91 name = 'notify_email',
92 value = param.get("notify_email") or member.notify_email
93 }
94 end
95 if not config.locked_profile_fields.name then
96 ui.tag{
97 tag = "p",
98 content = _"Please choose a name, i.e. your real name or your nick name. This name will be shown to others to identify you."
99 }
100 ui.field.text{
101 label = _'Screen name',
102 name = 'name',
103 value = param.get("name") or member.name
104 }
105 end
106 if not config.locked_profile_fields.login then
107 ui.tag{
108 tag = "p",
109 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."
110 }
111 ui.field.text{
112 label = _'Login name',
113 name = 'login',
114 value = param.get("login") or member.login
115 }
116 end
117 ui.submit{
118 text = _'Proceed with registration'
119 }
120 else
122 ui.field.hidden{ name = "step", value = "3" }
123 ui.title(_"Registration (step 3 of 3: Terms of use and password)")
124 ui.actions(function()
125 ui.link{
126 content = function()
127 slot.put(_"One step back")
128 end,
129 module = "index",
130 view = "register",
131 params = {
132 code = code,
133 notify_email = notify_email,
134 name = name,
135 login = login,
136 step = 1
137 }
138 }
139 slot.put(" · ")
140 ui.link{
141 content = function()
142 slot.put(_"Cancel registration")
143 end,
144 module = "index",
145 view = "index"
146 }
147 end)
148 ui.container{
149 attr = { class = "wiki use_terms" },
150 content = function()
151 if config.use_terms_html then
152 slot.put(config.use_terms_html)
153 else
154 slot.put(format.wiki_text(config.use_terms))
155 end
156 end
157 }
159 member.notify_email = notify_email or member.notify_email
160 member.name = name or member.name
161 member.login = login or member.login
163 execute.view{ module = "member", view = "_profile", params = {
164 member = member, include_private_data = true
165 } }
167 for i, checkbox in ipairs(config.use_terms_checkboxes) do
168 slot.put("<br />")
169 ui.tag{
170 tag = "div",
171 content = function()
172 ui.tag{
173 tag = "input",
174 attr = {
175 type = "checkbox",
176 id = "use_terms_checkbox_" .. checkbox.name,
177 name = "use_terms_checkbox_" .. checkbox.name,
178 value = "1",
179 style = "float: left;",
180 checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil
181 }
182 }
183 slot.put("&nbsp;")
184 ui.tag{
185 tag = "label",
186 attr = { ['for'] = "use_terms_checkbox_" .. checkbox.name },
187 content = function() slot.put(checkbox.html) end
188 }
189 end
190 }
191 end
193 slot.put("<br />")
195 ui.tag{
196 tag = "p",
197 content = _"Please choose a password and enter it twice. The password is case sensitive."
198 }
199 ui.field.text{
200 readonly = true,
201 label = _'Login name',
202 name = 'login',
203 value = member.login
204 }
205 ui.field.password{
206 label = _'Password',
207 name = 'password1',
208 }
209 ui.field.password{
210 label = _'Password (repeat)',
211 name = 'password2',
212 }
213 ui.submit{
214 text = _'Activate account'
215 }
216 end
217 end
218 end
219 }

Impressum / About Us