1- {% extends 'layout .html' %}
1+ {% extends 'sidebar .html' %}
22
33{% load static %}
44
5- {% block title %}Morea | Lista de Dispositivos{% endblock %}
5+ {% block title %}Morea | Gerenciamento de Dispositivos{% endblock %}
66
77{% block stylesCustom %}
8+ < link rel ="stylesheet " href ="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css ">
89< link rel ="stylesheet " href ="{% static 'css/device_list.css' %} " />
910{% endblock %}
1011
1112{% block content %}
1213< div class ="container ">
1314 < h1 > Dispositivos Cadastrados</ h1 >
14-
15- < form method ="GET ">
16- < label for ="filter_type "> Filtrar por tipo:</ label >
17- < select name ="filter_type " id ="filter_type ">
18- < option value =""> Todos</ option >
19- < option value ="1 " {% if filter_type == '1 ' %}selected{% endif %} > Água</ option >
20- < option value ="2 " {% if filter_type == '2 ' %}selected{% endif %} > Energia</ option >
21- </ select >
22- < br >
23- < label for ="filter_location "> Filtrar por localização:</ label >
24- < select name ="filter_location " id ="filter_location ">
25- < option value =""> Todas</ option >
26- {% for location in locations %}
27- < option value ="{{ location }} " {% if filter_location == location %}selected{% endif %} > {{ location }}</ option >
28- {% endfor %}
29- </ select >
30- < br >
31- < label for ="filter_section "> Filtrar por seção:</ label >
32- < select name ="filter_section " id ="filter_section ">
33- < option value =""> Todas</ option >
34- {% for section in sections %}
35- < option value ="{{ section }} " {% if filter_section == section %}selected{% endif %} > {{ section }}</ option >
36- {% endfor %}
37- </ select >
38- < br >
39- < label for ="filter_authorized "> Filtrar por status de autorização:</ label >
40- < select name ="filter_authorized " id ="filter_authorized ">
41- < option value =""> Todos</ option >
42- < option value ="true " {% if filter_authorized == 'true ' %}selected{% endif %} > Autorizado</ option >
43- < option value ="false " {% if filter_authorized == 'false ' %}selected{% endif %} > Não Autorizado</ option >
44- </ select >
45- < br >
15+ < form class ="filter-form " method ="GET ">
16+ < div class ="form-group ">
17+ < select name ="filter_type " id ="filter_type ">
18+ < option value =""> Tipo</ option >
19+ < option value ="1 " {% if filter_type == '1 ' %}selected{% endif %} > Água</ option >
20+ < option value ="2 " {% if filter_type == '2 ' %}selected{% endif %} > Energia</ option >
21+ < option value ="3 " {% if filter_type == '3 ' %}selected{% endif %} > Gás</ option >
22+ </ select >
23+ </ div >
24+ < div class ="form-group ">
25+ < select name ="filter_location " id ="filter_location ">
26+ < option value =""> Localização</ option >
27+ {% for location in locations %}
28+ < option value ="{{ location }} " {% if filter_location == location %}selected{% endif %} > {{ location }}
29+ </ option >
30+ {% endfor %}
31+ </ select >
32+ </ div >
33+ < div class ="form-group ">
34+ < select name ="filter_section " id ="filter_section ">
35+ < option value =""> Seção</ option >
36+ {% for section in sections %}
37+ < option value ="{{ section }} " {% if filter_section == section %}selected{% endif %} > {{ section }}</ option >
38+ {% endfor %}
39+ </ select >
40+ </ div >
41+ < div class ="form-group ">
42+ < select name ="filter_authorized " id ="filter_authorized ">
43+ < option value =""> Status</ option >
44+ < option value ="0 " {% if filter_authorized == '0 ' %}selected{% endif %} > Pendente</ option >
45+ < option value ="1 " {% if filter_authorized == '1 ' %}selected{% endif %} > Não Autorizado</ option >
46+ < option value ="2 " {% if filter_authorized == '2 ' %}selected{% endif %} > Autorizado</ option >
47+ </ select >
48+ </ div >
4649 < button type ="submit "> Filtrar</ button >
4750 </ form >
4851
@@ -53,7 +56,8 @@ <h1>Dispositivos Cadastrados</h1>
5356 < th > Seção/Localização</ th >
5457 < th > Endereço IP</ th >
5558 < th > Endereço MAC</ th >
56- < th > Ações</ th >
59+ < th > Ver mais</ th >
60+ < th > Atualizar</ th >
5761 </ tr >
5862 </ thead >
5963 < tbody >
@@ -64,15 +68,15 @@ <h1>Dispositivos Cadastrados</h1>
6468 < td > {{ device.ip_address }}</ td >
6569 < td > {{ device.mac_address }}</ td >
6670 < td >
67- {% if device.is_authorized %}
68- < a href ="{% url 'device_detail' device.id %} "> Ver mais</ a >
69- {% else %}
70- < a href ="{% url 'edit_device' device.id %} "> Editar</ a >
71- {% endif %}
71+ < a href ="{% url 'device_detail' device.id %} "> < i class ="fas fa-info-circle "> </ i > </ a >
7272 </ td >
73+ < td >
74+ < a href ="{% url 'edit_device' device.id %} "> < i class ="fas fa-edit "> </ i > </ a >
75+ </ td >
76+
7377 </ tr >
7478 {% endfor %}
7579 </ tbody >
7680 </ table >
7781</ div >
78- {% endblock %}
82+ {% endblock %}
0 commit comments