Commits

Daniel Poelzleithner  committed 1652c4c

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

  • Participants
  • Parent commits eaf3db8

Comments (0)

Files changed (2)

File app/main/member/show_tab.lua

     }
   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" })

File static/style.css

   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
  */