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 = [ DEVICES = [
("All", "All"), ("All", "All"),
("Computer", "Computer"),
("Desktop", "Desktop"), ("Desktop", "Desktop"),
("Laptop", "Laptop"), ("Laptop", "Laptop"),
("Server", "Server"), ("Server", "Server"),
("Monitor", "Monitor"),
("ComputerMonitor", "ComputerMonitor"), ("ComputerMonitor", "ComputerMonitor"),
("TelevisionSet", "TelevisionSet"), ("TelevisionSet", "TelevisionSet"),
("Projector", "Projector"), ("Projector", "Projector"),
@ -65,49 +63,30 @@ DEVICES = [
("Smartphone", "Smartphone"), ("Smartphone", "Smartphone"),
("Tablet", "Tablet"), ("Tablet", "Tablet"),
("Cellphone", "Cellphone"), ("Cellphone", "Cellphone"),
("JoinedComponentTableMixin", "JoinedComponentTableMixin"),
("GraphicCard", "GraphicCard"), ("GraphicCard", "GraphicCard"),
("DataStorage", "DataStorage"),
("HardDrive", "HardDrive"), ("HardDrive", "HardDrive"),
("SolidStateDrive", "SolidStateDrive"), ("SolidStateDrive", "SolidStateDrive"),
("Motherboard", "Motherboard"), ("Motherboard", "Motherboard"),
("NetworkMixin", "NetworkMixin"),
("NetworkAdapter", "NetworkAdapter"), ("NetworkAdapter", "NetworkAdapter"),
("Processor", "Processor"), ("Processor", "Processor"),
("RamModule", "RamModule"), ("RamModule", "RamModule"),
("SoundCard", "SoundCard"), ("SoundCard", "SoundCard"),
("Display", "Display"),
("Battery", "Battery"), ("Battery", "Battery"),
("Camera", "Camera"),
("ComputerAccessory", "ComputerAccessory"),
("SAI", "SAI"),
("Keyboard", "Keyboard"), ("Keyboard", "Keyboard"),
("Mouse", "Mouse"), ("Mouse", "Mouse"),
("MemoryCardReader", "MemoryCardReader"), ("MemoryCardReader", "MemoryCardReader"),
("Networking", "Networking"), ("GraphicCard", "GraphicCard"),
("Router", "Router"), ("HardDrive", "HardDrive"),
("Switch", "Switch"), ("SolidStateDrive", "SolidStateDrive"),
("Hub", "Hub"), ("Motherboard", "Motherboard"),
("WirelessAccessPoint", "WirelessAccessPoint"), ("NetworkAdapter", "NetworkAdapter"),
("Printer", "Printer"), ("Processor", "Processor"),
("LabelPrinter", "LabelPrinter"), ("RamModule", "RamModule"),
("Sound", "Sound"), ("SoundCard", "SoundCard"),
("Microphone", "Microphone"), ("Battery", "Battery"),
("Video", "Video"), ("Keyboard", "Keyboard"),
("VideoScaler", "VideoScaler"), ("Mouse", "Mouse"),
("Videoconference", "Videoconference"), ("MemoryCardReader", "MemoryCardReader"),
("Cooking", "Cooking"),
("Mixer", "Mixer"),
("DIYAndGardening", "DIYAndGardening"),
("Drill", "Drill"),
("PackOfScrewdrivers", "PackOfScrewdrivers"),
("Home", "Home"),
("Dehumidifier", "Dehumidifier"),
("Stairs", "Stairs"),
("Recreation", "Recreation"),
("Bike", "Bike"),
("Racket", "Racket"),
("Manufacturer", "Manufacturer"),
] ]

View File

@ -296,7 +296,46 @@
<div class="row"> <div class="row">
<div class="col-2"> <div class="col-2">
{% for f in form_filter %} {% 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 }} {{ f }}
{% endif %}
{% endfor %} {% endfor %}
</div> </div>
<div class="col-1"> <div class="col-1">