From 634914e5828ffd52614bd23dc948b20a53c17752 Mon Sep 17 00:00:00 2001 From: sidya82 Date: Thu, 19 Feb 2015 18:11:51 +0100 Subject: [PATCH] =?UTF-8?q?=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20?= =?UTF-8?q?=20SRC/app/Http/Controllers/ReferentController.php=20=09modifi?= =?UTF-8?q?=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20SRC/app/Http/routes.php?= =?UTF-8?q?=20=09renomm=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20SRC/public/?= =?UTF-8?q?js/getListeOeuvre.js=20->=20SRC/public/js/ListeOeuvre.js=20=09s?= =?UTF-8?q?upprim=C3=A9=C2=A0:=20=20=20=20=20=20=20=20SRC/public/js/setLis?= =?UTF-8?q?teOeuvre.js=20=09modifi=C3=A9=C2=A0:=20=20=20=20=20=20=20=20=20?= =?UTF-8?q?SRC/resources/views/app.blade.php=20=09modifi=C3=A9=C2=A0:=20?= =?UTF-8?q?=20=20=20=20=20=20=20=20SRC/resources/views/referent.blade.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Http/Controllers/ReferentController.php | 5 +++++ SRC/app/Http/routes.php | 2 +- .../js/{getListeOeuvre.js => ListeOeuvre.js} | 9 ++++++++- SRC/public/js/setListeOeuvre.js | 20 ------------------- SRC/resources/views/app.blade.php | 2 +- SRC/resources/views/referent.blade.php | 2 +- 6 files changed, 16 insertions(+), 24 deletions(-) rename SRC/public/js/{getListeOeuvre.js => ListeOeuvre.js} (69%) delete mode 100644 SRC/public/js/setListeOeuvre.js diff --git a/SRC/app/Http/Controllers/ReferentController.php b/SRC/app/Http/Controllers/ReferentController.php index e6e0c30..279a7df 100755 --- a/SRC/app/Http/Controllers/ReferentController.php +++ b/SRC/app/Http/Controllers/ReferentController.php @@ -95,4 +95,9 @@ class ReferentController extends Controller { return redirect('/referent'); } + public function setListOeuvres () + { + return Response::json(array('sucess' => 'true', )) + } + } diff --git a/SRC/app/Http/routes.php b/SRC/app/Http/routes.php index 137d053..c363a82 100644 --- a/SRC/app/Http/routes.php +++ b/SRC/app/Http/routes.php @@ -39,7 +39,7 @@ Route::group(['middleware' => 'auth'], function () Route::post('deleteListeOeuvre', 'ReferentController@deleteListeOeuvre'); Route::post('addListeOeuvre', 'ReferentController@addListeOeuvre'); Route::get('showListOeuvres/{id}', 'ReferentController@showListeOeuvres'); - Route::get('setListOeuvres', 'ReferentController@setListOeuvres'); + Route::post('setListOeuvres', 'ReferentController@setListOeuvres'); }); Route::group(['middleware' => 'admin'], function () diff --git a/SRC/public/js/getListeOeuvre.js b/SRC/public/js/ListeOeuvre.js similarity index 69% rename from SRC/public/js/getListeOeuvre.js rename to SRC/public/js/ListeOeuvre.js index 3b51a58..349046c 100644 --- a/SRC/public/js/getListeOeuvre.js +++ b/SRC/public/js/ListeOeuvre.js @@ -1,6 +1,7 @@ $(document).ready( function() { console.log( "document loaded" ); $('.listeoeuvre').click(function() { + $('#oeuvrePic').empty(); url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val(); $.get(url, function( data ) { if (data.length == 0 ) @@ -14,7 +15,13 @@ $(document).ready( function() { }, "json" ) .fail(function() { - console.log( "error" ); + $("#oeuvrePic").append('
' + +'Oouups! Il y a un problème.

' + +'' + +'
' + ); }); }); }); diff --git a/SRC/public/js/setListeOeuvre.js b/SRC/public/js/setListeOeuvre.js deleted file mode 100644 index 5f9a8c4..0000000 --- a/SRC/public/js/setListeOeuvre.js +++ /dev/null @@ -1,20 +0,0 @@ -$(document).ready( function() { - $('#enregistrer').click(function() { - event.preventDefault(); - send = {idListeOeuvre : " " , - idOeuvres : [1,2,3,4,4] } - url = "/setListOeuvres"; - $.post(url, - send, - function( data ) { - }) - .done(function() { - console.log( "success" ); - }) - .fail(function() { - console.log( "error" ); - }); - }); - -}); - diff --git a/SRC/resources/views/app.blade.php b/SRC/resources/views/app.blade.php index 7aa0932..f809232 100755 --- a/SRC/resources/views/app.blade.php +++ b/SRC/resources/views/app.blade.php @@ -32,6 +32,6 @@ - + diff --git a/SRC/resources/views/referent.blade.php b/SRC/resources/views/referent.blade.php index cd77bf7..328b9d3 100755 --- a/SRC/resources/views/referent.blade.php +++ b/SRC/resources/views/referent.blade.php @@ -84,7 +84,7 @@ - +