modified: SRC/app/Http/Controllers/ReferentController.php
modified: SRC/public/js/ListeOeuvre.js modified: SRC/resources/views/referent.blade.php
This commit is contained in:
parent
485f0019f0
commit
439888f0db
@ -11,6 +11,7 @@ use App\Models\Domaine;
|
||||
use App\Models\Matiere;
|
||||
use App\Models\Technique;
|
||||
use App\Models\Oeuvre;
|
||||
use App\Models\Jeu;
|
||||
use Response;
|
||||
|
||||
|
||||
@ -36,6 +37,7 @@ class ReferentController extends Controller {
|
||||
{
|
||||
$me = User::current();
|
||||
$user = User::all();
|
||||
$games = Jeu::all();
|
||||
|
||||
$dataSearch = [];
|
||||
$dataSearch['auteur'] = Auteur::orderBy('nom')->get();
|
||||
@ -45,7 +47,7 @@ class ReferentController extends Controller {
|
||||
$dataSearch['technique'] = Technique::orderBy('nom')->get();
|
||||
|
||||
$listeoeuvres = ListeOeuvre::currentUser()->get();
|
||||
return view('referent', ['nameRoute' => 'Référent', 'me' => $me, 'listeoeuvres' => $listeoeuvres, 'data' => $dataSearch]);
|
||||
return view('referent', ['nameRoute' => 'Référent', 'me' => $me, 'listeoeuvres' => $listeoeuvres, 'data' => $dataSearch, 'games' => $games]);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -129,6 +131,7 @@ class ReferentController extends Controller {
|
||||
$fin = (Input::get('fin'))?Input::get('fin'): '';
|
||||
|
||||
$res = Oeuvre::authorFilter($auteurs)
|
||||
->techniqueFilter($techniques)
|
||||
->designationFilter($designations)
|
||||
->domaineFilter($domaines)
|
||||
->matiereFilter($matieres)
|
||||
|
@ -1,6 +1,7 @@
|
||||
|
||||
//Selection d'une recherche d'oeuvre
|
||||
$('.listeoeuvre').click(function() {
|
||||
|
||||
$('#oeuvrePic').empty();
|
||||
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
|
||||
$.get(url, function( data ) {
|
||||
@ -127,7 +128,25 @@ $('#search_button, #previous, #next').click(function(event) {
|
||||
|
||||
|
||||
|
||||
|
||||
// Mettre à jour les jeux associés à la liste d'oeuvre
|
||||
$('.checkbox').click(function(event) {
|
||||
|
||||
var searchIDs = $("input#idGame").map(function(){
|
||||
return $(this).val();
|
||||
}).get();
|
||||
|
||||
var searchValues = $("input#checkbox").map(function(){
|
||||
return $(this).is(":checked");
|
||||
}).get();
|
||||
|
||||
r = [];
|
||||
for (i = 0; i < searchIDs.length; i++) {
|
||||
r[searchIDs[i]] = searchValues[i];
|
||||
}
|
||||
|
||||
console.log(r);
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
@ -66,26 +66,16 @@
|
||||
|
||||
<div class="col-md-3">
|
||||
<legend>Mes jeux associés</legend>
|
||||
|
||||
@foreach($games as $game)
|
||||
<div class="checkbox">
|
||||
<input type="hidden" name="idGame" id="idGame" value="{{ $game->id }}">
|
||||
<label class="ios7-switch">
|
||||
<input type="checkbox" checked>
|
||||
<input id="checkbox" type="checkbox">
|
||||
<span></span>
|
||||
Puzzle Game
|
||||
{{ $game->nom }}
|
||||
</label>
|
||||
|
||||
<label class="ios7-switch">
|
||||
<input type="checkbox" >
|
||||
<span></span>
|
||||
Jeu du pendu
|
||||
</label>
|
||||
|
||||
<label class="ios7-switch">
|
||||
<input type="checkbox" >
|
||||
<span></span>
|
||||
Assassin's creed
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
<br><br><br>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user