liquid_feedback_frontend

view app/main/delegation/_list.lua @ 1122:9ba82d3a9445

Added missing arrow to title when showing member sub pages
author bsw
date Wed Dec 24 12:05:28 2014 +0100 (2014-12-24)
parents 701a5cf6b067
children c87cc80b7904
line source
1 local delegations_selector = param.get("delegations_selector", "table")
2 local outgoing = param.get("outgoing", atom.boolean)
3 local incoming = param.get("incoming", atom.boolean)
5 local function delegation_scope(delegation)
6 ui.tag{
7 attr = { class = "delegation_scope" },
8 content = function()
9 local area
10 local unit
11 if delegation.issue then
12 area = delegation.issue.area
13 unit = area.unit
14 elseif delegation.area then
15 area = delegation.area
16 unit = area.unit
17 else
18 unit = delegation.unit
19 end
20 slot.put("<br style='clear: left;' />")
21 ui.heading { attr = { style = "float: left;" }, level = 3, content = function()
22 ui.link{
23 content = unit.name,
24 module = "unit",
25 view = "show",
26 id = unit.id
27 }
28 if area then
29 slot.put(" &middot; ")
30 ui.link{
31 content = area.name,
32 module = "area",
33 view = "show",
34 id = area.id
35 }
36 end
37 if delegation.issue then
38 slot.put(" &middot; ")
39 ui.link{
40 content = delegation.issue.name,
41 module = "issue",
42 view = "show",
43 id = delegation.issue.id
44 }
45 end
46 end }
47 end
48 }
49 end
52 --ui.paginate{
53 -- selector = delegations_selector,
54 -- name = incoming and "delegation_incoming" or "delegation_outgoing",
55 -- content = function()
56 local last_scope = {}
57 for i, delegation in ipairs(delegations_selector:exec()) do
58 if last_scope.unit_id ~= delegation.unit_id
59 or last_scope.area_id ~= delegation.area_id
60 or last_scope.issue_id ~= delegation.issue_id
61 then
62 last_scope.unit_id = delegation.unit_id
63 last_scope.area_id = delegation.area_id
64 last_scope.issue_id = delegation.issue_id
65 delegation_scope(delegation)
66 end
67 if incoming then
68 execute.view{ module = "member_image", view = "_show", params = {
69 member_id = delegation.truster_id, class = "micro_avatar", popup_text = delegation.truster.name,
70 image_type = "avatar", show_dummy = true,
71 } }
72 elseif delegation.trustee then
73 ui.image{
74 attr = { class = "delegation_arrow" },
75 static = "delegation_arrow_24_horizontal.png"
76 }
77 execute.view{ module = "member_image", view = "_show", params = {
78 member_id = delegation.trustee_id, class = "micro_avatar", popup_text = delegation.trustee.name,
79 image_type = "avatar", show_dummy = true,
80 } }
81 else
82 ui.tag{ content = _"Delegation abandoned" }
83 end
84 end
85 -- end
86 --}

Impressum / About Us