Adding profiles pictures

Adding gitignore
First try for the kart dashboard
This commit is contained in:
2019-04-21 01:02:46 +02:00
parent 97e322b0e9
commit d651d0f6b9
25 changed files with 620 additions and 11 deletions

View File

@ -1,3 +1,8 @@
timelapsStorage = localStorage;
if(typeof timelapsStorage.current_kart_id === "undefined"){
timelapsStorage.setItem('current_kart_id', null);
}
function getKartsMenu() {
$.ajax({
type: 'GET',
@ -5,9 +10,14 @@ function getKartsMenu() {
url: api_url + 'karts/',
dataType: 'json',
success: function (data, status) {
$.each(data, function (index, value) {
actual_kart = timelapsStorage.current_kart_id;
$.each(data.reverse(), function (index, value) {
btn_class = 'btn-light';
if(actual_kart == value.id ){
btn_class = 'btn-primary';
}
$('#link_all').after("" +
"&nbsp;<a id=\"link_" + value.id + "\" href=\"#\" class=\"btn btn-light btn-icon-split btn-sm\">\n" +
"&nbsp;<a id=\"link_" + value.id + "\" href=\"#\" onclick=\"showKartDashboard("+value.id+")\" class=\"btn "+btn_class+" btn-icon-split btn-sm\">\n \n" +
" <span class=\"icon text-gray-600\">\n" +
" <i class=\"fas fa-car\"></i>\n" +
"</span>\n" +
@ -88,10 +98,10 @@ function listKarts() {
url: api_url + 'karts/',
dataType: 'json',
success: function (data, status) {
if (tableListKart instanceof $.fn.dataTable.Api) {
tableListKart.destroy();
if ($.fn.DataTable.isDataTable("#dataTable_kart_list")) {
$('#dataTable_kart_list').DataTable().destroy();
}
tableListKart = $('#dataTable_kart_list').DataTable({
$('#dataTable_kart_list').DataTable({
data: data,
columns: [
{
@ -389,3 +399,12 @@ function deleteDriver(id, kart_id, row_index) {
},
});
}
function startRace() {
}
function showKartDashboard(kart_id) {
timelapsStorage.setItem('current_kart_id', kart_id);
window.location.href='index_kart.html';
}