rev |
line source |
bsw@1045
|
1 local member = param.get("member", "table")
|
bsw@1045
|
2
|
bsw@1045
|
3 ui.sidebar( "tab-whatcanido", function()
|
bsw@1045
|
4
|
bsw@1045
|
5 if not member.active then
|
bsw@1045
|
6 ui.container{ attr = { class = "sidebarSection" }, content = function()
|
bsw@1045
|
7 slot.put(" · ")
|
bsw@1045
|
8 ui.tag{
|
bsw@1045
|
9 attr = { class = "interest deactivated_member_info" },
|
bsw@1045
|
10 content = _"This member is inactive"
|
bsw@1045
|
11 }
|
bsw@1045
|
12 end }
|
bsw@1045
|
13 end
|
bsw@1045
|
14
|
bsw@1045
|
15 if member.locked then
|
bsw@1045
|
16 ui.container{ attr = { class = "sidebarSection" }, content = function()
|
bsw@1045
|
17 slot.put(" · ")
|
bsw@1045
|
18 ui.tag{
|
bsw@1045
|
19 attr = { class = "interest deactivated_member_info" },
|
bsw@1045
|
20 content = _"This member is locked"
|
bsw@1045
|
21 }
|
bsw@1045
|
22 end }
|
bsw@1045
|
23 end
|
bsw@1045
|
24
|
bsw@1045
|
25
|
bsw@1045
|
26 ui.sidebarHeadWhatCanIDo()
|
bsw@1045
|
27
|
bsw@1045
|
28 if member.id == app.session.member_id and not app.session.needs_delegation_check then
|
bsw@1045
|
29 ui.sidebarSection( function()
|
bsw@1045
|
30 ui.heading { level = 3, content = _"I want to customize my profile" }
|
bsw@1045
|
31 ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
|
bsw@1045
|
32 ui.tag{ tag = "li", content = function()
|
bsw@1045
|
33 ui.link{
|
bsw@1045
|
34 content = _"edit profile data",
|
bsw@1045
|
35 module = "member",
|
bsw@1045
|
36 view = "edit"
|
bsw@1045
|
37 }
|
bsw@1045
|
38 end }
|
bsw@1045
|
39 ui.tag{ tag = "li", content = function()
|
bsw@1045
|
40 ui.link{
|
bsw@1045
|
41 content = _"change avatar/photo",
|
bsw@1045
|
42 module = "member",
|
bsw@1045
|
43 view = "edit_images"
|
bsw@1045
|
44 }
|
bsw@1045
|
45 end }
|
bsw@1045
|
46 end }
|
bsw@1045
|
47 end )
|
bsw@1045
|
48 --[[
|
bsw@1045
|
49 ui.sidebarSection( function()
|
bsw@1045
|
50 ui.heading { level = 3, content = _"I want to manage my saved contacts" }
|
bsw@1045
|
51 ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
|
bsw@1045
|
52 ui.tag{ tag = "li", content = function()
|
bsw@1045
|
53
|
bsw@1045
|
54 ui.link{
|
bsw@1045
|
55 content = _"show saved contacts",
|
bsw@1045
|
56 module = 'contact',
|
bsw@1045
|
57 view = 'list'
|
bsw@1045
|
58 }
|
bsw@1045
|
59
|
bsw@1045
|
60 end }
|
bsw@1045
|
61 end }
|
bsw@1045
|
62 end )
|
bsw@1045
|
63 --]]
|
bsw@1045
|
64
|
bsw@1045
|
65 ui.sidebarSection( function()
|
bsw@1045
|
66
|
bsw@1045
|
67 ui.heading { level = 3, content = _"I want to change account settings" }
|
bsw@1045
|
68
|
bsw@1045
|
69 local pages = {}
|
bsw@1045
|
70
|
bsw@1045
|
71 pages[#pages+1] = { view = "settings_notification", text = _"notification settings" }
|
bsw@1045
|
72 if not config.locked_profile_fields.notify_email then
|
bsw@1045
|
73 pages[#pages+1] = { view = "settings_email", text = _"change your notification email address" }
|
bsw@1045
|
74 end
|
bsw@1045
|
75 if not config.locked_profile_fields.name then
|
bsw@1045
|
76 pages[#pages+1] = { view = "settings_name", text = _"change your screen name" }
|
bsw@1045
|
77 end
|
bsw@1045
|
78 if not config.locked_profile_fields.login then
|
bsw@1045
|
79 pages[#pages+1] = { view = "settings_login", text = _"change your login" }
|
bsw@1045
|
80 end
|
bsw@1045
|
81 pages[#pages+1] = { view = "settings_password", text = _"change your password" }
|
bsw@1045
|
82 pages[#pages+1] = { view = "developer_settings", text = _"developer settings" }
|
bsw@1045
|
83
|
bsw@1045
|
84 if config.download_dir then
|
bsw@1045
|
85 pages[#pages+1] = { module = "index", view = "download", text = _"database download" }
|
bsw@1045
|
86 end
|
bsw@1045
|
87
|
bsw@1045
|
88 ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
|
bsw@1045
|
89 for i, page in ipairs(pages) do
|
bsw@1045
|
90 ui.tag{ tag = "li", content = function()
|
bsw@1045
|
91 ui.link{
|
bsw@1045
|
92 module = page.module or "member",
|
bsw@1045
|
93 view = page.view,
|
bsw@1045
|
94 text = page.text
|
bsw@1045
|
95 }
|
bsw@1045
|
96 end }
|
bsw@1045
|
97 end
|
bsw@1045
|
98 end }
|
bsw@1045
|
99 end )
|
bsw@1045
|
100
|
bsw@1045
|
101 ui.sidebarSection( function()
|
bsw@1045
|
102 ui.heading { level = 3, content = _"I want to logout" }
|
bsw@1045
|
103 ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
|
bsw@1045
|
104 ui.tag{ tag = "li", content = function()
|
bsw@1045
|
105 ui.link{
|
bsw@1045
|
106 text = _"logout",
|
bsw@1045
|
107 module = 'index',
|
bsw@1045
|
108 action = 'logout',
|
bsw@1045
|
109 routing = {
|
bsw@1045
|
110 default = {
|
bsw@1045
|
111 mode = "redirect",
|
bsw@1045
|
112 module = "index",
|
bsw@1045
|
113 view = "index"
|
bsw@1045
|
114 }
|
bsw@1045
|
115 }
|
bsw@1045
|
116 }
|
bsw@1045
|
117 end }
|
bsw@1045
|
118 end }
|
bsw@1045
|
119 end )
|
bsw@1045
|
120
|
bsw@1045
|
121 ui.sidebarSection( function()
|
bsw@1045
|
122 ui.heading { level = 3, content = _"I want to change the interface language" }
|
bsw@1045
|
123 ui.tag{ tag = "ul", attr = { class = "ul" }, content = function()
|
bsw@1045
|
124 for i, lang in ipairs(config.enabled_languages) do
|
bsw@1045
|
125
|
bsw@1045
|
126 local langcode
|
bsw@1045
|
127
|
bsw@1045
|
128 locale.do_with({ lang = lang }, function()
|
bsw@1045
|
129 langcode = _("[Name of Language]")
|
bsw@1045
|
130 end)
|
bsw@1045
|
131
|
bsw@1045
|
132 ui.tag{ tag = "li", content = function()
|
bsw@1045
|
133 ui.link{
|
bsw@1045
|
134 content = _('Select language "#{langcode}"', { langcode = langcode }),
|
bsw@1045
|
135 module = "index",
|
bsw@1045
|
136 action = "set_lang",
|
bsw@1045
|
137 params = { lang = lang },
|
bsw@1045
|
138 routing = {
|
bsw@1045
|
139 default = {
|
bsw@1045
|
140 mode = "redirect",
|
bsw@1045
|
141 module = request.get_module(),
|
bsw@1045
|
142 view = request.get_view(),
|
bsw@1045
|
143 id = param.get_id_cgi(),
|
bsw@1045
|
144 params = param.get_all_cgi()
|
bsw@1045
|
145 }
|
bsw@1045
|
146 }
|
bsw@1045
|
147 }
|
bsw@1045
|
148 end }
|
bsw@1045
|
149 end
|
bsw@1045
|
150 end }
|
bsw@1045
|
151 end )
|
bsw@1045
|
152 elseif app.session.member_id and not (member.id == app.session.member.id) then
|
bsw@1045
|
153
|
bsw@1045
|
154 ui.sidebarSection( function ()
|
bsw@1045
|
155
|
bsw@1045
|
156 local contact = Contact:by_pk(app.session.member.id, member.id)
|
bsw@1045
|
157 if not contact then
|
bsw@1045
|
158 ui.heading { level = 3, content = _"I want to save this member as contact (i.e. to use as delegatee)" }
|
bsw@1045
|
159 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
160 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
161 ui.link{
|
bsw@1045
|
162 text = _"add to my list of public contacts",
|
bsw@1045
|
163 module = "contact",
|
bsw@1045
|
164 action = "add_member",
|
bsw@1045
|
165 id = member.id,
|
bsw@1045
|
166 params = { public = true },
|
bsw@1045
|
167 routing = {
|
bsw@1045
|
168 default = {
|
bsw@1045
|
169 mode = "redirect",
|
bsw@1045
|
170 module = request.get_module(),
|
bsw@1045
|
171 view = request.get_view(),
|
bsw@1045
|
172 id = param.get_id_cgi(),
|
bsw@1045
|
173 params = param.get_all_cgi()
|
bsw@1045
|
174 }
|
bsw@1045
|
175 }
|
bsw@1045
|
176 }
|
bsw@1045
|
177 end }
|
bsw@1045
|
178 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
179 ui.link{
|
bsw@1045
|
180 text = _"add to my list of private contacts",
|
bsw@1045
|
181 module = "contact",
|
bsw@1045
|
182 action = "add_member",
|
bsw@1045
|
183 id = member.id,
|
bsw@1045
|
184 routing = {
|
bsw@1045
|
185 default = {
|
bsw@1045
|
186 mode = "redirect",
|
bsw@1045
|
187 module = request.get_module(),
|
bsw@1045
|
188 view = request.get_view(),
|
bsw@1045
|
189 id = param.get_id_cgi(),
|
bsw@1045
|
190 params = param.get_all_cgi()
|
bsw@1045
|
191 }
|
bsw@1045
|
192 }
|
bsw@1045
|
193 }
|
bsw@1045
|
194 end }
|
bsw@1045
|
195 end }
|
bsw@1045
|
196 elseif contact.public then
|
bsw@1045
|
197 ui.heading { level = 3, content = _"You saved this member as contact (i.e. to use as delegatee) and others can see it" }
|
bsw@1045
|
198 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
199 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
200 ui.link{
|
bsw@1045
|
201 text = _"make this contact private",
|
bsw@1045
|
202 module = "contact",
|
bsw@1045
|
203 action = "add_member",
|
bsw@1045
|
204 id = contact.other_member_id,
|
bsw@1045
|
205 params = { public = false },
|
bsw@1045
|
206 routing = {
|
bsw@1045
|
207 default = {
|
bsw@1045
|
208 mode = "redirect",
|
bsw@1045
|
209 module = request.get_module(),
|
bsw@1045
|
210 view = request.get_view(),
|
bsw@1045
|
211 id = param.get_id_cgi(),
|
bsw@1045
|
212 params = param.get_all_cgi()
|
bsw@1045
|
213 }
|
bsw@1045
|
214 }
|
bsw@1045
|
215 }
|
bsw@1045
|
216 end }
|
bsw@1045
|
217 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
218 ui.link{
|
bsw@1045
|
219 text = _"remove from my contact list",
|
bsw@1045
|
220 module = "contact",
|
bsw@1045
|
221 action = "remove_member",
|
bsw@1045
|
222 id = contact.other_member_id,
|
bsw@1045
|
223 routing = {
|
bsw@1045
|
224 default = {
|
bsw@1045
|
225 mode = "redirect",
|
bsw@1045
|
226 module = request.get_module(),
|
bsw@1045
|
227 view = request.get_view(),
|
bsw@1045
|
228 id = param.get_id_cgi(),
|
bsw@1045
|
229 params = param.get_all_cgi()
|
bsw@1045
|
230 }
|
bsw@1045
|
231 }
|
bsw@1045
|
232 }
|
bsw@1045
|
233 end }
|
bsw@1045
|
234 end }
|
bsw@1045
|
235 else
|
bsw@1045
|
236 ui.heading { level = 3, content = _"You saved this member as contact (i.e. to use as delegatee)" }
|
bsw@1045
|
237 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
238 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
239 ui.link{
|
bsw@1045
|
240 text = _"make this contact public",
|
bsw@1045
|
241 module = "contact",
|
bsw@1045
|
242 action = "add_member",
|
bsw@1045
|
243 id = contact.other_member_id,
|
bsw@1045
|
244 params = { public = true },
|
bsw@1045
|
245 routing = {
|
bsw@1045
|
246 default = {
|
bsw@1045
|
247 mode = "redirect",
|
bsw@1045
|
248 module = request.get_module(),
|
bsw@1045
|
249 view = request.get_view(),
|
bsw@1045
|
250 id = param.get_id_cgi(),
|
bsw@1045
|
251 params = param.get_all_cgi()
|
bsw@1045
|
252 }
|
bsw@1045
|
253 }
|
bsw@1045
|
254 }
|
bsw@1045
|
255 end }
|
bsw@1045
|
256 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
257 ui.link{
|
bsw@1045
|
258 text = _"remove from my contact list",
|
bsw@1045
|
259 module = "contact",
|
bsw@1045
|
260 action = "remove_member",
|
bsw@1045
|
261 id = contact.other_member_id,
|
bsw@1045
|
262 routing = {
|
bsw@1045
|
263 default = {
|
bsw@1045
|
264 mode = "redirect",
|
bsw@1045
|
265 module = request.get_module(),
|
bsw@1045
|
266 view = request.get_view(),
|
bsw@1045
|
267 id = param.get_id_cgi(),
|
bsw@1045
|
268 params = param.get_all_cgi()
|
bsw@1045
|
269 }
|
bsw@1045
|
270 }
|
bsw@1045
|
271 }
|
bsw@1045
|
272 end }
|
bsw@1045
|
273 end }
|
bsw@1045
|
274 end
|
bsw@1045
|
275 end )
|
bsw@1045
|
276
|
bsw@1045
|
277 ui.sidebarSection( function()
|
bsw@1045
|
278 local ignored_member = IgnoredMember:by_pk(app.session.member.id, member.id)
|
bsw@1045
|
279 if not ignored_member then
|
bsw@1045
|
280 ui.heading { level = 3, content = _"I do not like to hear from this member" }
|
bsw@1045
|
281 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
282 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
283 ui.link{
|
bsw@1045
|
284 attr = { class = "interest" },
|
bsw@1045
|
285 text = _"block this member",
|
bsw@1045
|
286 module = "member",
|
bsw@1045
|
287 action = "update_ignore_member",
|
bsw@1045
|
288 id = member.id,
|
bsw@1045
|
289 routing = {
|
bsw@1045
|
290 default = {
|
bsw@1045
|
291 mode = "redirect",
|
bsw@1045
|
292 module = request.get_module(),
|
bsw@1045
|
293 view = request.get_view(),
|
bsw@1045
|
294 id = param.get_id_cgi(),
|
bsw@1045
|
295 params = param.get_all_cgi()
|
bsw@1045
|
296 }
|
bsw@1045
|
297 }
|
bsw@1045
|
298 }
|
bsw@1045
|
299 end }
|
bsw@1045
|
300 end }
|
bsw@1045
|
301 else
|
bsw@1045
|
302 ui.heading { level = 3, content = _"You blocked this member (i.e. you will not be notified about this members actions)" }
|
bsw@1045
|
303 ui.tag { tag = "ul", attr = { class = "ul" }, content = function ()
|
bsw@1045
|
304 ui.tag { tag = "li", content = function ()
|
bsw@1045
|
305 ui.link{
|
bsw@1045
|
306 text = _"unblock member",
|
bsw@1045
|
307 module = "member",
|
bsw@1045
|
308 action = "update_ignore_member",
|
bsw@1045
|
309 id = member.id,
|
bsw@1045
|
310 params = { delete = true },
|
bsw@1045
|
311 routing = {
|
bsw@1045
|
312 default = {
|
bsw@1045
|
313 mode = "redirect",
|
bsw@1045
|
314 module = request.get_module(),
|
bsw@1045
|
315 view = request.get_view(),
|
bsw@1045
|
316 id = param.get_id_cgi(),
|
bsw@1045
|
317 params = param.get_all_cgi()
|
bsw@1045
|
318 }
|
bsw@1045
|
319 }
|
bsw@1045
|
320 }
|
bsw@1045
|
321 end }
|
bsw@1045
|
322 end }
|
bsw@1045
|
323 end
|
bsw@1045
|
324 end )
|
bsw@1045
|
325 end
|
bsw@1045
|
326 end ) |