activity: Add view to see the ledger entries for a customer plan.

Adds a link to the plan ledger view in the current plan information
shown in the support views. Link is not shown if the plan is 100%
sponsored, e.g., the Community plan.

Adds a formatted header area to the activity table template so
that it's easy to add useful information to these activity views.
This commit is contained in:
Lauryn Menard
2024-08-28 16:27:10 +02:00
committed by Tim Abbott
parent 704423787b
commit d54ca85de2
8 changed files with 102 additions and 1 deletions

View File

@@ -42,11 +42,18 @@ class RemoteActivityPlanData:
rate: str
@dataclass
class ActivityHeaderEntry:
name: str
value: str | Markup
def make_table(
title: str,
cols: Sequence[str],
rows: Sequence[Any],
*,
header: list[ActivityHeaderEntry] | None = None,
totals: Any | None = None,
stats_link: Markup | None = None,
has_row_class: bool = False,
@@ -58,7 +65,9 @@ def make_table(
rows = list(map(fix_row, rows))
data = dict(title=title, cols=cols, rows=rows, totals=totals, stats_link=stats_link)
data = dict(
title=title, cols=cols, rows=rows, header=header, totals=totals, stats_link=stats_link
)
content = loader.render_to_string(
"corporate/activity/activity_table.html",