Table filters

* adds table filtering for InterventionTable
* adds default ordering
* moves user-access filtering from view to InterventionTableFiler
* adds generic render_icn method for BaseTable (for usage with fontawesome5)
* adds translations
* improves table.html template
This commit is contained in:
mipel
2021-07-22 10:00:59 +02:00
parent 117c740bad
commit 591bc739ec
8 changed files with 228 additions and 29 deletions

View File

@@ -37,6 +37,10 @@ Declare some basic colours
color:var(--rlp-red);
}
.rlp-r-inv{
color:var(--rlp-red);
}
html {
position: relative;
min-height: 100%;

View File

@@ -126,6 +126,16 @@ class BaseTable(tables.tables.Table):
icon
)
def render_icn(self, tooltip: str = None, icn_class: str = None):
"""
Returns a rendered fontawesome icon
"""
return format_html(
"<em title='{}' class='{}'></em>",
tooltip,
icn_class,
)
class ChoicesColumnForm(BaseForm):
select = forms.ChoiceField(