liquid_feedback_frontend
diff app/main/issue/_show.lua @ 862:a1ff5d08f0f4
Displays correct avatar when showing delegation chain preview for other member
author | bsw |
---|---|
date | Fri Aug 17 19:54:41 2012 +0200 (2012-08-17) |
parents | fda70d12e695 |
children | 4ab1e6f5f039 |
line diff
1.1 --- a/app/main/issue/_show.lua Fri Aug 17 19:51:40 2012 +0200 1.2 +++ b/app/main/issue/_show.lua Fri Aug 17 19:54:41 2012 +0200 1.3 @@ -1,5 +1,6 @@ 1.4 local issue = param.get("issue", "table") 1.5 local initiative_limit = param.get("initiative_limit", atom.integer) 1.6 +local for_member = param.get("for_member", "table") 1.7 local for_listing = param.get("for_listing", atom.boolean) 1.8 local for_initiative = param.get("for_initiative", "table") 1.9 local for_initiative_id = for_initiative and for_initiative.id or nil 1.10 @@ -24,7 +25,7 @@ 1.11 1.12 ui.container{ attr = { class = class }, content = function() 1.13 1.14 - execute.view{ module = "delegation", view = "_info", params = { issue = issue } } 1.15 + execute.view{ module = "delegation", view = "_info", params = { issue = issue, member = for_member } } 1.16 1.17 if for_listing then 1.18 ui.container{ attr = { class = "content" }, content = function() 1.19 @@ -83,15 +84,17 @@ 1.20 1.21 local links = {} 1.22 1.23 - if voteable then 1.24 - links[#links+1] ={ 1.25 - content = vote_link_text, 1.26 - module = "vote", 1.27 - view = "list", 1.28 - params = { issue_id = issue.id } 1.29 - } 1.30 - end 1.31 + if voteable then 1.32 + links[#links+1] ={ 1.33 + content = vote_link_text, 1.34 + module = "vote", 1.35 + view = "list", 1.36 + params = { issue_id = issue.id } 1.37 + } 1.38 + end 1.39 1.40 + if not for_member or for_member.id == app.session.member_id then 1.41 + 1.42 if app.session.member_id then 1.43 1.44 if issue.member_info.own_participation then 1.45 @@ -138,13 +141,13 @@ 1.46 } 1.47 end 1.48 end 1.49 - end 1.50 1.51 - if not issue.closed and app.session.member_id and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then 1.52 - if issue.member_info.own_delegation_scope ~= "issue" then 1.53 - links[#links+1] = { text = _"Delegate issue", module = "delegation", view = "show", params = { issue_id = issue.id, initiative_id = for_initiative_id } } 1.54 - else 1.55 - links[#links+1] = { text = _"Change issue delegation", module = "delegation", view = "show", params = { issue_id = issue.id, initiative_id = for_initiative_id } } 1.56 + if not issue.closed and app.session.member:has_voting_right_for_unit_id(issue.area.unit_id) then 1.57 + if issue.member_info.own_delegation_scope ~= "issue" then 1.58 + links[#links+1] = { text = _"Delegate issue", module = "delegation", view = "show", params = { issue_id = issue.id, initiative_id = for_initiative_id } } 1.59 + else 1.60 + links[#links+1] = { text = _"Change issue delegation", module = "delegation", view = "show", params = { issue_id = issue.id, initiative_id = for_initiative_id } } 1.61 + end 1.62 end 1.63 end 1.64 1.65 @@ -178,6 +181,8 @@ 1.66 end 1.67 end 1.68 1.69 + end 1.70 + 1.71 ui.container{ attr = { class = "content actions" }, content = function() 1.72 for i, link in ipairs(links) do 1.73 if link.in_brackets then