modifié : SRC/app/Http/Controllers/ReferentController.php
modifié : SRC/app/Http/routes.php renommé : SRC/public/js/getListeOeuvre.js -> SRC/public/js/ListeOeuvre.js supprimé : SRC/public/js/setListeOeuvre.js modifié : SRC/resources/views/app.blade.php modifié : SRC/resources/views/referent.blade.php
This commit is contained in:
parent
42b4afaf57
commit
634914e582
@ -95,4 +95,9 @@ class ReferentController extends Controller {
|
||||
return redirect('/referent');
|
||||
}
|
||||
|
||||
public function setListOeuvres ()
|
||||
{
|
||||
return Response::json(array('sucess' => 'true', ))
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -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 ()
|
||||
|
@ -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('<div class="alert alert-danger">'
|
||||
+'<strong>Oouups!</strong> Il y a un problème.<br><br>'
|
||||
+'<ul>'
|
||||
+'<li>Erreur lors de la récupération</li>'
|
||||
+'</ul>'
|
||||
+'</div>'
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
@ -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" );
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
@ -32,6 +32,6 @@
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>
|
||||
|
||||
<!-- Scripts Jquery -->
|
||||
<script type="text/javascript" src="js/getListeOeuvre.js"></script>
|
||||
<script type="text/javascript" src="js/ListeOeuvre.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
@ -84,7 +84,7 @@
|
||||
|
||||
<!-- // TODO -->
|
||||
|
||||
<button style="float: right" class="btn btn-primary">Enregistrer</button>
|
||||
<button style="float: right" class="btn btn-primary" id="enregistrer">Enregistrer</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user