# HG changeset patch # User bsw # Date 1340921203 -7200 # Node ID 9d4398195faff98ca0733f15c749ef272e962df1 # Parent 2bbddf7f1e1a4d3ba37453c83b32a563ade36466 Removed link from delegation infos for other members diff -r 2bbddf7f1e1a -r 9d4398195faf app/main/delegation/_info.lua --- a/app/main/delegation/_info.lua Fri Jun 29 00:03:03 2012 +0200 +++ b/app/main/delegation/_info.lua Fri Jun 29 00:06:43 2012 +0200 @@ -31,58 +31,111 @@ delegation_text = _"Delegate issue" end -if info.own_participation or info.first_trustee_id then +local function print_delegation_info() + local participant_occured = false + + if info.own_participation or info.first_trustee_id then + + local class = "micro_avatar" + if info.own_participation then + participant_occured = true + class = class .. " highlighted" + end + + execute.view{ module = "member_image", view = "_show", params = { + member = member, class = class, popup_text = member.name, + image_type = "avatar", show_dummy = true, + } } - ui.link{ - module = "delegation", view = "show", params = { - unit_id = unit_id, - area_id = area_id, - issue_id = issue_id - }, - attr = { class = "delegation_info" }, content = function() - + end - local participant_occured = false + if not (issue and issue.state == "voting" and info.own_participation) then + + if info.first_trustee_id then + + local text = _"delegates to" + ui.image{ + attr = { class = "delegation_arrow", alt = text, title = text }, + static = "delegation_arrow_24_horizontal.png" + } + + local class = "micro_avatar" + if not participant_occured and info.first_trustee_participation then + participant_occured = true + class = class .. " highlighted" + end - if info.own_participation or info.first_trustee_id then - - local class = "micro_avatar" - if info.own_participation then - participant_occured = true - class = class .. " highlighted" - end - - execute.view{ module = "member_image", view = "_show", params = { - member = member, class = class, popup_text = member.name, - image_type = "avatar", show_dummy = true, - } } + execute.view{ module = "member_image", view = "_show", params = { + member_id = info.first_trustee_id, class = class, popup_text = info.first_trustee_name, + image_type = "avatar", show_dummy = true, + } } + + end + + if info.first_trustee_ellipsis then + + local text = _"delegates to" + ui.image{ + attr = { class = "delegation_arrow", alt = text, title = text }, + static = "delegation_arrow_24_horizontal.png" + } - end + slot.put("...") + + end + + if info.other_trustee_id then + + local text = _"delegates to" + ui.image{ + attr = { class = "delegation_arrow", alt = text, title = text }, + static = "delegation_arrow_24_horizontal.png" + } - if not (issue and issue.state == "voting" and info.own_participation) then - - if info.first_trustee_id then - - local text = _"delegates to" - ui.image{ - attr = { class = "delegation_arrow", alt = text, title = text }, - static = "delegation_arrow_24_horizontal.png" - } + local class = "micro_avatar" + if not participant_occured and info.other_trustee_participation then + participant_occured = true + class = class .. " highlighted" + end + + execute.view{ module = "member_image", view = "_show", params = { + member_id = info.other_trustee_id, class = class, popup_text = info.other_trustee_name, + image_type = "avatar", show_dummy = true, + } } + + end + + if info.other_trustee_ellipsis then - local class = "micro_avatar" - if not participant_occured and info.first_trustee_participation then - participant_occured = true - class = class .. " highlighted" - end - - execute.view{ module = "member_image", view = "_show", params = { - member_id = info.first_trustee_id, class = class, popup_text = info.first_trustee_name, - image_type = "avatar", show_dummy = true, - } } + local text = _"delegates to" + ui.image{ + attr = { class = "delegation_arrow", alt = text, title = text }, + static = "delegation_arrow_24_horizontal.png" + } - end - - if info.first_trustee_ellipsis then + slot.put("...") + + end + + local trailing_ellipsis = info.other_trustee_ellipsis or + (info.first_trustee_ellipsis and not info.other_trustee_id) + + if info.delegation_loop == "own" then + + local text = _"delegates to" + ui.image{ + attr = { class = "delegation_arrow", alt = text, title = text }, + static = "delegation_arrow_24_horizontal.png" + } + + execute.view{ module = "member_image", view = "_show", params = { + member = member, class = "micro_avatar", popup_text = member.name, + image_type = "avatar", show_dummy = true, + } } + + elseif info.delegation_loop == "first" then + if info.first_trustee_ellipsis then + if not trailing_ellipsis then local text = _"delegates to" ui.image{ @@ -91,100 +144,54 @@ } slot.put("...") + end - end - - if info.other_trustee_id then - - local text = _"delegates to" - ui.image{ - attr = { class = "delegation_arrow", alt = text, title = text }, - static = "delegation_arrow_24_horizontal.png" - } - - local class = "micro_avatar" - if not participant_occured and info.other_trustee_participation then - participant_occured = true - class = class .. " highlighted" - end + else - execute.view{ module = "member_image", view = "_show", params = { - member_id = info.other_trustee_id, class = class, popup_text = info.other_trustee_name, - image_type = "avatar", show_dummy = true, - } } + local text = _"delegates to" + ui.image{ + attr = { class = "delegation_arrow", alt = text, title = text }, + static = "delegation_arrow_24_horizontal.png" + } - end - - if info.other_trustee_ellipsis then - - local text = _"delegates to" - ui.image{ - attr = { class = "delegation_arrow", alt = text, title = text }, - static = "delegation_arrow_24_horizontal.png" - } - - slot.put("...") - - end + execute.view{ module = "member_image", view = "_show", params = { + member_id = info.first_trustee_id, class = "micro_avatar", popup_text = info.first_trustee_name, + image_type = "avatar", show_dummy = true, + } } + end + - local trailing_ellipsis = info.other_trustee_ellipsis or - (info.first_trustee_ellipsis and not info.other_trustee_id) - - if info.delegation_loop == "own" then - - local text = _"delegates to" - ui.image{ - attr = { class = "delegation_arrow", alt = text, title = text }, - static = "delegation_arrow_24_horizontal.png" - } + elseif info.delegation_loop and not trailing_ellipsis then + local text = _"delegates to" + ui.image{ + attr = { class = "delegation_arrow", alt = text, title = text }, + static = "delegation_arrow_24_horizontal.png" + } - execute.view{ module = "member_image", view = "_show", params = { - member = member, class = "micro_avatar", popup_text = member.name, - image_type = "avatar", show_dummy = true, - } } + slot.put("...") + end - elseif info.delegation_loop == "first" then - if info.first_trustee_ellipsis then - if not trailing_ellipsis then + end +end - local text = _"delegates to" - ui.image{ - attr = { class = "delegation_arrow", alt = text, title = text }, - static = "delegation_arrow_24_horizontal.png" - } - slot.put("...") - end - - else - - local text = _"delegates to" - ui.image{ - attr = { class = "delegation_arrow", alt = text, title = text }, - static = "delegation_arrow_24_horizontal.png" - } - - execute.view{ module = "member_image", view = "_show", params = { - member_id = info.first_trustee_id, class = "micro_avatar", popup_text = info.first_trustee_name, - image_type = "avatar", show_dummy = true, - } } - end - - - elseif info.delegation_loop and not trailing_ellipsis then - local text = _"delegates to" - ui.image{ - attr = { class = "delegation_arrow", alt = text, title = text }, - static = "delegation_arrow_24_horizontal.png" - } - - slot.put("...") - end - +if info.own_participation or info.first_trustee_id then + if app.session.member_id == member.id then + ui.link{ + module = "delegation", view = "show", params = { + unit_id = unit_id, + area_id = area_id, + issue_id = issue_id + }, + attr = { class = "delegation_info" }, content = function() + print_delegation_info() end - - end - - } - + } + else + ui.container{ + attr = { class = "delegation_info" }, content = function() + print_delegation_info() + end + } + end end diff -r 2bbddf7f1e1a -r 9d4398195faf static/style.css --- a/static/style.css Fri Jun 29 00:03:03 2012 +0200 +++ b/static/style.css Fri Jun 29 00:06:43 2012 +0200 @@ -502,7 +502,7 @@ color: #aaa; } -.delegation_info:hover { +a.delegation_info:hover { background-color: #ddd; }