Merge pull request #276 from eReuse/bugfix/#3360-computermonitor-instead-monitor

computer monitor instead of monitor
This commit is contained in:
cayop 2022-05-16 12:59:41 +02:00 committed by GitHub
commit 8794223385
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 9 deletions

View File

@ -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

View File

@ -4,7 +4,7 @@ $(document).ready(() => {
})
function deviceInputs() {
if ($("#type").val() == "Monitor") {
if ($("#type").val() == "ComputerMonitor") {
$("#screen").show();
$("#resolution").show();
$("#imei").hide();

View File

@ -36,9 +36,9 @@
<label for="name" class="form-label">Type *</label>
<select id="type" class="form-control" name="type" required="">
<option value="">Select one Type</option>
<optgroup label="Computer Monitor">
<option value="Monitor"
{% if form.type.data == 'Monitor' %} selected="selected"{% endif %}>Monitor</option>
<optgroup label="Monitor">
<option value="ComputerMonitor"
{% if form.type.data == 'Monitor' %} selected="selected"{% endif %}>Computer Monitor</option>
</optgroup>
<optgroup label="Mobile">
<option value="Smartphone"