liquid_feedback_frontend

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

Impressum / About Us