8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-12-23 23:43:47 +00:00

Permet de retirer un droit sans JS

This commit is contained in:
Mael Kervella 2017-10-15 19:40:26 +00:00
parent 5a0835338d
commit 643c8235b0

View file

@ -34,19 +34,19 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form" method="post">
{% csrf_token %}
<table class="table table-striped">
<table id="delRights_table" class="table table-striped">
<tbody>
{% for key, values in userform.items %}
<tr class="active">
<td>
<a data-toggle="collapse" href="#collapseRight_{{key}}" aria-expanded="false" aria-controls="collapseRights_{{key}}">
<a data-toggle="collapse" href="#collapseRight_{{key}}" aria-expanded="true" aria-controls="collapseRights_{{key}}">
<b>{{ key }}</b> ( {{values.rights|length }} users )
</a>
</td>
</tr>
<tr>
<td>
<div class="collapse" id="collapseRight_{{key}}">
<div class="collapse in" id="collapseRight_{{key}}">
<ul class="list-group" style="margin-bottom: 0px">
{% for user in values.rights %}
<li class="list-group-item col-xs-6 col-sm-4 col-md-3" style="border: none;">{{ user }}</li>
@ -58,9 +58,18 @@ with this program; if not, write to the Free Software Foundation, Inc.,
{% endfor %}
</tbody>
</table>
{% bootstrap_button "Modifier" button_type="submit" icon="star" %}
{% bootstrap_button "Supprimer" button_type="submit" icon="star" %}
</form>
<script>
$("#delRights_table").ready( function () {
var rights_div = [{% for k in userform.keys %}$("#collapseRight_{{k}}"), {% endfor %}];
for (var i=0 ; i<rights_div.length ; i++) {
rights_div[i].collapse('hide');
}
} );
</script>
<br />
<br />
<br />