Filter part table by 'is_component' status

This commit is contained in:
Oliver Walters 2020-04-11 23:02:18 +10:00
parent 0f90e8f522
commit f5a8b110b5
3 changed files with 11 additions and 0 deletions

View File

@ -147,6 +147,12 @@ function loadPartTable(table, url, options={}) {
display = display + `<span class='fas fa-tools label-right' title='Assembled part'></span>`;
}
/*
if (row.component) {
display = display + `<span class='fas fa-cogs label-right' title='Component part'></span>`;
}
*/
if (!row.active) {
display = display + `<span class='fas fa-times label-right' title='Inactive part'></span>`;
}

View File

@ -156,6 +156,7 @@ class PartList(generics.ListCreateAPIView):
- is_template: Is the part a template part?
- variant_of: Filter by variant_of Part reference
- assembly: Filter by assembly field
- component: Filter by component field
"""
serializer_class = part_serializers.PartSerializer

View File

@ -85,6 +85,10 @@ function getAvailableTableFilters(tableKey) {
type: 'bool',
title: '{% trans "Assembly" %}',
},
component: {
type: 'bool',
title: '{% trans "Component" %}',
},
};
}