bsw@211: local issue = param.get("issue", "table") bsw@211: local hide = param.get("hide", "table") or {} bsw@211: bsw@211: local interest = issue.interest bsw@211: bsw@211: local delegations = issue.delegations bsw@211: bsw@211: local global_delegation bsw@211: local area_delegation bsw@211: local issue_delegation bsw@211: bsw@211: for i, delegation in ipairs(issue.delegations) do bsw@211: if delegation.scope == "global" then global_delegation = delegation bsw@211: elseif delegation.scope == "area" then area_delegation = delegation bsw@211: elseif delegation.scope == "issue" then issue_delegation = delegation bsw@211: end bsw@211: end bsw@211: bsw@211: local delegation = issue_delegation or area_delegation or global_delegation bsw@211: bsw@211: local delegating_interest = issue.delegating_interest bsw@211: bsw@211: ui.box{ class = "issue", content = function() bsw@211: bsw@211: ui.box_row{ class = "issue_id", content = function() ui.box_col{ content = function() bsw@211: ui.link{ bsw@211: module = "lf2", view = "issue", id = issue.id, bsw@211: content = _("Issue ##{id}", { id = issue.id }) bsw@211: } bsw@211: end } end } bsw@211: bsw@211: if not hide.unit then bsw@211: ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function() bsw@211: ui.link{ bsw@211: module = "lf2", view = "unit", id = 1, bsw@211: content = "DE / Berlin / Friedrichshain-Kreuzberg" bsw@211: } bsw@211: end } end } bsw@211: end bsw@211: bsw@211: if not hide.area then bsw@211: ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function() bsw@211: ui.link{ bsw@211: module = "lf2", view = "area", id = issue.area_id, bsw@211: content = issue.area.name bsw@211: } bsw@211: end } end } bsw@211: end bsw@211: bsw@211: bsw@211: ui.box_row{ class = "interest", content = function() bsw@211: if interest then bsw@211: ui.container{ attr = { title = _"You are interested in this issue" }, content = function() bsw@211: ui.image{ static = "lf2/icon_star.png" } bsw@211: end } bsw@211: elseif delegating_interest then bsw@211: ui.container{ attr = { class = "interest", title = _"You are interested in this issue by delegation" }, content = function() bsw@211: ui.image{ static = "lf2/icon_delegated_star.png" } bsw@211: slot.put(delegating_interest.trustee_member_id) bsw@211: end } bsw@211: else bsw@211: end bsw@211: end } bsw@211: bsw@211: ui.box_row{ class = "delegation", content = function() bsw@211: if delegation then bsw@211: ui.box_col{ content = function() bsw@211: execute.view{ module = "lf2", view = "_avatars", params = { members = { app.session.member, delegation.trustee }, arrows = true, hidefirst = true } } bsw@211: end } bsw@211: else bsw@211: end bsw@211: end } bsw@211: bsw@211: end } bsw@211: bsw@211: 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 }) } bsw@211: