2015-02-19 14:37:52 +00:00
|
|
|
$(document).ready( function() {
|
2015-02-19 15:50:36 +00:00
|
|
|
console.log( "document loaded" );
|
|
|
|
$('.listeoeuvre').click(function() {
|
2015-02-19 17:11:51 +00:00
|
|
|
$('#oeuvrePic').empty();
|
2015-02-19 15:50:36 +00:00
|
|
|
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
|
|
|
|
$.get(url, function( data ) {
|
2015-02-19 16:35:57 +00:00
|
|
|
if (data.length == 0 )
|
|
|
|
$("#oeuvrePic").append("Aucune Oeuvre");
|
2015-02-19 14:37:52 +00:00
|
|
|
data.forEach( function(el) {
|
2015-02-19 16:35:57 +00:00
|
|
|
$("#oeuvrePic").append('<div class="col-xs-4 col-md-3">'
|
|
|
|
+'<a href="#" class="thumbnail">'
|
|
|
|
+'<img src="http://www.augustins.org/documents/10180/156407/' + el.urlPhoto + '"/>'
|
|
|
|
+'</a></div>');
|
2015-02-19 15:50:36 +00:00
|
|
|
})
|
|
|
|
}, "json" )
|
|
|
|
|
|
|
|
.fail(function() {
|
2015-02-19 17:11:51 +00:00
|
|
|
$("#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>'
|
|
|
|
);
|
2015-02-19 14:37:52 +00:00
|
|
|
});
|
2015-02-19 15:50:36 +00:00
|
|
|
});
|
2015-02-19 17:21:04 +00:00
|
|
|
|
|
|
|
$('.listeoeuvre').click(function() {
|
|
|
|
$('#oeuvrePic').empty();
|
|
|
|
url = "/showListOeuvres/" + $(this).children('.idListeOeuvre').val();
|
|
|
|
$.post(url,
|
|
|
|
dataSend,
|
|
|
|
function( data ) {
|
|
|
|
}, "json" )
|
|
|
|
.done(function() {
|
|
|
|
$("#oeuvrePic").append('<div class="alert alert-sucess">'
|
|
|
|
+'<ul>'
|
|
|
|
+'<li>Sauvegarde valider</li>'
|
|
|
|
+'</ul>'
|
|
|
|
+'</div>'
|
|
|
|
})
|
|
|
|
.fail(function() {
|
|
|
|
$("#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>'
|
|
|
|
);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2015-02-19 15:50:36 +00:00
|
|
|
});
|
|
|
|
|
2015-02-19 17:21:04 +00:00
|
|
|
|