liquid_feedback_frontend

view app/main/index/register.lua @ 398:714944bda6a0

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

Impressum / About Us