From d935c987b3d089bd596a75309345d1714ca49e99 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Mon, 16 May 2022 12:40:14 +0200 Subject: [PATCH] comiter monitor instead of monitor --- ereuse_devicehub/inventory/forms.py | 10 +++++----- ereuse_devicehub/static/js/create_device.js | 2 +- .../templates/inventory/device_create.html | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ereuse_devicehub/inventory/forms.py b/ereuse_devicehub/inventory/forms.py index 72c8de86..4f68c899 100644 --- a/ereuse_devicehub/inventory/forms.py +++ b/ereuse_devicehub/inventory/forms.py @@ -33,10 +33,10 @@ from ereuse_devicehub.resources.device.models import ( SAI, Cellphone, Computer, + ComputerMonitor, Device, Keyboard, MemoryCardReader, - Monitor, Mouse, Smartphone, Tablet, @@ -121,7 +121,7 @@ class FilterForm(FlaskForm): # Generic Filters if "All Devices" == self.device_type: - filter_type = COMPUTERS + ["Monitor"] + MOBILE + filter_type = COMPUTERS + MONITORS + MOBILE elif "All Computers" == self.device_type: filter_type = COMPUTERS @@ -334,7 +334,7 @@ class NewDeviceForm(FlaskForm): "Smartphone": Smartphone, "Tablet": Tablet, "Cellphone": Cellphone, - "Monitor": Monitor, + "ComputerMonitor": ComputerMonitor, "Mouse": Mouse, "Keyboard": Keyboard, "SAI": SAI, @@ -450,7 +450,7 @@ class NewDeviceForm(FlaskForm): path_snapshot = save_json(json_snapshot, self.tmp_snapshots, g.user.email) snapshot_json = schema.load(json_snapshot) - if self.type.data == 'Monitor': + if self.type.data == 'ComputerMonitor': snapshot_json['device'].resolution_width = self.resolution.data snapshot_json['device'].size = self.screen.data @@ -461,7 +461,7 @@ class NewDeviceForm(FlaskForm): snapshot = upload_form.build(snapshot_json) move_json(self.tmp_snapshots, path_snapshot, g.user.email) - if self.type.data == 'Monitor': + if self.type.data == 'ComputerMonitor': snapshot.device.resolution = self.resolution.data snapshot.device.screen = self.screen.data diff --git a/ereuse_devicehub/static/js/create_device.js b/ereuse_devicehub/static/js/create_device.js index a1b609b0..53d77dfa 100644 --- a/ereuse_devicehub/static/js/create_device.js +++ b/ereuse_devicehub/static/js/create_device.js @@ -4,7 +4,7 @@ $(document).ready(() => { }) function deviceInputs() { - if ($("#type").val() == "Monitor") { + if ($("#type").val() == "ComputerMonitor") { $("#screen").show(); $("#resolution").show(); $("#imei").hide(); diff --git a/ereuse_devicehub/templates/inventory/device_create.html b/ereuse_devicehub/templates/inventory/device_create.html index e3fa1cd6..1ad9a083 100644 --- a/ereuse_devicehub/templates/inventory/device_create.html +++ b/ereuse_devicehub/templates/inventory/device_create.html @@ -36,9 +36,9 @@