pull/6/head
guanghongwei 2015-01-10 12:30:21 +08:00
parent 662c48ed37
commit 0c30e8fd53
3 changed files with 57 additions and 29 deletions

View File

@ -63,3 +63,5 @@ def user_add(request):

View File

@ -144,6 +144,24 @@ function WinMove() {
opacity: 0.8,
})
.disableSelection();
};
}
// Checkbox select all
function selectAll(){
var checklist = document.getElementsByName ("selected");
if(document.getElementById("select_all").checked)
{
for(var i=0;i<checklist.length;i++)
{
checklist[i].checked = 1;
}
}else
{
for(var j=0;j<checklist.length;j++)
{
checklist[j].checked = 0;
}
}
}

View File

@ -27,34 +27,42 @@
</div>
</div>
<div class="ibox-content" style="display: block;">
<table class="table table-hover">
<thead>
<tr>
<th>
<div class="radio i-checks">
<input type="checkbox" value="1" name="j_is_active" checked>
</div>
</th>
<th>ID</th>
<th>缁勫悕</th>
<th>澶囨敞</th>
</tr>
</thead>
<tbody>
{% for group in groups %}
<tr>
<td>
<div class="radio i-checks">
<input type="checkbox" value="1" name="j_is_active" checked>
</div>
</td>
<td>{{ group.id }}</td>
<td>{{ group.name }}</td>
<td>{{ group.comment }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<form method="post" action="">
<table class="table table-hover">
<thead>
<tr>
<th>
<div class="checkbox i-checks">
<input onclick="selectAll()" type="checkbox" name="select_all" style="select_all" id="select_all">
</div>
</th>
<th>ID</th>
<th>缁勫悕</th>
<th>澶囨敞</th>
</tr>
</thead>
<tbody>
{% for group in groups %}
<tr>
<td>
<div class="checkbox i-checks">
<input type="checkbox" value="{{ group.id }}" name="selected">
</div>
</td>
<td>{{ group.id }}</td>
<td>{{ group.name }}</td>
<td>{{ group.comment }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="form-group">
<div class="col-sm-4 col-sm-offset-2">
<button class="btn btn-white" type="submit">鍙栨秷</button>
<button id="submit_button" class="btn btn-primary" type="submit">纭鍒犻櫎</button>
</div>
</div>
</form>
</div>
</div>
</div>