Ich Ich, gros commit
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
|
||||
/**
|
||||
* First we will load all of this project's JavaScript dependencies which
|
||||
* includes Vue and other libraries. It is a great starting point when
|
||||
@ -6,26 +5,31 @@
|
||||
*/
|
||||
|
||||
require('./bootstrap');
|
||||
|
||||
window.Vue = require('vue');
|
||||
//window.Vue = require('vue');
|
||||
|
||||
/**
|
||||
* Next, we will create a fresh Vue application instance and attach it to
|
||||
* the page. Then, you may begin adding components to this application
|
||||
* or customize the JavaScript scaffolding to fit your unique needs.
|
||||
*/
|
||||
|
||||
/*
|
||||
Vue.component('example-component', require('./components/ExampleComponent.vue'));
|
||||
|
||||
const app = new Vue({
|
||||
el: '#app'
|
||||
});
|
||||
|
||||
*/
|
||||
try {
|
||||
window.$ = window.jQuery = require('jquery');
|
||||
require('bootstrap');
|
||||
require('@fortawesome/fontawesome-free/js/all.js');
|
||||
} catch (e) {}
|
||||
//require('moment');
|
||||
window.moment = require('moment');
|
||||
require('tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.js');
|
||||
require('datatables.net-bs4');
|
||||
require('datatables.net-dt');
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
/* Set the width of the side navigation to 250px and the left margin of the page content to 250px */
|
||||
window.openNav = function () {
|
||||
@ -38,8 +42,117 @@ window.openNav = function () {
|
||||
|
||||
/* Set the width of the side navigation to 0 and the left margin of the page content to 0 */
|
||||
window.closeNav = function () {
|
||||
document.getElementById("mySidenav").style.width = "90px",
|
||||
document.getElementById("mySidenav").classList.add("closed");
|
||||
document.getElementById("mySidenav").classList.remove("opened");
|
||||
document.getElementById("mySidenav").style.width = "90px";
|
||||
document.getElementById("mySidenav").classList.add("closed");
|
||||
document.getElementById("mySidenav").classList.remove("opened");
|
||||
document.getElementById("main").style.marginLeft = "90px";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
window.getallkarts = function () {
|
||||
|
||||
selected_kartid = getCookie('active_kartid');
|
||||
selected_kartname = getCookie('active_kartname');
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/getkartsalldata',
|
||||
data: {},
|
||||
success: function (data) {
|
||||
$("#btnChoiceKart").html("");
|
||||
$.each(data.data, function (k, v) {
|
||||
|
||||
if (selected_kartid == v.id) {
|
||||
$("#kartid").val(v.id);
|
||||
$('#btnChoiceKartTitle').html(v.name);
|
||||
}
|
||||
|
||||
$("#btnChoiceKart").append("<a class='dropdown-item' onclick='reloadData(" + v.id + ",String(\"" + v.name + "\"))' >" + v.name + "</a>");
|
||||
});
|
||||
|
||||
if ($("#kartid").val() == "") {
|
||||
$('#btnChoiceKartTitle').html('Choix du kart');
|
||||
}
|
||||
$("#btnChoiceKart").append("<div class=\"dropdown-divider\"></div>");
|
||||
$("#btnChoiceKart").append("<a class=\"dropdown-item\" onclick='reloadData(null,\"Vue générale\")'>Vue générale</a>");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
window.getallraces = function () {
|
||||
|
||||
|
||||
selected_raceid = getCookie('active_raceid');
|
||||
selected_racename = getCookie('active_racename');
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/getsmallraces',
|
||||
success: function (data) {
|
||||
console.log(data.data);
|
||||
$("#btnChoiceRace").html("");
|
||||
$.each(data.data, function (k, v) {
|
||||
|
||||
if (selected_raceid == v.id) {
|
||||
$("#raceid").val(v.id);
|
||||
$('#btnChoiceRaceTitle').html(v.name);
|
||||
}
|
||||
|
||||
$("#btnChoiceRace").append("<a class='dropdown-item' onclick='reloadRaceData(" + v.id + ",String(\"" + v.name + "\"))' >" + v.name + "</a>");
|
||||
});
|
||||
|
||||
if ($("#raceid").val() == "") {
|
||||
$('#btnChoiceRaceTitle').html('Choix de la course');
|
||||
}
|
||||
$("#btnChoiceRace").append("<div class=\"dropdown-divider\"></div>");
|
||||
$("#btnChoiceRace").append("<a class=\"dropdown-item\" onclick='reloadData(null,\"Vue générale\")'>Vue générale</a>");
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
window.reloadRaceData = function (id, name) {
|
||||
|
||||
document.cookie = "active_raceid=" + id;
|
||||
document.cookie = "active_racename=" + name;
|
||||
|
||||
if (name != null)
|
||||
$('#btnChoiceRaceTitle').html(name);
|
||||
|
||||
}
|
||||
|
||||
window.getCookie = function (cname) {
|
||||
var name = cname + "=";
|
||||
var decodedCookie = decodeURIComponent(document.cookie);
|
||||
var ca = decodedCookie.split(';');
|
||||
for (var i = 0; i < ca.length; i++) {
|
||||
var c = ca[i];
|
||||
while (c.charAt(0) == ' ') {
|
||||
c = c.substring(1);
|
||||
}
|
||||
if (c.indexOf(name) == 0) {
|
||||
return c.substring(name.length, c.length);
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
|
||||
$(() => {
|
||||
moment.locale('fr');
|
||||
getallraces();
|
||||
getallkarts();
|
||||
})
|
||||
//<a class="dropdown-item" href="/?name=chooseKart&kartID=0">Vue générale</a>
|
||||
|
||||
|
35
resources/lang/datatable_fr.json
Normal file
35
resources/lang/datatable_fr.json
Normal file
@ -0,0 +1,35 @@
|
||||
/**
|
||||
* French translation
|
||||
* @name French
|
||||
* @anchor French
|
||||
* @author
|
||||
*/
|
||||
|
||||
{
|
||||
"sProcessing": "Traitement en cours...",
|
||||
"sSearch": "Rechercher :",
|
||||
"sLengthMenu": "Afficher _MENU_ éléments",
|
||||
"sInfo": "Affichage de l'élément _START_ à _END_ sur _TOTAL_ éléments",
|
||||
"sInfoEmpty": "Affichage de l'élément 0 à 0 sur 0 élément",
|
||||
"sInfoFiltered": "(filtré de _MAX_ éléments au total)",
|
||||
"sInfoPostFix": "",
|
||||
"sLoadingRecords": "Chargement en cours...",
|
||||
"sZeroRecords": "Aucun élément à afficher",
|
||||
"sEmptyTable": "Aucune donnée disponible dans le tableau",
|
||||
"oPaginate": {
|
||||
"sFirst": "Premier",
|
||||
"sPrevious": "Précédent",
|
||||
"sNext": "Suivant",
|
||||
"sLast": "Dernier"
|
||||
},
|
||||
"oAria": {
|
||||
"sSortAscending": ": activer pour trier la colonne par ordre croissant",
|
||||
"sSortDescending": ": activer pour trier la colonne par ordre décroissant"
|
||||
},
|
||||
"select": {
|
||||
"rows": {
|
||||
"_": "%d lignes séléctionnées",
|
||||
"0": "Aucune ligne séléctionnée",
|
||||
"1": "1 ligne séléctionnée"
|
||||
}
|
||||
}
|
@ -1,6 +1,8 @@
|
||||
|
||||
// Body
|
||||
$body-bg: #343a40;
|
||||
$body-text-bg: #a3b3c6;
|
||||
$body-light-bg: #E2E7ED;
|
||||
|
||||
// Typography
|
||||
$font-family-sans-serif: "Nunito", sans-serif;
|
||||
@ -18,6 +20,7 @@ $yellow: #ffed4a;
|
||||
$green: #38c172;
|
||||
$teal: #4dc0b5;
|
||||
$cyan: #6cb2eb;
|
||||
$black: #111;
|
||||
|
||||
// Card
|
||||
$card-border-width: 4px;
|
||||
|
@ -4,6 +4,10 @@
|
||||
@import 'variables';
|
||||
// Bootstrap
|
||||
@import '~bootstrap/scss/bootstrap';
|
||||
//Datatables
|
||||
@import '~datatables.net-bs4/css/dataTables.bootstrap4.min.css';
|
||||
//DatePicker
|
||||
@import '~tempusdominus-bootstrap-4/build/css/tempusdominus-bootstrap-4.min.css';
|
||||
|
||||
.navbar-laravel {
|
||||
background-color: #fff;
|
||||
@ -19,16 +23,21 @@ $card-border-width: 4px;
|
||||
$card-border-radius: .3rem;
|
||||
$card-border-color: rgba(255, 242, 242, .3);
|
||||
|
||||
//MainNavbar
|
||||
#mainNav {
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
//Sidebar
|
||||
/* The side navigation menu */
|
||||
.sidenav {
|
||||
height: 100%; /* 100% Full-height */
|
||||
width: 90px; /* 0 width - change this with JavaScript */
|
||||
position: fixed; /* Stay in place */
|
||||
z-index: 1; /* Stay on top */
|
||||
z-index: 1000; /* Stay on top */
|
||||
top: 0; /* Stay at the top */
|
||||
left: 0;
|
||||
background-color: #111; /* Black*/
|
||||
background-color: $black; /* Black*/
|
||||
overflow-x: hidden; /* Disable horizontal scroll */
|
||||
padding-top: 60px; /* Place content 60px from the top */
|
||||
transition: 0.5s; /* 0.5 second transition effect to slide in the sidenav */
|
||||
@ -37,10 +46,12 @@ $card-border-color: rgba(255, 242, 242, .3);
|
||||
.closed > a > span {
|
||||
display: none;
|
||||
}
|
||||
.opened a.openbtn {
|
||||
|
||||
.opened .openbtn {
|
||||
display: none;
|
||||
}
|
||||
.closed a.closebtn {
|
||||
|
||||
.closed .closebtn {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@ -52,6 +63,7 @@ $card-border-color: rgba(255, 242, 242, .3);
|
||||
color: #818181;
|
||||
display: block;
|
||||
transition: 0.3s;
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
/* When you mouse over the navigation links, change their color */
|
||||
@ -67,6 +79,7 @@ $card-border-color: rgba(255, 242, 242, .3);
|
||||
font-size: 36px;
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.sidenav .openbtn {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
@ -75,6 +88,10 @@ $card-border-color: rgba(255, 242, 242, .3);
|
||||
margin-left: 50px;
|
||||
}
|
||||
|
||||
.sidenav a.active {
|
||||
color: #f1f1f1 !important;
|
||||
}
|
||||
|
||||
/* Style page content - use this if you want to push the page content to the right when you open the side navigation */
|
||||
#main {
|
||||
transition: margin-left .5s;
|
||||
@ -90,4 +107,59 @@ $card-border-color: rgba(255, 242, 242, .3);
|
||||
.sidenav a {
|
||||
font-size: 18px;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//BOuton de selection du karting
|
||||
.btn {
|
||||
border-color:$body-light-bg;
|
||||
padding: 0.35rem 1.5rem;
|
||||
color: $body-text-bg!important;
|
||||
background-color: transparent;
|
||||
background-image: none;
|
||||
}
|
||||
|
||||
.dropdown-menu{
|
||||
top: 100%;
|
||||
text-align: left;
|
||||
display: none;
|
||||
position: absolute;
|
||||
z-index: 101;
|
||||
padding-top: 0;
|
||||
width: 245px;
|
||||
border-radius: 4px;
|
||||
-webkit-transform: translateZ(0);
|
||||
transform: translateZ(0);
|
||||
-webkit-transform-style: preserve-3d;
|
||||
-webkit-backface-visibility: hidden;
|
||||
backface-visibility: hidden;
|
||||
border-color: $body-light-bg;
|
||||
color: $body-bg!important;
|
||||
}
|
||||
.dropdown-item:hover{
|
||||
cursor: pointer;
|
||||
color: $body-bg!important;
|
||||
}
|
||||
|
||||
.textarea-form {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
//Widgets Admin
|
||||
.widget-thumb {
|
||||
padding: 20px 10px 20px 10px;
|
||||
border-radius: 4px;
|
||||
vertical-align: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.widget-thumb:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.widget-thumb-red {
|
||||
background-color: #E7505A !important;
|
||||
}
|
||||
|
||||
.widget-thumb-blue {
|
||||
background-color: #0076A8 !important;
|
||||
}
|
||||
|
0
resources/sass/metronic.scss
Executable file
0
resources/sass/metronic.scss
Executable file
62
resources/views/admin/create.blade.php
Normal file
62
resources/views/admin/create.blade.php
Normal file
@ -0,0 +1,62 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Paramétrer la course')
|
||||
@endslot
|
||||
<form method="POST" action="{{ route('race.store') }}">
|
||||
{{ csrf_field() }}
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Nom'),
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Date de début'),
|
||||
'type' => 'date',
|
||||
'name' => 'start_date',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Date de fin'),
|
||||
'type' => 'date',
|
||||
'name' => 'end_date',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Durée'),
|
||||
'type' => 'integer',
|
||||
'name' => 'duration',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Autonomie du karting (Sec)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'autonomie_kart_sec',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Autonomie du karting (Humide)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'autonomie_kart_humide',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Durée des relais par défaut (Minutes)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'relay_default_duration',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Duree dans les stands minimum (Minutes)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'stand_duration',
|
||||
'required' => true,
|
||||
])
|
||||
@component('components.button')
|
||||
@lang('Envoyer')
|
||||
@endcomponent
|
||||
</form>
|
||||
@endcomponent
|
||||
@endsection
|
29
resources/views/admin/index.blade.php
Executable file
29
resources/views/admin/index.blade.php
Executable file
@ -0,0 +1,29 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="widget-thumb widget-thumb-blue" onclick="location.href ='/race'">
|
||||
<div class="widget-thumb-wrap">
|
||||
<div class="widget-thumb-body">
|
||||
<h4 class="widget-thumb-heading-white">Gérer les courses</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="widget-thumb widget-thumb-red" onclick="location.href ='/race'">
|
||||
<h4 class="widget-thumb-heading-white">Gérer le championnat</h4>
|
||||
<div class="widget-thumb-wrap">
|
||||
<div class="widget-thumb-body">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(() => {
|
||||
console.log('Admin');
|
||||
})
|
||||
</script>
|
||||
@endsection
|
9
resources/views/admin/show.blade.php
Normal file
9
resources/views/admin/show.blade.php
Normal file
@ -0,0 +1,9 @@
|
||||
@extends('layouts.form')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Ajouter une team')
|
||||
@endslot
|
||||
|
||||
@endcomponent
|
||||
@endsection
|
10
resources/views/components/kartChoice.blade.php
Executable file
10
resources/views/components/kartChoice.blade.php
Executable file
@ -0,0 +1,10 @@
|
||||
<div id="{{$idContainer}}" class="btn-group show">
|
||||
<button id="{{$btnId}}" type="button" class="btn dropdown-toggle dropdown-toggle-split" data-toggle="dropdown" aria-haspopup="true" aria-expanded="true">
|
||||
{{$btnText}}
|
||||
<span class="sr-only">Toggle Dropdown</span>
|
||||
</button>
|
||||
<div id="{{$divId}}" class="dropdown-menu dropdown-menu-right" x-placement="bottom-end" style="position: absolute; transform: translate3d(-32px, 38px, 0px); top: 0px; left: 0px; will-change: transform;">
|
||||
<div class="dropdown-divider"></div>
|
||||
<a class="dropdown-item" onclick="{{$onclickAction}}">{{$onclickText}}</a>
|
||||
</div>
|
||||
</div>
|
@ -3,7 +3,7 @@
|
||||
@section('content')
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-md-8">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header">Dashboard</div>
|
||||
|
||||
@ -15,6 +15,8 @@
|
||||
@endif
|
||||
|
||||
You are logged in!
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -4,7 +4,7 @@
|
||||
@slot('title')
|
||||
@lang('Ajouter un karting')
|
||||
@endslot
|
||||
<form method="POST" action="{{ route('kart.store') }}">
|
||||
<form method="POST" action="{{ url('kart') }}">
|
||||
{{ csrf_field() }}
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Nom'),
|
||||
|
60
resources/views/kart/index.blade.php
Executable file
60
resources/views/kart/index.blade.php
Executable file
@ -0,0 +1,60 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Liste des kartings - ') <a href="{{route("kart.create")}}"><i class="far fa-plus-square"></i></a>
|
||||
@endslot
|
||||
|
||||
<table class="table table-bordered" id="pilots-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Nom du karting</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
var tableKarts = '';
|
||||
|
||||
|
||||
window.deletePilot = function (id) {
|
||||
$.ajax({
|
||||
url: '/kart/'+id,
|
||||
type: 'DELETE', // user.destroy
|
||||
success: function(result) {
|
||||
console.log('OK');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.reloadData = function (id, name) {
|
||||
|
||||
|
||||
document.cookie = "active_kartid=" + id;
|
||||
document.cookie = "active_kartname=" + name;
|
||||
|
||||
if (name != null)
|
||||
$('#btnChoiceKartTitle').html(name);
|
||||
}
|
||||
|
||||
$(() => {
|
||||
|
||||
tableKarts = $('#pilots-table').DataTable({
|
||||
processing: true,
|
||||
ajax: '/getkartsalldata',
|
||||
columns: [
|
||||
{
|
||||
data: 'id',
|
||||
searchable: false,
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return '<a onclick="deleteKart(' + data + ');tableKarts.row( $(this).parents(\'tr\') ).remove().draw();"><i class="far fa-trash-alt"></i></a>';
|
||||
}
|
||||
},
|
||||
{data: 'name'}
|
||||
]
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endcomponent
|
||||
@endsection
|
@ -7,32 +7,13 @@
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<title>{{ config('app.name', 'Album') }}</title>
|
||||
<link href="{{ asset('css/app.css') }}" rel="stylesheet">
|
||||
<link href="{{ asset('css/metronic.css') }}" rel="stylesheet">
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
@yield('css')
|
||||
</head>
|
||||
<body>
|
||||
<div id="mySidenav" class="sidenav closed">
|
||||
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()"><i class="fas fa-times"></i></a>
|
||||
<img src="{{ url('img/timelaps-logo.png') }}" >
|
||||
<a href="javascript:void(0)" class="openbtn" onclick="openNav()"><i class="fas fa-bars"></i></a>
|
||||
<br>
|
||||
<a href="#"><i class="fas fa-tachometer-alt"></i> <span>Dashboard</span></a>
|
||||
<a href="#"><i class="fas fa-car-crash"></i> <span>Karts</span></a>
|
||||
<a href="#"><i class="fab fa-accessible-icon"></i> <span>Pilotes</span></a>
|
||||
<a href="#"><i class="fas fa-cogs"></i> <span>Paramètres</span></a>
|
||||
<a href="#"><i class="fas fa-flag-checkered"></i> <span>Démarrer</span></a>
|
||||
<a id="logout" class="nav-link" href="{{ route('logout') }}"><i class="fas fa-sign-out-alt"></i> <span>@lang('Déconnexion')</span></a>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="hide">
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div id="main">
|
||||
<!--<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark">
|
||||
<a class="navbar-brand" href="{{ route('home') }}">{{ config('app.name', 'Album') }}</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<nav id="mainNav" class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark">
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@guest
|
||||
@ -43,6 +24,26 @@
|
||||
href="{{ route('register') }}">@lang('Inscription')</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="nav-item">
|
||||
@component('components.kartChoice')
|
||||
@slot('idContainer') btnChoiceRaceContainer @endslot
|
||||
@slot('btnId') btnChoiceRaceTitle @endslot
|
||||
@slot('btnText') Choix de la course @endslot
|
||||
@slot('divId') btnChoiceRace @endslot
|
||||
@slot('onclickAction') reloadRaceData(null, 'Choix de la course') @endslot
|
||||
@slot('onclickText') Choix de la course @endslot
|
||||
@endcomponent
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
@component('components.kartChoice')
|
||||
@slot('idContainer') btnChoiceKartContainer @endslot
|
||||
@slot('btnId') btnChoiceKartTitle @endslot
|
||||
@slot('btnText') Choix du kart @endslot
|
||||
@slot('divId') btnChoiceKart @endslot
|
||||
@slot('onclickAction') reloadData(null, 'Choix du kart') @endslot
|
||||
@slot('onclickText') Choix du kart @endslot
|
||||
@endcomponent
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a id="logout" class="nav-link" href="{{ route('logout') }}">@lang('Déconnexion')</a>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="hide">
|
||||
@ -52,8 +53,58 @@
|
||||
@endguest
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
<div id="mySidenav" class="sidenav closed">
|
||||
<a href="javascript:void(0)" class="closebtn" onclick="closeNav()"><i class="fas fa-times"></i></a>
|
||||
<img class="closebtn" src="{{ url('img/timelaps-logo3.png') }}">
|
||||
<a href="javascript:void(0)" class="openbtn" onclick="openNav()"><i class="fas fa-bars"></i></a>
|
||||
<br>
|
||||
@admin
|
||||
<a class="{{ currentRoute(route('admin.index')) }}" href="{{ route('admin.index') }}"><i class="fas fa-road"></i> <span>Admin dash</span></a>
|
||||
@endadmin
|
||||
<a class="{{ currentRoute(route('relay.index')) }}" href="{{ route('relay.index') }}"><i class="fas fa-tachometer-alt"></i> <span>Vue course</span></a>
|
||||
<a class="{{ currentRoute(route('kart.index')) }}" href="{{ route('kart.index') }}"><i class="fas fa-car-crash"></i> <span>Karts</span></a>
|
||||
<a class="{{ currentRoute(route('pilot.index')) }}" href="{{ route('pilot.index') }}"><i class="fab fa-accessible-icon"></i> <span>Pilotes</span></a>
|
||||
<a class="{{ currentRoute(route('race')) }}" href="{{ route('race') }}"><i class="fas fa-cogs"></i> <span>Paramètres</span></a>
|
||||
<a class="{{ currentRoute(route('home')) }}" href="{{ route('home') }}"><i class="fas fa-flag-checkered"></i> <span>Démarrer</span></a>
|
||||
<a id="logout" class="nav-link" href="{{ route('logout') }}"><i
|
||||
class="fas fa-sign-out-alt"></i> <span>@lang('Déconnexion')</span></a>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="hide">
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<imput id='kartid' type="hidden" value=""></imput>
|
||||
<imput id='raceid' type="hidden" value=""></imput>
|
||||
|
||||
<div id="main">
|
||||
<!--<nav class="navbar fixed-top navbar-expand-lg navbar-dark bg-dark">
|
||||
<a class="navbar-brand" href="{{ route('home') }}">{{ config('app.name', 'Album') }}</a>
|
||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent"
|
||||
aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@guest
|
||||
<li class="nav-item{{ currentRoute(route('login')) }}"><a class="nav-link"
|
||||
href="{{ route('login') }}">@lang('Connexion')</a>
|
||||
</li>
|
||||
<li class="nav-item{{ currentRoute(route('register')) }}"><a class="nav-link"
|
||||
href="{{ route('register') }}">@lang('Inscription')</a>
|
||||
</li>
|
||||
@else
|
||||
<li class="nav-item">
|
||||
<a id="logout" class="nav-link" href="{{ route('logout') }}">@lang('Déconnexion')</a>
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="hide">
|
||||
{{ csrf_field() }}
|
||||
</form>
|
||||
</li>
|
||||
@endguest
|
||||
</ul>
|
||||
</div>
|
||||
</nav>-->
|
||||
@yield('content')
|
||||
@yield('content')
|
||||
|
||||
</div>
|
||||
<script src="{{ asset('js/app.js') }}"></script>
|
||||
|
10
resources/views/layouts/loggedform.blade.php
Executable file
10
resources/views/layouts/loggedform.blade.php
Executable file
@ -0,0 +1,10 @@
|
||||
@extends('layouts.logged')
|
||||
@section('content')
|
||||
<div class="container ">
|
||||
<div class="row">
|
||||
<div class="col-md-10 offset-md-1">
|
||||
@yield('card')
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
73
resources/views/pilot/create.blade.php
Executable file
73
resources/views/pilot/create.blade.php
Executable file
@ -0,0 +1,73 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Ajouter un pilote')
|
||||
@endslot
|
||||
<form method="POST" action="{{url('pilot')}}">
|
||||
{{ csrf_field() }}
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Prénom du pilote'),
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Nom du pilote'),
|
||||
'type' => 'text',
|
||||
'name' => 'first_name',
|
||||
'required' => true,
|
||||
])
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Temp de référence'),
|
||||
'type' => 'text',
|
||||
'name' => 'ref_time',
|
||||
'required' => true,
|
||||
])
|
||||
<div class="form-group">
|
||||
<label for="first_name">Nom du pilote</label>
|
||||
<select id="kart_id" class="form-control" name="kart_id" >
|
||||
</select>
|
||||
|
||||
</div>
|
||||
@component('components.button')
|
||||
@lang('Envoyer')
|
||||
@endcomponent
|
||||
</form>
|
||||
@endcomponent
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(() => {
|
||||
|
||||
$.ajaxSetup({
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
}
|
||||
});
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/getkartsalldata',
|
||||
data: {},
|
||||
success: function (data) {
|
||||
$( "#kart_id" ).html("");
|
||||
$.each(data.data, function(k, v) {
|
||||
|
||||
if( $( "#kart_id" ).val() == v.id){
|
||||
$('#kart_id').append($('<option>', {
|
||||
value: v.id,
|
||||
selected:true,
|
||||
text: v.name
|
||||
}));
|
||||
}else{
|
||||
$('#kart_id').append($('<option>', {
|
||||
value: v.id,
|
||||
text: v.name
|
||||
}));
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endsection
|
93
resources/views/pilot/index.blade.php
Executable file
93
resources/views/pilot/index.blade.php
Executable file
@ -0,0 +1,93 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Liste des pilotes - ') <a href="{{route("pilot.create")}}"><i class="far fa-plus-square"></i></a>
|
||||
@endslot
|
||||
|
||||
<table class="table table-bordered" id="pilots-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>kart_name</th>
|
||||
<th>Name</th>
|
||||
<th>first_name</th>
|
||||
<th>ref_time</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
<script type="text/javascript">
|
||||
var tablePilots = '';
|
||||
|
||||
|
||||
window.deletePilot = function (id) {
|
||||
$.ajax({
|
||||
url: '/pilot/' + id,
|
||||
type: 'DELETE', // user.destroy
|
||||
success: function (result) {
|
||||
console.log('OK');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.reloadData = function (id, name) {
|
||||
|
||||
|
||||
document.cookie = "active_kartid=" + id;
|
||||
document.cookie = "active_kartname=" + name;
|
||||
|
||||
if (name != null)
|
||||
$('#btnChoiceKartTitle').html(name);
|
||||
|
||||
|
||||
$.ajax({
|
||||
url: '/getpilotsBykart',
|
||||
data: {id: id},
|
||||
success: function (data) {
|
||||
|
||||
$("#kartid").val(id);
|
||||
if (tablePilots != '')
|
||||
tablePilots.destroy();
|
||||
tablePilots = $('#pilots-table').DataTable({
|
||||
data: data.data,
|
||||
columns: [
|
||||
{
|
||||
data: 'id',
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return '<a onclick="deletePilot(' + data + ');tablePilots.row( $(this).parents(\'tr\') ).remove().draw();"><i class="far fa-trash-alt"></i></a>';
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'kart_name'
|
||||
}
|
||||
,
|
||||
{
|
||||
data: 'name'
|
||||
}
|
||||
,
|
||||
{
|
||||
data: 'first_name'
|
||||
}
|
||||
,
|
||||
{
|
||||
data: 'ref_time',
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return moment.utc(data*1000).format('mm:ss');
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
})
|
||||
;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(() => {
|
||||
reloadData(getCookie('active_kartid'), getCookie('active_kartname'));
|
||||
})
|
||||
</script>
|
||||
@endcomponent
|
||||
@endsection
|
9
resources/views/pilot/show.blade.php
Executable file
9
resources/views/pilot/show.blade.php
Executable file
@ -0,0 +1,9 @@
|
||||
@extends('layouts.form')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Ajouter une team')
|
||||
@endslot
|
||||
|
||||
@endcomponent
|
||||
@endsection
|
87
resources/views/race/create.blade.php
Executable file
87
resources/views/race/create.blade.php
Executable file
@ -0,0 +1,87 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Paramétrer la course')
|
||||
@endslot
|
||||
<form method="POST" action="{{ route('race.store') }}">
|
||||
{{ csrf_field() }}
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Nom'),
|
||||
'type' => 'text',
|
||||
'name' => 'name',
|
||||
'required' => true,
|
||||
])
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
||||
<div class="form-group">
|
||||
<label for="start_date">Date de début</label>
|
||||
<div class="input-group date" id="datetimepicker2" data-target-input="nearest">
|
||||
<input type="text" class="form-control datetimepicker-input" name="start_date"
|
||||
required="true"
|
||||
data-target="#datetimepicker2" data-toggle="datetimepicker"/>
|
||||
<div class="input-group-append" data-target="#datetimepicker2" data-toggle="datetimepicker">
|
||||
<div class="input-group-text"><i class="fa fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Autonomie du karting (Sec)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'autonomie_kart_sec',
|
||||
'required' => true,
|
||||
])
|
||||
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Durée des relais par défaut (Minutes)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'relay_default_duration',
|
||||
'required' => true,
|
||||
])
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Durée'),
|
||||
'type' => 'integer',
|
||||
'name' => 'duration',
|
||||
'required' => true,
|
||||
])
|
||||
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Autonomie du karting (Humide)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'autonomie_kart_humide',
|
||||
'required' => true,
|
||||
])
|
||||
|
||||
@include('partials.form-group', [
|
||||
'title' => __('Duree dans les stands minimum (Minutes)'),
|
||||
'type' => 'integer',
|
||||
'name' => 'stand_duration',
|
||||
'required' => true,
|
||||
])
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="comment">Commentaire</label><br />
|
||||
<textarea class="textarea-form" name="comment" rows="5" cols="50">
|
||||
</textarea>
|
||||
</div>
|
||||
|
||||
@component('components.button')
|
||||
@lang('Envoyer')
|
||||
@endcomponent
|
||||
</form>
|
||||
<script>
|
||||
|
||||
$(() => {
|
||||
$('#datetimepicker2').datetimepicker({
|
||||
locale: 'fr',
|
||||
format:'YYYY-MM-DD HH:mm:ss'
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endcomponent
|
||||
@endsection
|
85
resources/views/race/index.blade.php
Executable file
85
resources/views/race/index.blade.php
Executable file
@ -0,0 +1,85 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Liste des courses - ') <a href="{{route("race.create")}}"><i class="far fa-plus-square"></i></a>
|
||||
@endslot
|
||||
|
||||
|
||||
<table class="table table-bordered" id="race-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th></th>
|
||||
<th>Nom</th>
|
||||
<th>Date de début</th>
|
||||
<th>Durée de la course</th>
|
||||
<th>Durée relai</th>
|
||||
<th>Durée stand</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
|
||||
<script type="text/javascript">
|
||||
var tableRaces = '';
|
||||
|
||||
$(() => {
|
||||
$.ajax({
|
||||
url: '/getraces',
|
||||
success: function (data) {
|
||||
|
||||
tableRaces = $('#race-table').DataTable({
|
||||
data: data.data,
|
||||
columns: [
|
||||
{
|
||||
data: 'id',
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return '<a href="/race/' + data + '" "><i class="far fa-edit"></i></a>';
|
||||
}
|
||||
},
|
||||
{
|
||||
data: 'name'
|
||||
}
|
||||
,
|
||||
{
|
||||
data: 'start_date',
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return moment.utc(data).format('DD/MM/YYYY hh:mm:ss');
|
||||
}
|
||||
}
|
||||
,
|
||||
{
|
||||
data: 'duration',
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return moment.utc(data * 1000 * 60).format('mm:ss');
|
||||
}
|
||||
}
|
||||
,
|
||||
{
|
||||
data: 'relay_default_duration',
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return moment.utc(data * 1000).format('mm:ss');
|
||||
}
|
||||
|
||||
}
|
||||
,
|
||||
{
|
||||
data: 'stand_duration',
|
||||
render:
|
||||
function (data, type, row, meta) {
|
||||
return moment.utc(data * 1000).format('mm:ss');
|
||||
}
|
||||
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endcomponent
|
||||
@endsection
|
9
resources/views/race/show.blade.php
Executable file
9
resources/views/race/show.blade.php
Executable file
@ -0,0 +1,9 @@
|
||||
@extends('layouts.form')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('Ajouter une team')
|
||||
@endslot
|
||||
|
||||
@endcomponent
|
||||
@endsection
|
42
resources/views/relay/index.blade.php
Executable file
42
resources/views/relay/index.blade.php
Executable file
@ -0,0 +1,42 @@
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
@lang('YO les ptits loups - ') <a href="{{route("pilot.create")}}"><i class="far fa-plus-square"></i></a>
|
||||
@endslot
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
var tableRelays = '';
|
||||
var pilots = '';
|
||||
var raceParams = '';
|
||||
|
||||
window.reloadData = function (id, name) {
|
||||
|
||||
document.cookie = "active_kartid=" + id;
|
||||
document.cookie = "active_kartname=" + name;
|
||||
|
||||
if (name != null)
|
||||
$('#btnChoiceKartTitle').html(name);
|
||||
|
||||
$.ajax({
|
||||
url: '/getpilotsBykart',
|
||||
data: {id: id},
|
||||
success: function (data) {
|
||||
pilots = data.data;
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: '/getRaceParams',
|
||||
success: function (data) {
|
||||
raceParams = data.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(() => {
|
||||
reloadData(getCookie('active_kartid'), getCookie('active_kartname'));
|
||||
})
|
||||
</script>
|
||||
@endsection
|
@ -1,4 +1,4 @@
|
||||
@extends('layouts.form')
|
||||
@extends('layouts.loggedform')
|
||||
@section('card')
|
||||
@component('components.card')
|
||||
@slot('title')
|
||||
|
Reference in New Issue
Block a user