diff --git a/ereuse_devicehub/inventory/views.py b/ereuse_devicehub/inventory/views.py index 62cd97cb..2329fa22 100644 --- a/ereuse_devicehub/inventory/views.py +++ b/ereuse_devicehub/inventory/views.py @@ -42,7 +42,13 @@ class DeviceListMix(View): def get_context(self, lot_id): # TODO @cayop adding filter # https://github.com/eReuse/devicehub-teal/blob/testing/ereuse_devicehub/resources/device/views.py#L56 - filter_types = ['Desktop', 'Laptop', 'Server'] + import pdb; pdb.set_trace() + type_device = { + None: ['Desktop', 'Laptop', 'Server'], + 'Computer': ['Computer'], + 'Monitor': ['Monitor'], + } + filter_types = type_device[request.get('filter')] lots = Lot.query.outerjoin(Trade) \ .filter(or_(Trade.user_from == g.user, Trade.user_to == g.user, diff --git a/ereuse_devicehub/templates/inventory/device_list.html b/ereuse_devicehub/templates/inventory/device_list.html index 63395f5a..4170318d 100644 --- a/ereuse_devicehub/templates/inventory/device_list.html +++ b/ereuse_devicehub/templates/inventory/device_list.html @@ -279,10 +279,17 @@
Computers
+
+ + +
- +
Select allSelect Title DHID Tags