delphimvcframework/samples/serversideviewsprimer/bin/templates/people_list.html
2016-11-27 23:18:32 +01:00

51 lines
1.1 KiB
HTML

<div class="row_fluid">
<div class="col-sm-12">
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>First name</th>
<th>Last name</th>
<th>Age</th>
<th>&nbsp;</th>
</tr>
</thead>
<tbody>
{{^people}}
<tr>
<td class="text-center" colspan="4">&lt;&lt;No People Found&gt;&gt;</td>
</tr>
{{/people}}
{{#people}}
<tr>
<td>{{-index}}</td>
<td>{{first_name}}</td>
<td>{{last_name}}</td>
<td>{{age}}</td>
<td><button class="btn btn-danger" onclick="doDelete('{{guid}}')"><span class="glyphicon glyphicon-remove" aria-hidden="true"></span> Delete</button></td>
</tr>
{{/people}}
</tbody>
</table>
</div>
</div>
<br>
<div class="row_fluid">
<div class="col-sm-2 col-sm-offset-10">
<a class="btn btn-primary btn-block" href="/newperson">Add New Person</a>
</div>
</div>
<script>
function doDelete(guid){
if (confirm("Are you sure?")){
$.ajax({
url: '/people/' + guid,
type: 'DELETE',
success: function(result) {
location.href = '/people';
}
});
}
}
</script>