liquid_feedback_frontend

diff app/main/lf2/_issues_issue.lua @ 211:4993b71b383f

First checkin of lf2 (frontend second generation) prototype
author bsw
date Wed Mar 02 20:06:26 2011 +0100 (2011-03-02)
parents
children 4f6e6b213fb8
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/app/main/lf2/_issues_issue.lua	Wed Mar 02 20:06:26 2011 +0100
     1.3 @@ -0,0 +1,77 @@
     1.4 +local issue = param.get("issue", "table")
     1.5 +local hide = param.get("hide", "table") or {}
     1.6 +
     1.7 +local interest = issue.interest
     1.8 +
     1.9 +local delegations = issue.delegations
    1.10 +
    1.11 +local global_delegation
    1.12 +local area_delegation
    1.13 +local issue_delegation
    1.14 +
    1.15 +for i, delegation in ipairs(issue.delegations) do
    1.16 +  if delegation.scope == "global" then global_delegation = delegation
    1.17 +  elseif delegation.scope == "area" then area_delegation = delegation
    1.18 +  elseif delegation.scope == "issue" then issue_delegation = delegation
    1.19 +  end
    1.20 +end
    1.21 +
    1.22 +local delegation = issue_delegation or area_delegation or global_delegation
    1.23 +
    1.24 +local delegating_interest = issue.delegating_interest
    1.25 +
    1.26 +ui.box{ class = "issue", content = function()
    1.27 +
    1.28 +  ui.box_row{ class = "issue_id", content = function() ui.box_col{ content = function()
    1.29 +    ui.link{
    1.30 +      module = "lf2", view = "issue", id = issue.id,
    1.31 +      content = _("Issue ##{id}", { id = issue.id })
    1.32 +    }
    1.33 +  end } end }
    1.34 +
    1.35 +  if not hide.unit then
    1.36 +    ui.box_row{ class = "unit_name", content = function() ui.box_col{ content = function()
    1.37 +      ui.link{ 
    1.38 +        module = "lf2", view = "unit", id = 1,
    1.39 +        content = "DE / Berlin / Friedrichshain-Kreuzberg" 
    1.40 +      }
    1.41 +    end } end }
    1.42 +  end
    1.43 +
    1.44 +  if not hide.area then
    1.45 +    ui.box_row{ class = "area_name", content = function() ui.box_col{ content = function()
    1.46 +      ui.link{
    1.47 +        module = "lf2", view = "area", id = issue.area_id,
    1.48 +        content = issue.area.name
    1.49 +      }
    1.50 +    end } end }
    1.51 +  end
    1.52 +  
    1.53 +
    1.54 +  ui.box_row{ class = "interest", content = function()
    1.55 +    if interest then
    1.56 +      ui.container{ attr = { title = _"You are interested in this issue" }, content = function() 
    1.57 +        ui.image{ static = "lf2/icon_star.png" }
    1.58 +      end  }
    1.59 +    elseif delegating_interest then
    1.60 +      ui.container{ attr = { class = "interest", title = _"You are interested in this issue by delegation" }, content = function() 
    1.61 +        ui.image{ static = "lf2/icon_delegated_star.png" }
    1.62 +        slot.put(delegating_interest.trustee_member_id)
    1.63 +      end  }
    1.64 +    else
    1.65 +    end
    1.66 +  end }
    1.67 +
    1.68 +  ui.box_row{ class = "delegation", content = function()
    1.69 +    if delegation then
    1.70 +      ui.box_col{ content = function() 
    1.71 +        execute.view{ module = "lf2", view = "_avatars", params = { members = { app.session.member, delegation.trustee }, arrows = true, hidefirst = true } }
    1.72 +      end }
    1.73 +    else
    1.74 +    end
    1.75 +  end }
    1.76 +
    1.77 +end }
    1.78 +  
    1.79 +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 }) }
    1.80 +

Impressum / About Us