Commit 82802de4 authored by Gabriel Detraz's avatar Gabriel Detraz Committed by klafyvel

More clear front of all switchs modular

parent 683cf229
......@@ -83,3 +83,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include "pagination.html" with list=module_list %}
{% endif %}
<h4>{% trans "All modular switchs" %}</h4>
<table class="table table-striped">
<thead>
<th>{% trans "Switch" %}</th>
<th>{% trans "Reference" %}</th>
<th>{% trans "Slot" %}</th>
<tbody>
{% for switch in modular_switchs %}
{% if switch.list_modules %}
<tr class="info">
<td colspan="4">
{{ switch }}
</td>
</tr>
{% for module in switch.list_modules %}
<tr>
<td></td>
<td>{{ module.1 }}</td>
<td>{{ module.0 }}</td>
</tr>
{% endfor %}
{% endif %}
{% endfor %}
</table>
......@@ -35,7 +35,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<a class="btn btn-primary btn-sm" role="button" href="{% url 'topologie:add-module' %}"><i class="fa fa-plus"></i>{% trans " Add a module" %}</a>
<hr>
{% acl_end %}
{% include "topologie/aff_modules.html" with module_list=module_list %}
{% include "topologie/aff_modules.html" with module_list=module_list modular_switchs=modular_switchs %}
<br />
<br />
<br />
......
......@@ -325,12 +325,14 @@ def index_model_switch(request):
def index_module(request):
"""Display all modules of switchs"""
module_list = ModuleSwitch.objects.all()
modular_switchs = Switch.objects.filter(model__is_modular=True)
pagination_number = GeneralOption.get_cached_value('pagination_number')
module_list = re2o_paginator(request, module_list, pagination_number)
return render(
request,
'topologie/index_module.html',
{'module_list': module_list}
{'module_list': module_list,
'modular_switchs': modular_switchs}
)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment