# HG changeset patch # User Daniel Poelzleithner # Date 1286508254 -7200 # Node ID 1652c4cd3154a69a088845c543ff8781988d7dd6 # Parent eaf3db89a6e1a020d2b1d10f5f65eca6787c7781 add broken delegations tab on homepage if a user has delegations to an inactive account, a new red tab will apear on the homepage of the user listing his broken delegations diff -r eaf3db89a6e1 -r 1652c4cd3154 app/main/member/show_tab.lua --- a/app/main/member/show_tab.lua Fri Oct 08 04:29:20 2010 +0200 +++ b/app/main/member/show_tab.lua Fri Oct 08 05:24:14 2010 +0200 @@ -43,6 +43,22 @@ } end + local broken_delegations = Delegation:new_selector() + :join("member", nil, "delegation.trustee_id = member.id") + :add_where{"member.active = 'f' AND delegation.truster_id = ?", member.id} + + if broken_delegations:count() then + tabs[#tabs+1] = { + class = "red", + name = "problem_delegations", + label = _"Delegation problems" .. " (" .. tostring(broken_delegations:count()) .. ")", + icon = { static = "icons/16/table_go.png" }, + module = "delegation", + view = "_list", + params = { delegations_selector = broken_delegations, outgoing = true }, + } + end + local selector = Area:new_selector() :reset_fields() :add_field("area.id", nil, { "grouped" }) diff -r eaf3db89a6e1 -r 1652c4cd3154 static/style.css --- a/static/style.css Fri Oct 08 04:29:20 2010 +0200 +++ b/static/style.css Fri Oct 08 05:24:14 2010 +0200 @@ -563,6 +563,34 @@ border-color: #b96; } +.ui_tabs_links a.red { + background-color: #c33; + color: #000; +} + +.ui_tabs_links a.red:hover { + background-color: #ebb; +} + +.ui_tabs_links a.red.selected { + background-color: #644; + color: #fff; + text-decoration: none; + padding: 1ex; +} + +.web20 .ui_tabs_accordeon_head.red { + background-color: #c23; + border-color: #b66; + xpadding: 1ex; + xmargin-bottom: 2ex; +} + +.web20 .ui_tabs_accordeon_content.red { + border-color: #b66; +} + + /************************************************************************* * ui.filters */