mirror of
https://gitlab.crans.org/bde/nk20
synced 2025-06-22 02:18:21 +02:00
Add teams
This commit is contained in:
@ -107,18 +107,22 @@ class BusTeamTable(tables.Table):
|
||||
color = tables.Column(
|
||||
attrs={
|
||||
"td": {
|
||||
"style": lambda record: "background-color: #" + "".format(record.color) + ";"
|
||||
"style": lambda record: "background-color: #{:06X}; color: #{:06X};"
|
||||
.format(record.color, 0xFFFFFF - record.color, )
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
def render_color(self, value):
|
||||
return "#{:06X}".format(value)
|
||||
|
||||
class Meta:
|
||||
attrs = {
|
||||
'class': 'table table-condensed table-striped table-hover'
|
||||
}
|
||||
model = BusTeam
|
||||
template_name = 'django_tables2/bootstrap4.html'
|
||||
fields = ('name', 'color', 'team',)
|
||||
fields = ('name', 'color',)
|
||||
row_attrs = {
|
||||
'class': 'table-row',
|
||||
'id': lambda record: "row-" + str(record.pk),
|
||||
|
Reference in New Issue
Block a user