annotate app/main/member/history.lua @ 1214:5c1e3b23170a
Fixed error when display profile page publically
author |
bsw |
date |
Mon Jul 27 23:27:00 2015 +0200 (2015-07-27) |
parents |
701a5cf6b067 |
children |
32cc544d5a5b |
rev |
line source |
bsw@9
|
1 local member = Member:by_id(param.get_id())
|
bsw@9
|
2
|
bsw@1045
|
3 ui.titleMember(member)
|
bsw@1045
|
4
|
bsw@1045
|
5 ui.section( function()
|
bsw@1045
|
6
|
bsw@1045
|
7 ui.sectionHead( function()
|
bsw@1045
|
8 ui.heading{ level = 1, content = _"Account history" }
|
bsw@1045
|
9 end)
|
bsw@1045
|
10
|
bsw@1045
|
11 ui.sectionRow( function()
|
bsw@1045
|
12 ui.form{
|
bsw@1045
|
13 attr = { class = "vertical" },
|
bsw@564
|
14 content = function()
|
bsw@1045
|
15 ui.field.text{ label = _"Current name", value = member.name }
|
bsw@1045
|
16 ui.field.text{ label = _"Current status", value = member.active and _'activated' or _'deactivated' }
|
bsw@1045
|
17 end
|
bsw@564
|
18 }
|
bsw@77
|
19
|
bsw@77
|
20
|
bsw@1045
|
21 local entries = member:get_reference_selector("history_entries"):add_order_by("id DESC"):exec()
|
bsw@1045
|
22
|
bsw@1045
|
23 if #entries > 0 then
|
bsw@77
|
24 ui.tag{
|
bsw@1045
|
25 tag = "table",
|
bsw@77
|
26 content = function()
|
bsw@77
|
27 ui.tag{
|
bsw@1045
|
28 tag = "tr",
|
bsw@1045
|
29 content = function()
|
bsw@1045
|
30 ui.tag{
|
bsw@1045
|
31 tag = "th",
|
bsw@1045
|
32 content = _("Name")
|
bsw@1045
|
33 }
|
bsw@1045
|
34 ui.tag{
|
bsw@1045
|
35 tag = "th",
|
bsw@1045
|
36 content = _("Status")
|
bsw@1045
|
37 }
|
bsw@1045
|
38 ui.tag{
|
bsw@1045
|
39 tag = "th",
|
bsw@1045
|
40 content = _("until")
|
bsw@1045
|
41 }
|
bsw@1045
|
42 end
|
bsw@77
|
43 }
|
bsw@1045
|
44 for i, entry in ipairs(entries) do
|
bsw@1045
|
45 ui.tag{
|
bsw@1045
|
46 tag = "tr",
|
bsw@1045
|
47 content = function()
|
bsw@1045
|
48 ui.tag{
|
bsw@1045
|
49 tag = "td",
|
bsw@1045
|
50 content = entry.name
|
bsw@1045
|
51 }
|
bsw@1045
|
52 ui.tag{
|
bsw@1045
|
53 tag = "td",
|
bsw@1045
|
54 content = entry.active and _'activated' or _'deactivated',
|
bsw@1045
|
55 }
|
bsw@1045
|
56 ui.tag{
|
bsw@1045
|
57 tag = "td",
|
bsw@1045
|
58 content = format.timestamp(entry["until"])
|
bsw@1045
|
59 }
|
bsw@1045
|
60 end
|
bsw@1045
|
61 }
|
bsw@1045
|
62 end
|
bsw@9
|
63 end
|
bsw@77
|
64 }
|
bsw@9
|
65 end
|
bsw@1045
|
66 slot.put("<br />")
|
bsw@1045
|
67 ui.container{
|
bsw@1045
|
68 content = _("This member account has been created at #{created}", { created = format.timestamp(member.activated)})
|
bsw@1045
|
69 }
|
bsw@1045
|
70 end)
|
bsw@1045
|
71
|
bsw@1045
|
72 end) |