liquid_feedback_frontend

view app/main/index/register.lua @ 739:cae6d67b0594

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

Impressum / About Us