Commit 6257c4d4 authored by Maël Kervella's avatar Maël Kervella Committed by root

Add buttons for aliases collapse

parent 180fc127
......@@ -28,7 +28,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% include "pagination.html" with list=machines_list %}
{% endif %}
<table class="table">
<table class="table" id="machines_table">
<colgroup>
<col>
<col>
......@@ -65,21 +65,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<tr>
<td>
{% if interface.domain.related_domain.all %}
<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button" id="editioninterface" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
{{ interface.domain }} <span class="caret"></span>
</button>
<ul class="dropdown-menu" aria-labelledby="editioninterface">
{% for al in interface.domain.related_domain.all %}
<li>
<a href="http://{{ al }}">
{{ al }}
<i class="glyphicon glyphicon-share-alt"></i>
</a>
</li>
{% endfor %}
</ul>
</div>
{{ interface.domain }}
<button class="btn btn-default btn-xs" type="button" data-toggle="collapse" data-target="#collapseDomain_{{interface.id}}" aria-expanded="true" aria-controls="collapseDomain_{{interface.id}}">
Afficher les alias
</button>
{% else %}
{{ interface.domain }}
{% endif %}
......@@ -132,6 +121,24 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</div>
</td>
</tr>
{% if interface.domain.related_domain.all %}
<tr>
<td colspan=5 style="border-top: none; padding: 1px;">
<div class="collapse in" id="collapseDomain_{{interface.id}}">
<ul class="list-group" style="margin-bottom: 0px;">
{% for al in interface.domain.related_domain.all %}
<li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;">
<a href="http://{{ al }}">
{{ al }}
<i class="glyphicon glyphicon-share-alt"></i>
</a>
</li>
{% endfor %}
</ul>
</div>
</td>
<tr>
{% endif %}
{% endfor %}
<tr>
<td colspan="8"></td>
......@@ -140,6 +147,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
</tbody>
</table>
<script>
$("#machines_table").ready( function() {
var alias_div = [{% for machine in machines_list %}{% for interface in machine.interface_set.all %}{% if interface.domain.related_domain.all %}$("#collapseDomain_{{interface.id}}"), {% endif %}{% endfor %}{% endfor %}];
for (var i=0 ; i<alias_div.length ; i++) {
alias_div[i].collapse('hide');
}
} );
</script>
{% if machines_list.paginator %}
{% include "pagination.html" with list=machines_list %}
{% endif %}
......@@ -90,10 +90,10 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<script>
$("#listRights_table").ready( function () {
var listRights_div = [{% for listright in listright_list %}[$("#accordion_{{listright.gid}}"), $("#collapseListRight_user_{{listright.gid}}"), $("#collapseListRight_perm_{{listright.gid}}")], {% endfor %}];
var listRights_div = [{% for listright in listright_list %}[$("#accordion_{{listright.gid}}"), $("#collapseListRight_user_{{listright.gid}}"), $("#collapseListRight_perm_{{listright.gid}}")], {% endfor %}];
for (var i=0 ; i<listRights_div.length ; i++) {
listRights_div[i][1].collapse({ toggle: true, parent: listRights_div[i][0] });
listRights_div[i][2].collapse({ toggle: true, parent: listRights_div[i][0] });
listRights_div[i][1].collapse({ toggle: true, parent: listRights_div[i][0] });
listRights_div[i][2].collapse({ toggle: true, parent: listRights_div[i][0] });
}
} );
</script>
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