liquid_feedback_frontend
view app/main/lf2/_issues_issue.lua @ 212:3e4ad069847a
Some more work at 2nd generation frontend code
author | bsw |
---|---|
date | Thu Mar 03 18:39:00 2011 +0100 (2011-03-03) |
parents | 4993b71b383f |
children | 4f6e6b213fb8 |
line source
1 local issue = param.get("issue", "table")
2 local hide = param.get("hide", "table") or {}
4 local interest = issue.interest
6 local delegations = issue.delegations
8 local global_delegation
9 local area_delegation
10 local issue_delegation
12 for i, delegation in ipairs(issue.delegations) do
13 if delegation.scope == "global" then global_delegation = delegation
14 elseif delegation.scope == "area" then area_delegation = delegation
15 elseif delegation.scope == "issue" then issue_delegation = delegation
16 end
17 end
19 local delegation = issue_delegation or area_delegation or global_delegation
21 local delegating_interest = issue.delegating_interest
23 ui.box{ class = "issue", content = function()
25 ui.box_row{ class = "issue_id", content = function() ui.box_col{ content = function()
26 ui.link{
27 module = "lf2", view = "issue", id = issue.id,
28 content = _("Issue ##{id}", { id = issue.id })
29 }
30 end } end }
32 if not hide.unit then
33 ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function()
34 ui.link{
35 module = "lf2", view = "unit", id = 1,
36 content = "DE / Berlin / Friedrichshain-Kreuzberg"
37 }
38 end } end }
39 end
41 if not hide.area then
42 ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function()
43 ui.link{
44 module = "lf2", view = "area", id = issue.area_id,
45 content = issue.area.name
46 }
47 end } end }
48 end
51 ui.box_row{ class = "interest", content = function()
52 if interest then
53 ui.container{ attr = { title = _"You are interested in this issue" }, content = function()
54 ui.image{ static = "lf2/icon_star.png" }
55 end }
56 elseif delegating_interest then
57 ui.container{ attr = { class = "interest", title = _"You are interested in this issue by delegation" }, content = function()
58 ui.image{ static = "lf2/icon_delegated_star.png" }
59 slot.put(delegating_interest.trustee_member_id)
60 end }
61 else
62 end
63 end }
65 ui.box_row{ class = "delegation", content = function()
66 if delegation then
67 ui.box_col{ content = function()
68 execute.view{ module = "lf2", view = "_avatars", params = { members = { app.session.member, delegation.trustee }, arrows = true, hidefirst = true } }
69 end }
70 else
71 end
72 end }
74 end }
76 ui.box_col{ class = "time_left", content = issue.closed and _("Closed since #{date}", { date = format.date(issue.closed.date) }) or _("#{time_left} left", { time_left = issue.state_time_left }) }