liquid_feedback_frontend
view app/main/index/register.lua @ 395:0a92766fe219
Fix wrong order of commands in member area list
| author | bsw |
|---|---|
| date | Mon Mar 05 22:39:41 2012 +0100 (2012-03-05) |
| parents | c587d8762e62 |
| children | 714944bda6a0 |
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 name = "use_terms_checkbox_" .. checkbox.name,
141 value = "1",
142 style = "float: left;",
143 checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil
144 }
145 }
146 slot.put(" ")
147 slot.put(checkbox.html)
148 end
149 }
150 end
152 slot.put("<br />")
154 member.notify_email = notify_email or member.notify_email
155 member.name = name or member.name
156 member.login = login or member.login
158 execute.view{ module = "member", view = "_profile", params = {
159 member = member, include_private_data = true
160 } }
162 ui.tag{
163 tag = "p",
164 content = _"Please choose a password and enter it twice. The password is case sensitive."
165 }
166 ui.field.password{
167 label = _'Password',
168 name = 'password1',
169 }
170 ui.field.password{
171 label = _'Password (repeat)',
172 name = 'password2',
173 }
175 end
176 end
178 ui.submit{
179 text = _'Register'
180 }
182 slot.put_into("title", ")")
183 slot.select("actions", function()
184 ui.link{
185 content = function()
186 ui.image{ static = "icons/16/cancel.png" }
187 slot.put(_"Cancel registration")
188 end,
189 module = "index",
190 view = "index"
191 }
192 end)
193 end
194 }
