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

Turn tables into grids

This commit is contained in:
grisel-davy 2020-10-25 23:47:59 +01:00
parent dba0da249e
commit 8a67b0ca0e

View file

@ -55,162 +55,154 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div> </div>
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="table-responsive"> {% for interface in machine.interface_set.all %}
<table class="table table-striped"> <div class="conatiner-fluid">
<thead> <div class="row">
<tr> <div class="col-sm-3">
<th>{% trans "DNS name"%}</th> <b>{% trans "DNS name"%}:</b>
<th>{% trans "Type" %}</th> </br>
<th>{% trans "MAC address" %}</th> {% if interface.domain.related_domain.all %}
<th>{% trans "IP address" %}</th> {{ interface.domain }}
<th>{% trans "Actions" %}</th> <button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
</tr> data-target="#collapseDomain_{{ interface.id }}" aria-expanded="true"
</thead> aria-controls="collapseDomain_{{ interface.id }}">
{% for interface in machine.interface_set.all %} {% trans "Show aliases" %}
<tr> </button>
<td> {% else %}
{% if interface.domain.related_domain.all %} {{ interface.domain }}
{{ interface.domain }} {% endif %}
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse" </div>
data-target="#collapseDomain_{{ interface.id }}" aria-expanded="true" <div class="col-sm-2">
aria-controls="collapseDomain_{{ interface.id }}"> <b>{% trans "Type" %}:</b>
{% trans "Show aliases" %} </br>
</button> {{ interface.machine_type }}
{% else %} </div>
{{ interface.domain }} <div class="col-sm-3">
{% endif %} <b>{% trans "MAC address" %}:</b>
</td> </br>
<td> {{ interface.mac_address }}
{{ interface.machine_type }} <button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
</td> data-target="#collapseVendor_{{ interface.id }}" aria-expanded="true"
<td> aria-controls="collapseVendor_{{ interface.id }}">
{{ interface.mac_address }} {% trans "Display the vendor" %}
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse" </button>
data-target="#collapseVendor_{{ interface.id }}" aria-expanded="true" </div>
aria-controls="collapseVendor_{{ interface.id }}"> <div class="col-sm-2">
{% trans "Display the vendor" %} <b>IPv4</b> {{ interface.ipv4 }}
</button> <br>
</td> {% if interface.ipv6.count > 0 %}
<td> <b>IPv6</b>
<b>IPv4</b> {{ interface.ipv4 }} <button class="btn btn-default btn-xs" type="button" data-toggle="collapse"
<br> data-target="#collapseIpv6_{{ interface.id }}" aria-expanded="true"
{% if ipv6_enabled and interface.ipv6 != 'None' %} aria-controls="collapseIpv6_{{ interface.id }}">
<b>IPv6</b> {% trans "Display IPv6" %}
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse" </button>
data-target="#collapseIpv6_{{ interface.id }}" aria-expanded="true" {% else %}
aria-controls="collapseIpv6_{{ interface.id }}"> <b>{% trans "No IPv6" %}</b>
{% trans "Display IPv6" %} {% endif %}
</button> </div>
{% endif %} <div class="col-sm-2 text-right">
</td> <div class="btn-group" role="group">
<td class="text-right"> <button class="btn btn-primary btn-sm dropdown-toggle" type="button"
<div class="btn-group" role="group"> id="editioninterface" data-toggle="dropdown" aria-haspopup="true"
<button class="btn btn-primary btn-sm dropdown-toggle" type="button" aria-expanded="true">
id="editioninterface" data-toggle="dropdown" aria-haspopup="true" <i class="fa fa-edit"></i><span class="caret"></span>
aria-expanded="true"> </button>
<i class="fa fa-edit"></i><span class="caret"></span> <ul class="dropdown-menu" aria-labelledby="editioninterface">
</button> {% can_edit interface %}
<ul class="dropdown-menu" aria-labelledby="editioninterface"> <li>
{% can_edit interface %} <a href="{% url 'machines:edit-interface' interface.id %}">
<li> <i class="fa fa-edit"></i>
<a href="{% url 'machines:edit-interface' interface.id %}"> {% trans "Edit" %}
<i class="fa fa-edit"></i> </a>
{% trans "Edit" %} </li>
</a> {% acl_end %}
</li> {% can_create Domain interface.id %}
{% acl_end %} <li>
{% can_create Domain interface.id %} <a href="{% url 'machines:index-alias' interface.id %}">
<li> <i class="fa fa-edit"></i>
<a href="{% url 'machines:index-alias' interface.id %}"> {% trans "Manage the aliases" %}
<i class="fa fa-edit"></i> </a>
{% trans "Manage the aliases" %} </li>
</a> {% acl_end %}
</li> {% can_create Ipv6List interface.id %}
{% acl_end %} <li>
{% can_create Ipv6List interface.id %} <a href="{% url 'machines:index-ipv6' interface.id %}">
<li> <i class="fa fa-edit"></i>
<a href="{% url 'machines:index-ipv6' interface.id %}"> {% trans "Manage the IPv6 addresses" %}
<i class="fa fa-edit"></i> </a>
{% trans "Manage the IPv6 addresses" %} </li>
</a> {% acl_end %}
</li> {% can_create SshFp interface.machine.id %}
{% acl_end %} <li>
{% can_create SshFp interface.machine.id %} <a href="{% url 'machines:index-sshfp' interface.machine.id %}">
<li> <i class="fa fa-edit"></i>
<a href="{% url 'machines:index-sshfp' interface.machine.id %}"> {% trans "Manage the SSH fingerprints" %}
<i class="fa fa-edit"></i> </a>
{% trans "Manage the SSH fingerprints" %} </li>
</a> {% acl_end %}
</li> {% can_create OuverturePortList %}
{% acl_end %} <li>
{% can_create OuverturePortList %} <a href="{% url 'machines:port-config' interface.id %}">
<li> <i class="fa fa-edit"></i>
<a href="{% url 'machines:port-config' interface.id %}"> {% trans "Manage the ports configuration" %}
<i class="fa fa-edit"></i> </a>
{% trans "Manage the ports configuration" %} </li>
</a> {% acl_end %}
</li> </ul>
{% acl_end %} </div>
</ul> {% history_button interface %}
</div> {% can_delete interface %}
{% history_button interface %} {% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %}
{% can_delete interface %} {% acl_end %}
{% include 'buttons/suppr.html' with href='machines:del-interface' id=interface.id %} </div>
{% acl_end %} </div>
</td> </div>
</tr> <div class="row">
<tr> <div class="col-sm-12">
<td colspan=5 style="border-top: none; padding: 1px;"> <div class="collapse in" id="collapseVendor_{{ interface.id }}">
<div class="collapse in" id="collapseVendor_{{ interface.id }}"> <ul class="list-group" style="margin-bottom: 0;">
<ul class="list-group" style="margin-bottom: 0;"> <li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;">
<li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;"> {{ interface.get_vendor }}
{{ interface.get_vendor }} </li>
</li> </ul>
</ul> </div>
</div>
</td>
</tr>
{% if ipv6_enabled and interface.ipv6 != 'None' %} {% if ipv6_enabled and interface.ipv6 != 'None' %}
<tr> <div class="collapse in" id="collapseIpv6_{{ interface.id }}">
<td colspan=5 style="border-top: none; padding: 1px;"> <ul class="list-group" style="margin-bottom: 0;">
<div class="collapse in" id="collapseIpv6_{{ interface.id }}"> {% for ipv6 in interface.ipv6.all %}
<ul class="list-group" style="margin-bottom: 0;"> <li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;">
{% for ipv6 in interface.ipv6.all %} {{ ipv6 }}
<li class="list-group-item col-xs-6 col-sm-6 col-md-6" style="border: none;"> </li>
{{ ipv6 }} {% endfor %}
</li> </ul>
{% endfor %} </div>
</ul>
</div>
</td>
</tr>
{% endif %} {% endif %}
{% if interface.domain.related_domain.all %} {% if interface.domain.related_domain.all %}
<tr> <div class="collapse in" id="collapseDomain_{{ interface.id }}">
<td colspan=5 style="border-top: none; padding: 1px;"> <ul class="list-group" style="margin-bottom: 0;">
<div class="collapse in" id="collapseDomain_{{ interface.id }}"> {% for al in interface.domain.related_domain.all %}
<ul class="list-group" style="margin-bottom: 0;"> <li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;">
{% for al in interface.domain.related_domain.all %} <a href="http://{{ al }}">
<li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;"> {{ al }}
<a href="http://{{ al }}"> <i class="fa fa-share"></i>
{{ al }} </a>
<i class="fa fa-share"></i> </li>
</a> {% endfor %}
</li> </ul>
{% endfor %} </div>
</ul>
</div>
</td>
</tr>
{% endif %} {% endif %}
</div>
</div>
{%if machine.interface_set.count > 1 %}
<hr/>
{% endif %}
{% endfor %} {% endfor %}
</table>
</div> </div>
</div> </div>
</div>
{% endfor %} {% endfor %}
{% if machines_list.paginator %} {% if machines_list.paginator %}
{% include 'pagination.html' with list=machines_list %} {% include 'pagination.html' with list=machines_list %}
{% endif %} {% endif %}