This repository has been archived on 2024-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
devicehub-teal/ereuse_devicehub/templates/inventory/device_create.html

454 lines
23 KiB
HTML
Raw Normal View History

2022-01-19 12:40:40 +00:00
{% extends "ereuse_devicehub/base_site.html" %}
{% block main %}
<div class="pagetitle">
<h1>{{ page_title }}</h1>
2022-01-19 12:40:40 +00:00
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href="{{ url_for('inventory.devicelist')}}">Inventory</a></li>
<li class="breadcrumb-item">{{ page_title }}</li>
2022-01-19 12:40:40 +00:00
</ol>
</nav>
</div><!-- End Page Title -->
<section class="section profile">
<div class="row">
<div class="col-xl-8">
<div class="card">
<div class="card-body">
<div class="pt-4 pb-2">
{% if form.form_errors %}
<p class="text-danger">
{% for error in form.form_errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
</div>
<form method="post" class="row g-3 needs-validation" novalidate>
{{ form.csrf_token }}
<div>
2022-01-19 12:40:40 +00:00
<div class="form-group has-validation mb-2">
<label for="name" class="form-label">Type *</label>
<select id="type" class="form-control" name="type" required="">
<option value="">Select one Type</option>
2022-06-29 09:51:03 +00:00
<optgroup label="Computer">
<option value="Laptop"
{% if form.type.data == 'Laptop' %} selected="selected"{% endif %}>Laptop</option>
<option value="Desktop"
{% if form.type.data == 'Desktop' %} selected="selected"{% endif %}>Desktop</option>
<option value="Server"
{% if form.type.data == 'Server' %} selected="selected"{% endif %}>Server</option>
</optgroup>
2022-05-16 10:40:14 +00:00
<optgroup label="Monitor">
<option value="ComputerMonitor"
{% if form.type.data == 'Monitor' %} selected="selected"{% endif %}>Computer Monitor</option>
2022-01-19 12:40:40 +00:00
</optgroup>
<optgroup label="Mobile">
<option value="Smartphone"
{% if form.type.data == 'Smartphone' %} selected="selected"{% endif %}>Smartphone</option>
<option value="Tablet"
{% if form.type.data == 'Tablet' %} selected="selected"{% endif %}>Tablet</option>
<option value="Cellphone"
{% if form.type.data == 'Cellphone' %} selected="selected"{% endif %}>Cellphone</option>
2022-01-19 12:40:40 +00:00
</optgroup>
<optgroup label="Computer Accessory">
<option value="Mouse"
{% if form.type.data == 'Mouse' %} selected="selected"{% endif %}>Mouse</option>
<option value="MemoryCardReader"
{% if form.type.data == 'MemoryCardReader' %} selected="selected"{% endif %}>Memory card reader</option>
<option value="SAI"
{% if form.type.data == 'SAI' %} selected="selected"{% endif %}>SAI</option>
<option value="Keyboard"
{% if form.type.data == 'Keyboard' %} selected="selected"{% endif %}>Keyboard</option>
2022-01-19 12:40:40 +00:00
</optgroup>
</select>
<small class="text-muted form-text">Type of devices</small>
2022-01-20 12:13:20 +00:00
{% if form.type.errors %}
<p class="text-danger">
{% for error in form.type.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="form-group mb-2">
2022-06-28 15:38:31 +00:00
<label for="label" class="form-label">{{ form.amount.label }} *</label>
{{ form.amount(class_="form-control") }}
<small class="text-muted form-text">Number of devices you want to create of this type</small>
{% if form.amount.errors %}
<p class="text-danger">
{% for error in form.amount.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
</div>
<div class="form-group mb-2">
<label for="label" class="form-label">{{ form.phid.label }}</label>
{{ form.phid(class_="form-control") }}
2022-01-19 12:40:40 +00:00
<small class="text-muted form-text">Label that you want link to this device</small>
2022-06-28 15:38:31 +00:00
{% if form.phid.errors %}
<p class="text-danger">
{% for error in form.phid.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
</div>
<div class="form-group mb-2">
<label for="label" class="form-label">{{ form.id_device_supplier.label }}</label>
{{ form.id_device_supplier(class_="form-control") }}
<small class="text-muted form-text">Identity of device for the Supplier</small>
{% if form.id_device_supplier.errors %}
<p class="text-danger">
{% for error in form.id_device_supplier.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
</div>
<div class="form-group mb-2">
<label for="label" class="form-label">{{ form.pallet.label }}</label>
{{ form.pallet(class_="form-control") }}
<small class="text-muted form-text">Identity of pallet</small>
{% if form.pallet.errors %}
<p class="text-danger">
{% for error in form.pallet.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
</div>
<div class="form-group mb-2">
<label for="label" class="form-label">{{ form.info.label }}</label>
{{ form.info(class_="form-control") }}
<small class="text-muted form-text">Info extra</small>
{% if form.info.errors %}
2022-01-20 12:13:20 +00:00
<p class="text-danger">
2022-06-28 15:38:31 +00:00
{% for error in form.info.errors %}
2022-01-20 12:13:20 +00:00
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="serialNumber" class="form-label">{{ form.serial_number.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.serial_number(class_="form-control") }}
<small class="text-muted form-text">Serial number of this device</small>
2022-01-20 12:13:20 +00:00
{% if form.serial_number.errors %}
<p class="text-danger">
{% for error in form.serial_number.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="model" class="form-label">{{ form.model.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.model(class_="form-control") }}
<small class="text-muted form-text">Name of model</small>
2022-01-20 12:13:20 +00:00
{% if form.model.errors %}
<p class="text-danger">
{% for error in form.model.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="model" class="form-label">{{ form.manufacturer.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.manufacturer(class_="form-control") }}
<small class="text-muted form-text">Name of manufacturer</small>
2022-01-20 12:13:20 +00:00
{% if form.manufacturer.errors %}
<p class="text-danger">
{% for error in form.manufacturer.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
<label for="model" class="form-label">{{ form.appearance.label }}</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="appearance" value="Z">
<label class="form-check-label">0. The device is new.</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="appearance" value="A">
<label class="form-check-label">A. Like new (no visual damage))</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="appearance" value="B">
<label class="form-check-label">B. In very good condition (small visual damage to hard-to-detect parts)</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="appearance" value="C">
<label class="form-check-label">C. In good condition (small visual damage to easy-to-detect parts, not the screen))</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="appearance" value="D">
<label class="form-check-label">D. It is acceptable (visual damage to visible parts, not on the screen)</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="appearance" value="E">
<label class="form-check-label">E. It is unacceptable (substantial visual damage that may affect use)</label>
</div>
<small class="text-muted form-text">Rate the imperfections that affect the device aesthetically, but not its use.</small>
2022-01-20 12:13:20 +00:00
{% if form.appearance.errors %}
<p class="text-danger">
{% for error in form.appearance.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
<label for="model" class="form-label">{{ form.functionality.label }}</label>
<div class="form-check">
<input class="form-check-input" type="radio" name="functionality" value="A">
<label class="form-check-label">A. Everything works perfectly (buttons, and no scratches on the screen)</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="functionality" value="B">
<label class="form-check-label">B. There is a hard to press button or small scratches on the corners of the screen</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="functionality" value="C">
<label class="form-check-label">C. A non-essential button does not work; the screen has multiple scratches on the corners</label>
</div>
<div class="form-check">
<input class="form-check-input" type="radio" name="functionality" value="D">
<label class="form-check-label">D. Multiple buttons do not work properly; the screen has severe damage that may affect use</label>
</div>
<small class="text-muted form-text">It qualifies the defects of a device that affect its use.</small>
2022-01-20 12:13:20 +00:00
{% if form.functionality.errors %}
<p class="text-danger">
{% for error in form.functionality.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
<label for="model" class="form-label">{{ form.brand.label }}</label>
{{ form.brand(class_="form-control") }}
<small class="text-muted form-text">A naming for consumers. This field can represent several models, so it can be ambiguous, and it is not used to identify the product.</small>
2022-01-20 12:13:20 +00:00
{% if form.brand.errors %}
<p class="text-danger">
{% for error in form.brand.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="model" class="form-label">{{ form.generation.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.generation(class_="form-control") }}
<small class="text-muted form-text">The generation of the device.</small>
2022-01-20 12:13:20 +00:00
{% if form.generation.errors %}
<p class="text-danger">
{% for error in form.generation.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
<label for="model" class="form-label">{{ form.version.label }}</label>
{{ form.version(class_="form-control") }}
<small class="text-muted form-text">The version code o fthis device, like 'v1' or 'A001'.</small>
2022-01-20 12:13:20 +00:00
{% if form.version.errors %}
<p class="text-danger">
{% for error in form.version.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="model" class="form-label">{{ form.weight.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.weight(class_="form-control") }}
<small class="text-muted form-text">The weight of the device in Kg.</small>
2022-01-20 12:13:20 +00:00
{% if form.weight.errors %}
<p class="text-danger">
{% for error in form.weight.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="model" class="form-label">{{ form.width.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.width(class_="form-control") }}
<small class="text-muted form-text">The width of the device in meters.</small>
2022-01-20 12:13:20 +00:00
{% if form.width.errors %}
<p class="text-danger">
{% for error in form.width.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="model" class="form-label">{{ form.height.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.height(class_="form-control") }}
<small class="text-muted form-text">The height of the device in meters.</small>
2022-01-20 12:13:20 +00:00
{% if form.height.errors %}
<p class="text-danger">
{% for error in form.height.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
2022-06-28 15:38:31 +00:00
<label for="model" class="form-label">{{ form.depth.label }}</label>
2022-01-19 12:40:40 +00:00
{{ form.depth(class_="form-control") }}
<small class="text-muted form-text">The depth of the device in meters.</small>
2022-01-20 12:13:20 +00:00
{% if form.depth.errors %}
<p class="text-danger">
{% for error in form.depth.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
<label for="model" class="form-label">{{ form.variant.label }}</label>
{{ form.variant(class_="form-control") }}
<small class="text-muted form-text">A variant or sub-model of the device.</small>
2022-01-20 12:13:20 +00:00
{% if form.variant.errors %}
<p class="text-danger">
{% for error in form.variant.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
<label for="model" class="form-label">{{ form.sku.label }}</label>
{{ form.sku(class_="form-control") }}
<small class="text-muted form-text">The Stock Keeping Unit (SKU), i.e. a merchant-specific identifier for a product or service.</small>
2022-01-20 12:13:20 +00:00
{% if form.sku.errors %}
<p class="text-danger">
{% for error in form.sku.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div class="from-group has-validation mb-2">
<label for="image" class="form-label">{{ form.image.label }}</label>
{{ form.image(class_="form-control") }}
<small class="text-muted form-text">An URL containing an image of the device.</small>
2022-01-20 12:13:20 +00:00
{% if form.image.errors %}
<p class="text-danger">
{% for error in form.image.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div id="imei" class="from-group has-validation mb-2">
<label for="imei" class="form-label">{{ form.imei.label }}</label>
{{ form.imei(class_="form-control") }}
<small class="text-muted form-text">A number from 14 to 16 digits.</small>
2022-01-20 12:13:20 +00:00
{% if form.imei.errors %}
<p class="text-danger">
{% for error in form.imei.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div id="meid" class="from-group has-validation mb-2">
<label for="meid" class="form-label">{{ form.meid.label }}</label>
{{ form.meid(class_="form-control") }}
<small class="text-muted form-text">14 hexadecimal digits.</small>
2022-01-20 12:13:20 +00:00
{% if form.meid.errors %}
<p class="text-danger">
{% for error in form.meid.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div id="resolution" class="from-group has-validation mb-2">
<label for="resolution" class="form-label">{{ form.resolution.label }}</label>
{{ form.resolution(class_="form-control") }}
<small class="text-muted form-text">The resolution width of the screen.</small>
2022-01-20 12:13:20 +00:00
{% if form.resolution.errors %}
<p class="text-danger">
{% for error in form.resolution.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
<div id="screen" class="from-group has-validation mb-2">
<label for="screen" class="form-label">{{ form.screen.label }}</label>
{{ form.screen(class_="form-control") }}
<small class="text-muted form-text">The size of the screen.</small>
2022-01-20 12:13:20 +00:00
{% if form.screen.errors %}
<p class="text-danger">
{% for error in form.screen.errors %}
{{ error }}<br/>
{% endfor %}
</p>
{% endif %}
2022-01-19 12:40:40 +00:00
</div>
</div>
<div>
{% if lot_id %}
<a href="{{ url_for('inventory.lotdevicelist', lot_id=lot_id) }}" class="btn btn-danger">Cancel</a>
{% else %}
<a href="{{ url_for('inventory.devicelist') }}" class="btn btn-danger">Cancel</a>
{% endif %}
2022-01-19 12:40:40 +00:00
<button class="btn btn-primary" type="submit">Save</button>
</div>
</form>
</div>
</div>
</div>
<div class="col-xl-8">
</div>
</div>
</section>
<script src="{{ url_for('static', filename='js/create_device.js') }}"></script>
{% endblock main %}