Commit 94c96d59 authored by thejoelinux's avatar thejoelinux

correction mauvais index sur 2 controllers et suppr. slider

parent 85b7798c
......@@ -12,6 +12,10 @@ class LoansController extends AppController {
$this->render($this->$function_name());
}
function _index() {
return $this->_list();
}
function _new() {
$classname = $this->model;
$object = new $classname(0);
......
......@@ -12,6 +12,10 @@ class ReservationsController extends AppController {
$this->render($this->$function_name());
}
function _index() {
return $this->_list();
}
function _new() {
$classname = $this->model;
$object = new $classname(0);
......
......@@ -16,12 +16,6 @@
</div>
<div class="panel-body">
<div id="slider_div">
Age :
<b>3</b>
<input id="age_range" type="text" data-slider-min="0" data-slider-max="20" data-slider-step="1" data-slider-value="10"/>
<b>99</b>
</div>
<div class="col-sm-12" align="center">
<table id="list_games" style="display:none">
......@@ -59,25 +53,6 @@
</div>
<script>
$(document).ready(function() {
var age_slider = $('#age_range').slider({})
.on("change", function(obj) {
//console.log(obj);
table.draw();
});
$.fn.dataTable.ext.search.push(
function( settings, data, dataIndex ) {
//var min = parseInt( $('#age_range').getValue()[0], 10 );
//var max = parseInt( $('#age_range').getValue()[1], 10 );
var age = age_slider.slider('getValue');
var min_age = parseInt( data[1] ) || 0; // use data for the age column
var max_age = parseInt( data[2] ) || 0; // use data for the age column
if ( age >= min_age && age <= max_age ) {
return true;
}
return false;
}
);
var table = $('#list_games').DataTable({
"autoWidth": false,
"fnDrawCallback": function() {
......@@ -85,9 +60,7 @@ $(document).ready(function() {
},
"language": {
"url": "js/dataTables.french.json"
},
"dom": '<"slider_div">frtip'
}
});
$('#new_button').click(function(){
$('#a').val('new');
......@@ -95,8 +68,5 @@ $(document).ready(function() {
});
});
/* FIXME : translation of the table
see https://datatables.net/plug-ins/i18n/French
*/
</script>
{% endblock %}
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