Merge pull request #2535 from SchrodingersGat/filters-fix

CSS fixes for table filter tags
This commit is contained in:
Oliver 2022-01-11 15:40:54 +11:00 committed by GitHub
commit 4d01ab16ea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 1 deletions

View File

@ -319,6 +319,7 @@ main {
display: inline-block;
*display: inline;
zoom: 1;
padding-top: 3px;
padding-left: 3px;
padding-right: 3px;
border: 1px solid #aaa;
@ -327,6 +328,7 @@ main {
margin: 1px;
margin-left: 5px;
margin-right: 5px;
white-space: nowrap;
}
.filter-button {

View File

@ -124,6 +124,8 @@ def allow_table_event(table_name):
ignore_tables = [
'common_notificationentry',
'common_webhookendpoint',
'common_webhookmessage',
]
if table_name in ignore_tables:
@ -140,6 +142,11 @@ def after_save(sender, instance, created, **kwargs):
table = sender.objects.model._meta.db_table
instance_id = getattr(instance, 'id', None)
if instance_id is None:
return
if not allow_table_event(table):
return

View File

@ -305,7 +305,16 @@ function setupFilterList(tableKey, table, target) {
var title = getFilterTitle(tableKey, key);
var description = getFilterDescription(tableKey, key);
element.append(`<div title='${description}' class='filter-tag'>${title} = ${value}<span ${tag}='${key}' class='close'>x</span></div>`);
var filter_tag = `
<div title='${description}' class='filter-tag'>
${title} = ${value}
<span ${tag}='${key}' class='close' style='color: #F55;'>
<span aria-hidden='true'><strong>&times;</strong></span>
</span>
</div>
`;
element.append(filter_tag);
}
// Callback for reloading the table