8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-22 11:23:10 +00:00

More clear front of all switchs modular

This commit is contained in:
Gabriel Detraz 2018-12-30 18:45:18 +01:00 committed by klafyvel
parent 683cf229e9
commit 82802de477
3 changed files with 29 additions and 2 deletions

View file

@ -83,3 +83,28 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include "pagination.html" with list=module_list %} {% include "pagination.html" with list=module_list %}
{% endif %} {% 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>

View file

@ -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> <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> <hr>
{% acl_end %} {% 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 /> <br />
<br /> <br />

View file

@ -325,12 +325,14 @@ def index_model_switch(request):
def index_module(request): def index_module(request):
"""Display all modules of switchs""" """Display all modules of switchs"""
module_list = ModuleSwitch.objects.all() module_list = ModuleSwitch.objects.all()
modular_switchs = Switch.objects.filter(model__is_modular=True)
pagination_number = GeneralOption.get_cached_value('pagination_number') pagination_number = GeneralOption.get_cached_value('pagination_number')
module_list = re2o_paginator(request, module_list, pagination_number) module_list = re2o_paginator(request, module_list, pagination_number)
return render( return render(
request, request,
'topologie/index_module.html', 'topologie/index_module.html',
{'module_list': module_list} {'module_list': module_list,
'modular_switchs': modular_switchs}
) )