diff --git a/core/views/ui/tables.py b/core/views/ui/tables.py index c1fbcff..d5c8b30 100644 --- a/core/views/ui/tables.py +++ b/core/views/ui/tables.py @@ -1,5 +1,27 @@ from django.conf import settings from django_tables2 import Column, Table +from django_tables2.columns.base import BoundColumn + +# Make the table column headings lowercase +orig_Column_header = BoundColumn.header + + +@property +def lower_header(self): + header = orig_Column_header.__get__(self) + header = header.lower() + header = header.title() + if header != "Ident": + header = header.replace("Id", "ID") + header = header.replace("id", "ID") + if header == "Ts": + header = "TS" + header = header.replace("Nsfw", "NSFW") + + return header + + +BoundColumn.header = lower_header class DrilldownTable(Table):