new list of device for filter

This commit is contained in:
Cayo Puigdefabregas 2022-03-15 09:16:01 +01:00
parent 40abcd6b67
commit 71926f01c0
2 changed files with 51 additions and 33 deletions

View file

@ -53,11 +53,9 @@ from ereuse_devicehub.resources.user.models import User
DEVICES = [
("All", "All"),
("Computer", "Computer"),
("Desktop", "Desktop"),
("Laptop", "Laptop"),
("Server", "Server"),
("Monitor", "Monitor"),
("ComputerMonitor", "ComputerMonitor"),
("TelevisionSet", "TelevisionSet"),
("Projector", "Projector"),
@ -65,49 +63,30 @@ DEVICES = [
("Smartphone", "Smartphone"),
("Tablet", "Tablet"),
("Cellphone", "Cellphone"),
("JoinedComponentTableMixin", "JoinedComponentTableMixin"),
("GraphicCard", "GraphicCard"),
("DataStorage", "DataStorage"),
("HardDrive", "HardDrive"),
("SolidStateDrive", "SolidStateDrive"),
("Motherboard", "Motherboard"),
("NetworkMixin", "NetworkMixin"),
("NetworkAdapter", "NetworkAdapter"),
("Processor", "Processor"),
("RamModule", "RamModule"),
("SoundCard", "SoundCard"),
("Display", "Display"),
("Battery", "Battery"),
("Camera", "Camera"),
("ComputerAccessory", "ComputerAccessory"),
("SAI", "SAI"),
("Keyboard", "Keyboard"),
("Mouse", "Mouse"),
("MemoryCardReader", "MemoryCardReader"),
("Networking", "Networking"),
("Router", "Router"),
("Switch", "Switch"),
("Hub", "Hub"),
("WirelessAccessPoint", "WirelessAccessPoint"),
("Printer", "Printer"),
("LabelPrinter", "LabelPrinter"),
("Sound", "Sound"),
("Microphone", "Microphone"),
("Video", "Video"),
("VideoScaler", "VideoScaler"),
("Videoconference", "Videoconference"),
("Cooking", "Cooking"),
("Mixer", "Mixer"),
("DIYAndGardening", "DIYAndGardening"),
("Drill", "Drill"),
("PackOfScrewdrivers", "PackOfScrewdrivers"),
("Home", "Home"),
("Dehumidifier", "Dehumidifier"),
("Stairs", "Stairs"),
("Recreation", "Recreation"),
("Bike", "Bike"),
("Racket", "Racket"),
("Manufacturer", "Manufacturer"),
("GraphicCard", "GraphicCard"),
("HardDrive", "HardDrive"),
("SolidStateDrive", "SolidStateDrive"),
("Motherboard", "Motherboard"),
("NetworkAdapter", "NetworkAdapter"),
("Processor", "Processor"),
("RamModule", "RamModule"),
("SoundCard", "SoundCard"),
("Battery", "Battery"),
("Keyboard", "Keyboard"),
("Mouse", "Mouse"),
("MemoryCardReader", "MemoryCardReader"),
]

View file

@ -296,7 +296,46 @@
<div class="row">
<div class="col-2">
{% for f in form_filter %}
{% if f == form_filter.filter %}
<select id="filter" class="form-select" name="filter">
<option value="All" {% if form_filter.filter.data == 'All' %}selected="selected"{% endif %}>All</option>
<optgroup label="Computer">
<option value="Desktop" {% if form_filter.filter.data == 'Desktop' %}selected="selected"{% endif %}>Desktop</option>
<option {% if form_filter.filter.data == 'Laptop' %}selected="selected"{% endif %} value="Laptop">Laptop</option>
<option {% if form_filter.filter.data == 'Server' %}selected="selected"{% endif %} value="Server">Server</option>
</optgroup>
<optgroup label="Monitor">
<option value="ComputerMonitor" {% if form_filter.filter.data == 'ComputerMonitor' %}selected="selected"{% endif %}>ComputerMonitor</option>
<option {% if form_filter.filter.data == 'TelevisionSet' %}selected="selected"{% endif %} value="TelevisionSet">TelevisionSet</option>
<option {% if form_filter.filter.data == 'Projector' %}selected="selected"{% endif %} value="Projector">Projector</option>
</optgroup>
<optgroup label="Mobile, tablet & smartphone">
<option {% if form_filter.filter.data == 'Mobile' %}selected="selected"{% endif %} value="Mobile">Mobile</option>
<option {% if form_filter.filter.data == 'Smartphone' %}selected="selected"{% endif %} value="Smartphone">Smartphone</option>
<option {% if form_filter.filter.data == 'Tablet' %}selected="selected"{% endif %} value="Tablet">Tablet</option>
<option {% if form_filter.filter.data == 'Cellphone' %}selected="selected"{% endif %} value="Cellphone">Cellphone</option>
</optgroup>
<optgroup label="Data Storage">
<option {% if form_filter.filter.data == 'HardDrive' %}selected="selected"{% endif %} value="HardDrive">HardDrive</option>
<option {% if form_filter.filter.data == 'SolidStateDrive' %}selected="selected"{% endif %} value="SolidStateDrive">SolidStateDrive</option>
</optgroup>
<optgroup label="Accessories & Peripherals">
<option {% if form_filter.filter.data == 'GraphicCard' %}selected="selected"{% endif %} value="GraphicCard">GraphicCard</option>
<option {% if form_filter.filter.data == 'Motherboard' %}selected="selected"{% endif %} value="Motherboard">Motherboard</option>
<option {% if form_filter.filter.data == 'NetworkAdapter' %}selected="selected"{% endif %} value="NetworkAdapter">NetworkAdapter</option>
<option {% if form_filter.filter.data == 'Processor' %}selected="selected"{% endif %} value="Processor">Processor</option>
<option {% if form_filter.filter.data == 'RamModule' %}selected="selected"{% endif %} value="RamModule">RamModule</option>
<option {% if form_filter.filter.data == 'SoundCard' %}selected="selected"{% endif %} value="SoundCard">SoundCard</option>
<option {% if form_filter.filter.data == 'Battery' %}selected="selected"{% endif %} value="Battery">Battery</option>
<option {% if form_filter.filter.data == 'Keyboard' %}selected="selected"{% endif %} value="Keyboard">Keyboard</option>
<option {% if form_filter.filter.data == 'Mouse' %}selected="selected"{% endif %} value="Mouse">Mouse</option>
<option {% if form_filter.filter.data == 'NetworkAdapter' %}selected="selected"{% endif %} value="NetworkAdapter">NetworkAdapter</option>
<option {% if form_filter.filter.data == 'MemoryCardReader' %}selected="selected"{% endif %} value="MemoryCardReader">MemoryCardReader</option>
</optgroup>
</select>
{% else %}
{{ f }}
{% endif %}
{% endfor %}
</div>
<div class="col-1">