liquid_feedback_frontend
view app/main/index/register.lua @ 79:26c8177ef348
Support for multiple usage terms accept checkboxes
(including neccessary bugfix in member model)
(including neccessary bugfix in member model)
| author | bsw |
|---|---|
| date | Thu Jul 15 18:27:47 2010 +0200 (2010-07-15) |
| parents | 0ee1e0c42d4c |
| children | c587d8762e62 |
line source
1 slot.put_into("title", _"Registration")
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/5: Invite code")
24 ui.tag{
25 tag = "p",
26 content = _"Please enter the invite code you've received."
27 }
28 ui.field.text{
29 label = _'Invite code',
30 name = 'code',
31 value = param.get("invite")
32 }
34 elseif not notify_email then
35 slot.put_into("title", _"Step 2/5: Email address")
36 slot.select("actions", function()
37 ui.link{
38 content = function()
39 ui.image{ static = "icons/16/resultset_previous.png" }
40 slot.put(_"One step back")
41 end,
42 module = "index",
43 view = "register",
44 params = {
45 }
46 }
47 end)
48 ui.tag{
49 tag = "p",
50 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."
51 }
52 ui.field.text{
53 label = _'Email address',
54 name = 'notify_email',
55 value = param.get("notify_email")
56 }
58 elseif not name then
59 slot.put_into("title", _"Step 3/5: Username")
60 slot.select("actions", function()
61 ui.link{
62 content = function()
63 ui.image{ static = "icons/16/resultset_previous.png" }
64 slot.put(_"One step back")
65 end,
66 module = "index",
67 view = "register",
68 params = {
69 code = code
70 }
71 }
72 end)
73 ui.tag{
74 tag = "p",
75 content = _"Please choose a name, i.e. your real name or your nick name. This name will be shown to others to identify you."
76 }
77 ui.field.text{
78 label = _'Name',
79 name = 'name',
80 value = param.get("name")
81 }
83 elseif not login then
84 slot.put_into("title", _"Step 4/5: Login name")
85 slot.select("actions", function()
86 ui.link{
87 content = function()
88 ui.image{ static = "icons/16/resultset_previous.png" }
89 slot.put(_"One step back")
90 end,
91 module = "index",
92 view = "register",
93 params = {
94 code = code,
95 notify_email = notify_email
96 }
97 }
98 end)
99 ui.tag{
100 tag = "p",
101 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."
102 }
103 ui.field.text{
104 label = _'Login name',
105 name = 'login',
106 value = param.get("login")
107 }
109 else
110 ui.field.hidden{ name = "step", value = "5" }
111 slot.put_into("title", _"Step 5/5: Terms of use and password")
112 slot.select("actions", function()
113 ui.link{
114 content = function()
115 ui.image{ static = "icons/16/resultset_previous.png" }
116 slot.put(_"One step back")
117 end,
118 module = "index",
119 view = "register",
120 params = {
121 code = code,
122 notify_email = notify_email,
123 name = name,
124 }
125 }
126 end)
127 ui.container{
128 attr = { class = "wiki use_terms" },
129 content = function()
130 if config.use_terms_html then
131 slot.put(config.use_terms_html)
132 else
133 slot.put(format.wiki_text(config.use_terms))
134 end
135 end
136 }
138 for i, checkbox in ipairs(config.use_terms_checkboxes) do
139 slot.put("<br />")
140 ui.tag{
141 tag = "div",
142 content = function()
143 ui.tag{
144 tag = "input",
145 attr = {
146 type = "checkbox",
147 name = "use_terms_checkbox_" .. checkbox.name,
148 value = "1",
149 style = "float: left;",
150 checked = param.get("use_terms_checkbox_" .. checkbox.name, atom.boolean) and "checked" or nil
151 }
152 }
153 slot.put(" ")
154 slot.put(checkbox.html)
155 end
156 }
157 end
159 slot.put("<br />")
161 ui.field.text{
162 label = _'Email address',
163 value = param.get("notify_email"),
164 readonly = true
165 }
166 ui.field.text{
167 label = _'Name',
168 value = param.get("name"),
169 readonly = true
170 }
171 ui.field.text{
172 label = _'Login name',
173 value = param.get("login"),
174 readonly = true
175 }
177 ui.tag{
178 tag = "p",
179 content = _"Please choose a password and enter it twice. The password is case sensitive."
180 }
181 ui.field.password{
182 label = _'Password',
183 name = 'password1',
184 }
185 ui.field.password{
186 label = _'Password (repeat)',
187 name = 'password2',
188 }
190 end
192 ui.submit{
193 text = _'Register'
194 }
196 slot.put_into("title", ")")
197 slot.select("actions", function()
198 ui.link{
199 content = function()
200 ui.image{ static = "icons/16/cancel.png" }
201 slot.put(_"Cancel registration")
202 end,
203 module = "index",
204 view = "index"
205 }
206 end)
208 end
209 }
