2015-03-14 14:41:27 +01:00
@ extends ( 'backend/template' )
@ section ( 'content' )
@ include ( 'backend/ref_navbar' )
2015-03-14 16:11:11 +01:00
< div class = " container-fluid " >
2015-03-14 14:41:27 +01:00
< div class = " row " >
2015-03-14 16:11:11 +01:00
@ if ( session ( 'message' ))
< div class = " col-md-12 " >< div class = " alert alert-success " >
{{ Session :: get ( 'message' ) }}
</ div ></ div >
@ endif
@ if ( session ( 'erreur' ))
< div class = " col-md-12 " >< div class = " alert alert-danger " >
{{ Session :: get ( 'erreur' ) }}
</ div ></ div >
@ endif
< div class = " col-md-4 " >
2015-03-14 14:41:27 +01:00
< div class = " panel panel-primary " >
< div class = " panel-heading " > Mes listes d ' Oeuvres </ div >
< div class = " panel-body " >
2015-03-17 17:21:37 +01:00
< form method = " post " action = " { { URL::to('referent/ajouterliste') }} " >
< input type = " hidden " name = " _token " value = " { { csrf_token() }} " >
< div class = " form-group " >
2015-03-20 15:48:08 +01:00
< label for = " nomListe " > Nouvelle liste :</ label >
2015-03-17 17:21:37 +01:00
< div class = " input-group " >
< input type = " text " id = " nomListe " name = " nomListe " class = " form-control " placeholder = " Nom de la liste " >
< span class = " input-group-btn " >
< button class = " btn btn-default " type = " submit " >< span class = " glyphicon glyphicon-plus " ></ span ></ button >
</ span >
</ div >
</ div >
</ form >
< div class = " alert alert-grey " > Ci - dessous , vous pouvez associer les listes d 'oeuvres à un jeu. Cliquez sur le bouton "<span class="glyphicon glyphicon-ok"> </span> Associer" quand c' est terminé .</ div >
2015-03-14 14:41:27 +01:00
< form method = " post " action = " { { URL::to('referent/changerparamliste') }} " >
< table class = " table " >
< thead class = " tablethead " >
< tr >
< th > Liste </ th >
< th > Mémo </ th >
< th > Puzzle </ th >
< th ></ th >
</ tr >
</ thead >
< tbody >
2015-03-16 23:23:41 +01:00
< tr >
2015-03-17 19:24:29 +01:00
< td > Liste aléatoire </ td >
2015-03-16 23:59:59 +01:00
< td >< input type = " radio " name = " memo " value = " 0 " checked type = " checkbox " ></ td >
< td >< input type = " radio " name = " puzzle " value = " 0 " checked type = " checkbox " ></ td >
2015-03-16 23:23:41 +01:00
< td ></ td >
</ tr >
2015-03-14 14:41:27 +01:00
@ foreach ( $meslistes as $index => $listeoeuvre )
< tr >
< td > {{ $listeoeuvre -> nom }} </ td >
< td >< input type = " radio " name = " memo " value = " { { $listeoeuvre -> id } } " {{ ( $listeoeuvre -> actifMemo == 1 ) ? 'checked' : '' }} type = " checkbox " ></ td >
< td >< input type = " radio " name = " puzzle " value = " { { $listeoeuvre -> id } } " {{ ( $listeoeuvre -> actifPuzzle == 1 ) ? 'checked' : '' }} type = " checkbox " ></ td >
< td >
< div class = " btn-group " role = " group " aria - label = " ... " >
< a href = " { { URL::to('referent/modifierliste', $listeoeuvre->id ) }} " class = " btn btn-xs btn-primary " >< span class = " glyphicon glyphicon-pencil " ></ span ></ a >
2015-03-16 23:23:41 +01:00
< a href = " { { URL::to('referent/supprimerliste', $listeoeuvre->id ) }} " type = " button " class = " confirm btn btn-xs btn-danger " >< span class = " glyphicon glyphicon-trash " ></ span ></ a >
2015-03-14 14:41:27 +01:00
</ div >
</ td >
</ tr >
@ endforeach
< input type = " hidden " name = " _token " value = " { { csrf_token() }} " >
</ form >
</ tbody >
</ table >
2015-03-16 23:23:41 +01:00
< div class = " text-center " >< button type = " submit " class = " btn btn-xs btn-primary " >< span class = " glyphicon glyphicon-ok-circle " > </ span > Associer </ button ></ div >
2015-03-17 17:21:37 +01:00
2015-03-14 14:41:27 +01:00
</ div >
</ div >
</ div >
< div class = " col-md-8 " >
@ if ( isset ( $mesoeuvres ))
< div class = " panel panel-primary " >
< div class = " panel-heading " > Liste " { { $mesoeuvres->nom }} " </ div >
< div class = " panel-body " >
< ul class = " nav nav-tabs " role = " tablist " id = " myTab " >
< li role = " presentation " class = " active " >< a href = " #home " aria - controls = " home " role = " tab " data - toggle = " tab " > Oeuvres sélectionnées </ a ></ li >
< li role = " presentation " >< a href = " #profile " aria - controls = " profile " role = " tab " data - toggle = " tab " > Ajouter une Oeuvre </ a ></ li >
< li role = " presentation " >< a href = " #tabconfig " aria - controls = " profile " role = " tab " data - toggle = " tab " > Configurer la difficulté </ a ></ li >
</ ul >
< div class = " tab-content " >
< div role = " tabpanel " class = " tab-pane active text-center " id = " home " >
< div class = " row " >
< div class = " col-md-12 " style = " margin-top:30px; " >
@ if ( count ( $mesoeuvres -> oeuvres ) == 0 )
2015-03-20 15:48:08 +01:00
< h5 > Aucune oeuvre dans la liste .</ h5 >
2015-03-14 14:41:27 +01:00
@ else
< form method = " post " action = " { { URL::to('referent/modifierliste/supprimer', $mesoeuvres->id ) }} " >
< input type = " hidden " name = " _token " value = " { { csrf_token() }} " >
< select multiple = " multiple " class = " multiple " name = " todel[] " >
@ foreach ( $mesoeuvres -> oeuvres as $index => $oeuvre )
2015-03-17 12:08:37 +01:00
< option data - img - src = '/image/200/{{ $oeuvre->image }}' value = " { { $oeuvre->id }} " ></ option >
2015-03-14 14:41:27 +01:00
@ endforeach
</ select >
< button type = " submit " class = " btn btn-danger " href = " # " >< span class = " glyphicon glyphicon-trash " ></ span > Supprimer </ button >
</ form >
@ endif
</ div >
</ div >
</ div >
< div role = " tabpanel " class = " tab-pane " id = " tabconfig " >
< div class = " col-md-8 col-md-offset-2 " style = " margin-top:30px " >
2015-03-16 18:22:02 +01:00
2015-03-14 14:41:27 +01:00
< form class = " form-horizontal " method = " post " action = " { { URL::to('referent/changeParamListe', $mesoeuvres->id )}} " >
< input type = " hidden " name = " _token " value = " { { csrf_token() }} " >
2015-03-20 22:05:59 +01:00
< legend > Puzzle </ legend >< p > 2 images = 2 lignes / 2 colones </ p >
2015-03-14 14:41:27 +01:00
< div class = " form-group " >
2015-03-20 22:05:59 +01:00
< label for = " p1 " class = " col-sm-4 control-label " > Images pour 1 étoile </ label >
2015-03-14 14:41:27 +01:00
< div class = " col-sm-6 " >
2015-03-15 19:38:11 +01:00
< input type = " number " min = " 1 " max = " 10 " class = " form-control " value = " { { $paramjeu -> p1 } } " name = " p1 " id = " p1 " placeholder = " 2 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
2015-03-20 22:05:59 +01:00
< label for = " p2 " class = " col-sm-4 control-label " > Images pour 2 étoiles </ label >
2015-03-14 14:41:27 +01:00
< div class = " col-sm-6 " >
2015-03-15 19:38:11 +01:00
< input type = " number " min = " 1 " max = " 10 " class = " form-control " value = " { { $paramjeu -> p2 } } " name = " p2 " id = " p2 " placeholder = " 3 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
2015-03-20 22:05:59 +01:00
< label for = " p3 " class = " col-sm-4 control-label " > Images pour 3 étoiles </ label >
2015-03-14 14:41:27 +01:00
< div class = " col-sm-6 " >
2015-03-15 19:38:11 +01:00
< input type = " number " min = " 1 " max = " 10 " class = " form-control " value = " { { $paramjeu -> p3 } } " name = " p3 " id = " p3 " placeholder = " 4 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
< label for = " pt " class = " col-sm-4 control-label " > Tableaux par partie </ label >
< div class = " col-sm-6 " >
2015-03-15 19:38:11 +01:00
< input type = " number " min = " 1 " max = " 10 " class = " form-control " value = " { { $paramjeu -> pt } } " name = " pt " id = " pt " placeholder = " 3 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< legend > Mémo </ legend >
< div class = " form-group " >
< label for = " m1 " class = " col-sm-4 control-label " > Nb . de tableaux 1 étoile </ label >
< div class = " col-sm-6 " >
2015-03-16 18:22:02 +01:00
< input type = " number " min = " 1 " max = " 2 " class = " form-control " value = " { { $paramjeu -> m1 } } " name = " m1 " id = " m1 " placeholder = " 2 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
< label for = " m2 " class = " col-sm-4 control-label " > Nb . de tableaux 2 étoiles </ label >
< div class = " col-sm-6 " >
2015-03-16 18:22:02 +01:00
< input type = " number " min = " 1 " max = " 4 " class = " form-control " value = " { { $paramjeu -> m2 } } " name = " m2 " id = " m2 " placeholder = " 3 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
< label for = " m3 " class = " col-sm-4 control-label " > Nb . de tableaux 3 étoiles </ label >
< div class = " col-sm-6 " >
2015-03-16 18:22:02 +01:00
< input type = " number " min = " 1 " max = " 8 " class = " form-control " value = " { { $paramjeu -> m3 } } " name = " m3 " id = " m3 " placeholder = " 4 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
< label for = " mt " class = " col-sm-4 control-label " > Tableaux par partie </ label >
< div class = " col-sm-6 " >
2015-03-15 19:38:11 +01:00
< input type = " number " min = " 1 " max = " 10 " class = " form-control " value = " { { $paramjeu -> mt } } " name = " mt " id = " mt " placeholder = " 3 " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
< div class = " col-sm-offset-4 col-sm-6 " >
< button id = " search " class = " btn btn-primary " > Enregistrer </ button >
</ div >
</ div >
</ form >
2015-03-16 18:22:02 +01:00
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div role = " tabpanel " class = " tab-pane " id = " profile " >
< div class = " row " >
< div class = " col-md-10 col-md-offset-2 " style = " margin-top:30px " >
< div class = " row " >
< div class = " col-md-10 " >
2015-03-14 16:11:11 +01:00
< form class = " form-horizontal " id = " recherche " >
2015-03-14 14:41:27 +01:00
< div class = " form-group " >
2015-03-15 02:23:26 +01:00
< label for = " designation " class = " col-sm-2 control-label " > Désignation </ label >
2015-03-14 14:41:27 +01:00
< div class = " col-sm-10 " >
2015-03-15 02:23:26 +01:00
< input id = " designation " name = " designation " class = " form-control " placeholder = " Désignation " >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
2015-03-15 02:23:26 +01:00
< label for = " auteur " class = " col-sm-2 control-label " > Auteur </ label >
2015-03-14 14:41:27 +01:00
< div class = " col-sm-10 " >
2015-03-15 02:23:26 +01:00
< select id = " auteur " name = " auteur[] " class = " form-control " multiple >
@ foreach ( $auteurs as $e )
< option value = " { { $e->id }} " > {{ $e -> nom }} </ option >
@ endforeach
</ select >
</ div >
</ div >
< div class = " form-group " >
< label for = " domaine " class = " col-sm-2 control-label " > Domaine </ label >
< div class = " col-sm-10 " >
< select id = " domaine " name = " domaine[] " class = " form-control " multiple >
@ foreach ( $domaines as $e )
< option value = " { { $e->id }} " > {{ $e -> nom }} </ option >
@ endforeach
</ select >
</ div >
</ div >
< div class = " form-group " >
< label for = " matiere " class = " col-sm-2 control-label " > Matière </ label >
< div class = " col-sm-10 " >
< select id = " matiere " name = " matiere[] " class = " form-control " multiple >
@ foreach ( $matieres as $e )
< option value = " { { $e->id }} " > {{ $e -> nom }} </ option >
@ endforeach
</ select >
</ div >
</ div >
< div class = " form-group " >
< label for = " domaine " class = " col-sm-2 control-label " > Technique </ label >
< div class = " col-sm-10 " >
< select id = " technique " name = " technique[] " class = " form-control " multiple >
@ foreach ( $techniques as $e )
< option value = " { { $e->id }} " > {{ $e -> nom }} </ option >
@ endforeach
</ select >
2015-03-14 14:41:27 +01:00
</ div >
</ div >
< div class = " form-group " >
< div class = " col-sm-offset-2 col-sm-10 " >
< button id = " search " class = " btn btn-default " > Rechercher </ button >
</ div >
</ div >
</ form >
</ div >
</ div >
</ div >
</ div >
< form method = " post " action = " { { URL::to('referent/modifierliste/ajouter', $mesoeuvres->id ) }} " >
< input type = " hidden " name = " _token " value = " { { csrf_token() }} " >
< div class = " text-center " id = " imagesSearched " >
</ div >
</ form >
@ else
2015-03-17 17:21:37 +01:00
< div class = " alert alert-grey " > Cliquez sur le bouton < span class = " glyphicon glyphicon-pencil " ></ span > pour modifier une liste .</ div >
2015-03-14 14:41:27 +01:00
@ endif
</ div >
</ div >
</ div >
@ endsection
@ section ( 'page-css' )
< link rel = " stylesheet " href = " { { URL::to('css/image-picker.css') }} " >
2015-03-14 18:20:35 +01:00
< link rel = " stylesheet " href = " { { URL::to('css/bootstrap-multiselect.css') }} " >
2015-03-15 19:38:11 +01:00
< style >
. thumbnails . thumbnail {
2015-03-16 18:22:02 +01:00
margin - bottom : 0 ;
2015-03-15 19:38:11 +01:00
}
2015-03-16 16:42:41 +01:00
. thumbnail img {
2015-03-16 23:23:41 +01:00
width : 100 % ;
2015-03-16 16:42:41 +01:00
height : 100 px ;
2015-03-15 19:38:11 +01:00
}
2015-03-17 17:21:37 +01:00
2015-03-15 19:38:11 +01:00
</ style >
2015-03-14 14:41:27 +01:00
@ endsection
@ section ( 'page-scripts' )
< script src = " { { URL::to('js/image-picker.min.js') }} " ></ script >
2015-03-14 18:20:35 +01:00
< script src = " { { URL::to('js/bootstrap-multiselect.js') }} " ></ script >
2015-03-14 14:41:27 +01:00
< script >
2015-03-16 18:22:02 +01:00
$ ( " select.multiple " ) . imagepicker ();
2015-03-16 23:23:41 +01:00
$ ( '.confirm' ) . click ( function ( e ) {
if ( ! confirm ( 'Voulez-vous vraiment confirmer la supression ?' )) e . preventDefault ();
});
2015-03-16 18:22:02 +01:00
2015-03-14 14:41:27 +01:00
$ ( '#imagesSearched' ) . load ( '{{ URL::to(' api / searchOeuvres ') }}' , function (){ $ ( " select.multiple " ) . imagepicker ();});
2015-03-15 19:38:11 +01:00
2015-03-16 14:07:32 +01:00
/* function fitGrid (){
$ ( '.thumbnails' ) . masonry ({
2015-03-15 19:38:11 +01:00
itemSelector : 'li' ,
gutterWidth : 10
2015-03-16 14:07:32 +01:00
}) . masonry ( 'reload' );
}; */
2015-03-16 18:22:02 +01:00
2015-03-16 14:07:32 +01:00
$ ( '#imagesSearched' ) . on ( 'click' , '.pagination a' , function ( event ) {
2015-03-14 14:41:27 +01:00
event . preventDefault ();
if ( $ ( this ) . attr ( 'href' ) != '#' ) {
$ ( " #imagesSearched " ) . animate ({ scrollTop : 0 }, " fast " );
2015-03-14 16:11:11 +01:00
$ . get ( $ ( this ) . attr ( 'href' ), $ ( '#recherche' ) . serialize (),
function ( data ){
$ ( '#imagesSearched' ) . empty ();
$ ( '#imagesSearched' ) . append ( data );
$ ( " select.multiple " ) . imagepicker ();
});
2015-03-14 14:41:27 +01:00
}
});
2015-03-14 16:11:11 +01:00
2015-03-16 18:22:02 +01:00
2015-03-14 18:20:35 +01:00
$ ( '#recherche select' ) . multiselect ({
enableFiltering : true ,
2015-03-15 02:23:26 +01:00
buttonWidth : '100%' ,
2015-03-20 15:48:08 +01:00
maxHeight : 200 ,
enableCaseInsensitiveFiltering : true
2015-03-14 18:20:35 +01:00
});
2015-03-16 18:22:02 +01:00
2015-03-14 16:11:11 +01:00
$ ( " #recherche " ) . on ( 'submit' , function ( event ){
event . preventDefault ();
$ ( '#imagesSearched' ) . empty ();
$ ( '#imagesSearched' ) . append ( " Recherche en cours... " );
$ . get ( " { { URL::to('api/searchOeuvres') }} " , $ ( '#recherche' ) . serialize (),
function ( data ){
$ ( '#imagesSearched' ) . empty ();
$ ( '#imagesSearched' ) . append ( data );
$ ( " select.multiple " ) . imagepicker ();
});
2015-03-16 18:22:02 +01:00
2015-03-14 16:11:11 +01:00
});
2015-03-16 14:07:32 +01:00
2015-03-14 14:41:27 +01:00
/*
2015-03-16 18:22:02 +01:00
2015-03-14 14:41:27 +01:00
$ ( " #search " ) . click ( function (){
event . preventDefault ();
$ ( '#imagesSearched' ) . empty ();
$ ( '#imagesSearched' ) . append ( " Recherche en cours " );
2015-03-16 18:22:02 +01:00
2015-03-14 14:41:27 +01:00
$ . get ( " { { URL::to('api/searchOeuvres') }} " , { domaine : $ ( '#domaine' ) . val () },
function ( data ){
$ ( '#imagesSearched' ) . empty ();
2015-03-16 18:22:02 +01:00
$ ( '#imagesSearched' ) . append ( '<select multiple="multiple" id="toadd" name="toadd[]">' );
2015-03-14 14:41:27 +01:00
$ ( data . data ) . each ( function ( id , elt ){
$ ( '#toadd' ) . append ( " <option data-img-src='http://www.augustins.org/documents/10180/156407/ " + elt . image + " ' value= \" " + elt . id + " \" ></option> " );
});
$ ( '#imagesSearched' ) . append ( '<button type="submit" id="search" class="btn btn-default">Ajouter</button>' );
2015-03-16 18:22:02 +01:00
2015-03-14 14:41:27 +01:00
$ ( " #toadd " ) . imagepicker ();
}, " json " );
}); */
2015-03-16 18:22:02 +01:00
2015-03-14 14:41:27 +01:00
</ script >
2015-03-16 18:22:02 +01:00
@ endsection