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
49c5b2b1d1
commit
3613ef325f
@ -161,7 +161,13 @@ class ReferentController extends Controller {
|
||||
}
|
||||
|
||||
public function addItemsToList() {
|
||||
;
|
||||
|
||||
$idListeOeuvre = Session::get('listeoeuvre_current');
|
||||
$ListeOeuvre = ListeOeuvre::find($idListeOeuvre);
|
||||
|
||||
$oeuvresToAdd = Input::get('oeuvres');
|
||||
$ListeOeuvre->oeuvres()->attach($oeuvresToAdd);
|
||||
return Response::json(array());
|
||||
}
|
||||
|
||||
public function updateAssoGames() {
|
||||
|
@ -123,6 +123,34 @@ $('#removeFromSelection').click(function() {
|
||||
|
||||
|
||||
|
||||
// Add to my favorites list
|
||||
$('#addIntoMyList').click(function() {
|
||||
|
||||
url = "addItemsToList";
|
||||
dataSend = {
|
||||
_token : $('#_tokenRes').val(),
|
||||
oeuvres : $('#my_researches').val()};
|
||||
$.post(url,
|
||||
dataSend,
|
||||
function( data ) {
|
||||
;
|
||||
}, "json")
|
||||
.done(function() {
|
||||
$('#oeuvreRes').empty();
|
||||
})
|
||||
.fail(function() {
|
||||
$("#oeuvreRes").append('<div class="alert alert-danger">'
|
||||
+'<strong>Oouups!</strong> Il y a un problème.<br><br>'
|
||||
+'<ul>'
|
||||
+'<li>Erreur lors de l\'ajout dans ma liste d\'oeuvre</li>'
|
||||
+'</ul>'
|
||||
+'</div>'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
// Afficher résultat de recherche d'oeuvre
|
||||
$('#search_button, #previous, #next').click(function(event) {
|
||||
event.preventDefault();
|
||||
|
@ -168,10 +168,11 @@
|
||||
<legend>Résultat de ma recherche</legend>
|
||||
<span style="float: right"><a href="">Sélectionner tout</a> -- <a href="">Annuler sélection</a></span><br>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-body" id="oeuvreRes">
|
||||
|
||||
<!-- TODO -->
|
||||
|
||||
<div class="panel-body">
|
||||
<div id="oeuvreRes">
|
||||
<!-- TODO -->
|
||||
</div>
|
||||
<button style="float: right" type="button" class="btn btn-primary" id="addIntoMyList">Ajouter à ma liste d'oeuvre</button>
|
||||
</div>
|
||||
</div>
|
||||
<nav>
|
||||
@ -180,7 +181,6 @@
|
||||
<li class="next disabled"><a id="next" href="">Suivant <span aria-hidden="true">→</span></a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
<button style="float: right" class="btn btn-primary" id="ajouter">Ajouter à ma liste d'oeuvre</button>
|
||||
<br><br>
|
||||
</div>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user