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