| rev | 
   line source | 
| 
bsw@211
 | 
     1 local issue = param.get("issue", "table")
 | 
| 
bsw@211
 | 
     2 local hide = param.get("hide", "table") or {}
 | 
| 
bsw@211
 | 
     3 
 | 
| 
bsw@211
 | 
     4 local interest = issue.interest
 | 
| 
bsw@211
 | 
     5 
 | 
| 
bsw@211
 | 
     6 local delegations = issue.delegations
 | 
| 
bsw@211
 | 
     7 
 | 
| 
bsw@211
 | 
     8 local global_delegation
 | 
| 
bsw@211
 | 
     9 local area_delegation
 | 
| 
bsw@211
 | 
    10 local issue_delegation
 | 
| 
bsw@211
 | 
    11 
 | 
| 
bsw@211
 | 
    12 for i, delegation in ipairs(issue.delegations) do
 | 
| 
bsw@211
 | 
    13   if delegation.scope == "global" then global_delegation = delegation
 | 
| 
bsw@211
 | 
    14   elseif delegation.scope == "area" then area_delegation = delegation
 | 
| 
bsw@211
 | 
    15   elseif delegation.scope == "issue" then issue_delegation = delegation
 | 
| 
bsw@211
 | 
    16   end
 | 
| 
bsw@211
 | 
    17 end
 | 
| 
bsw@211
 | 
    18 
 | 
| 
bsw@211
 | 
    19 local delegation = issue_delegation or area_delegation or global_delegation
 | 
| 
bsw@211
 | 
    20 
 | 
| 
bsw@211
 | 
    21 local delegating_interest = issue.delegating_interest
 | 
| 
bsw@211
 | 
    22 
 | 
| 
bsw@211
 | 
    23 ui.box{ class = "issue", content = function()
 | 
| 
bsw@211
 | 
    24 
 | 
| 
bsw@211
 | 
    25   ui.box_row{ class = "issue_id", content = function() ui.box_col{ content = function()
 | 
| 
bsw@211
 | 
    26     ui.link{
 | 
| 
bsw@211
 | 
    27       module = "lf2", view = "issue", id = issue.id,
 | 
| 
bsw@211
 | 
    28       content = _("Issue ##{id}", { id = issue.id })
 | 
| 
bsw@211
 | 
    29     }
 | 
| 
bsw@211
 | 
    30   end } end }
 | 
| 
bsw@211
 | 
    31 
 | 
| 
bsw@211
 | 
    32   if not hide.unit then
 | 
| 
bsw@211
 | 
    33     ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function()
 | 
| 
bsw@211
 | 
    34       ui.link{ 
 | 
| 
bsw@211
 | 
    35         module = "lf2", view = "unit", id = 1,
 | 
| 
bsw@211
 | 
    36         content = "DE / Berlin / Friedrichshain-Kreuzberg" 
 | 
| 
bsw@211
 | 
    37       }
 | 
| 
bsw@211
 | 
    38     end } end }
 | 
| 
bsw@211
 | 
    39   end
 | 
| 
bsw@211
 | 
    40 
 | 
| 
bsw@211
 | 
    41   if not hide.area then
 | 
| 
bsw@211
 | 
    42     ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function()
 | 
| 
bsw@211
 | 
    43       ui.link{
 | 
| 
bsw@211
 | 
    44         module = "lf2", view = "area", id = issue.area_id,
 | 
| 
bsw@211
 | 
    45         content = issue.area.name
 | 
| 
bsw@211
 | 
    46       }
 | 
| 
bsw@211
 | 
    47     end } end }
 | 
| 
bsw@211
 | 
    48   end
 | 
| 
bsw@211
 | 
    49   
 | 
| 
bsw@211
 | 
    50 
 | 
| 
bsw@211
 | 
    51   ui.box_row{ class = "interest", content = function()
 | 
| 
bsw@211
 | 
    52     if interest then
 | 
| 
bsw@211
 | 
    53       ui.container{ attr = { title = _"You are interested in this issue" }, content = function() 
 | 
| 
bsw@211
 | 
    54         ui.image{ static = "lf2/icon_star.png" }
 | 
| 
bsw@211
 | 
    55       end  }
 | 
| 
bsw@211
 | 
    56     elseif delegating_interest then
 | 
| 
bsw@211
 | 
    57       ui.container{ attr = { class = "interest", title = _"You are interested in this issue by delegation" }, content = function() 
 | 
| 
bsw@211
 | 
    58         ui.image{ static = "lf2/icon_delegated_star.png" }
 | 
| 
bsw@211
 | 
    59         slot.put(delegating_interest.trustee_member_id)
 | 
| 
bsw@211
 | 
    60       end  }
 | 
| 
bsw@211
 | 
    61     else
 | 
| 
bsw@211
 | 
    62     end
 | 
| 
bsw@211
 | 
    63   end }
 | 
| 
bsw@211
 | 
    64 
 | 
| 
bsw@211
 | 
    65   ui.box_row{ class = "delegation", content = function()
 | 
| 
bsw@211
 | 
    66     if delegation then
 | 
| 
bsw@211
 | 
    67       ui.box_col{ content = function() 
 | 
| 
bsw@216
 | 
    68         execute.view{ module = "lf2", view = "_avatars", params = { members = { app.session.member, delegation.trustee }, arrows = true, hidefirst = true, issue_id = issue.id } }
 | 
| 
bsw@211
 | 
    69       end }
 | 
| 
bsw@211
 | 
    70     else
 | 
| 
bsw@211
 | 
    71     end
 | 
| 
bsw@211
 | 
    72   end }
 | 
| 
bsw@211
 | 
    73 
 | 
| 
bsw@211
 | 
    74 end }
 | 
| 
bsw@211
 | 
    75   
 | 
| 
bsw@211
 | 
    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 }) }
 | 
| 
bsw@211
 | 
    77 
 |