Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Raph El
Admin-Panel
Commits
ac7e5fbb
Commit
ac7e5fbb
authored
Mar 18, 2015
by
El-gitano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ajout du système d'alerte généralisé + màj des appels
parent
73875ddc
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
131 additions
and
82 deletions
+131
-82
TODO
TODO
+2
-0
app/index.html
app/index.html
+5
-1
app/scripts/app.js
app/scripts/app.js
+1
-1
app/scripts/controllers/authentification.js
app/scripts/controllers/authentification.js
+4
-16
app/scripts/controllers/equipes.js
app/scripts/controllers/equipes.js
+6
-5
app/scripts/controllers/joueurs.js
app/scripts/controllers/joueurs.js
+8
-7
app/scripts/controllers/joueursEquipe.js
app/scripts/controllers/joueursEquipe.js
+10
-10
app/scripts/directives/tableau.js
app/scripts/directives/tableau.js
+2
-2
app/scripts/services/informer.js
app/scripts/services/informer.js
+29
-25
app/styles/main.css
app/styles/main.css
+59
-11
app/views/directives/afficheurAlertes.html
app/views/directives/afficheurAlertes.html
+2
-2
bower.json
bower.json
+3
-2
No files found.
TODO
View file @
ac7e5fbb
...
...
@@ -22,6 +22,8 @@ Ajouter les photos des joueurs (dans les formulaires et lors du focus d'une lign
Fonctionnalité de vérification du tournois avant lancement
Faire la documentation
Faire des tests
Supprimer chargement-ligne
Faire la page d'accueil
=== AUTH ===
...
...
app/index.html
View file @
ac7e5fbb
...
...
@@ -33,7 +33,10 @@
<img
id=
"logo"
src=
"images/logo.png"
alt=
"logo"
/><h3
class=
"text-muted"
>
AceCream
</h3>
</div>
<afficheur-infos></afficheur-infos>
<div
class=
"container-fluid"
>
<afficheur-infos></afficheur-infos>
</div>
<div
ng-view=
""
></div>
<div
class=
"footer"
>
...
...
@@ -67,6 +70,7 @@
<script
src=
"bower_components/bootstrap/dist/js/bootstrap.js"
></script>
<script
src=
"bower_components/angular-route/angular-route.js"
></script>
<script
src=
"bower_components/angular-bootstrap/ui-bootstrap-tpls.js"
></script>
<script
src=
"bower_components/angular-animate/angular-animate.js"
></script>
<!-- endbower -->
<!-- endbuild -->
...
...
app/scripts/app.js
View file @
ac7e5fbb
...
...
@@ -7,7 +7,7 @@
* Module principal de l'application. Se charge de gérer les vues et controleurs a utiliser en fonction de la route
*/
angular
.
module
(
'
panelAdminApp
'
,
[
'
ngRoute
'
,
'
ui.bootstrap
'
])
.
module
(
'
panelAdminApp
'
,
[
'
ngRoute
'
,
'
ngAnimate
'
,
'
ui.bootstrap
'
])
.
config
([
'
$routeProvider
'
,
'
$httpProvider
'
,
'
$logProvider
'
,
'
apicallProvider
'
,
'
urlAPI
'
,
function
(
$routeProvider
,
$httpProvider
,
$logProvider
,
apicallProvider
,
urlAPI
)
{
$logProvider
.
debugEnabled
(
true
);
...
...
app/scripts/controllers/authentification.js
View file @
ac7e5fbb
...
...
@@ -8,10 +8,7 @@
* Controller of the panelAdminApp
*/
angular
.
module
(
'
panelAdminApp
'
)
.
controller
(
'
AuthentificationCtrl
'
,
[
'
$scope
'
,
'
$log
'
,
'
$window
'
,
'
apicall
'
,
'
infosConnexion
'
,
function
(
$scope
,
$log
,
$window
,
apicall
,
infosConnexion
)
{
/* Gestion des alertes */
$scope
.
alertes
=
[];
.
controller
(
'
AuthentificationCtrl
'
,
[
'
$scope
'
,
'
$log
'
,
'
$window
'
,
'
apicall
'
,
'
infosConnexion
'
,
'
informer
'
,
function
(
$scope
,
$log
,
$window
,
apicall
,
infosConnexion
,
informer
)
{
$scope
.
lancerConnexion
=
function
(){
...
...
@@ -19,26 +16,17 @@ angular.module('panelAdminApp')
apicall
.
authentification
(
infosConnexion
).
success
(
function
(
donnees
){
$log
.
info
(
'
Connexion réussie
'
);
$scope
.
alertes
[
0
]
=
null
;
$log
.
info
(
'
Connexion réussie
, retour à la page précédente
'
);
informer
.
informer
(
'
success
'
,
'
Connexion réalisée avec succès
'
)
;
infosConnexion
.
token
=
donnees
.
token
;
$window
.
history
.
back
();
}).
error
(
function
(){
$log
.
info
(
'
Connexion échouée
'
);
$scope
.
alertes
[
0
]
=
{
type
:
'
danger
'
,
msg
:
'
Identifiants incorrects
'
};
informer
.
informer
(
'
danger
'
,
'
Erreur lors de la tentative de connexion (veuillez vérifier vos identifiants)
'
);
});
};
$scope
.
fermerAlerte
=
function
(
index
){
$scope
.
alertes
.
splice
(
index
,
1
);
};
$scope
.
infosConnexion
=
infosConnexion
;
}]);
app/scripts/controllers/equipes.js
View file @
ac7e5fbb
...
...
@@ -9,7 +9,7 @@
*/
var
app
=
angular
.
module
(
'
panelAdminApp
'
);
app
.
controller
(
'
EquipesCtrl
'
,
[
'
$scope
'
,
'
$location
'
,
'
$log
'
,
'
$modal
'
,
'
apicall
'
,
function
(
$scope
,
$location
,
$log
,
$modal
,
apicall
)
{
app
.
controller
(
'
EquipesCtrl
'
,
[
'
$scope
'
,
'
$location
'
,
'
$log
'
,
'
$modal
'
,
'
apicall
'
,
'
informer
'
,
function
(
$scope
,
$location
,
$log
,
$modal
,
apicall
,
informer
)
{
$scope
.
methodeMaj
=
apicall
.
getEquipes
;
...
...
@@ -98,13 +98,13 @@ app.controller('EquipesCtrl', ['$scope', '$location', '$log', '$modal', 'apicall
apicall
.
setEquipe
(
equipe
).
success
(
function
(
data
){
/*$log.info(data
);
$scope.chargerJoueurs();*/
informer
.
informer
(
'
success
'
,
'
Équipe modifiée avec succès
'
);
/*
$scope.chargerJoueurs();*/
//TODO
}).
error
(
function
(){
angular
.
copy
(
copieEntree
,
entree
);
//$scope.alertes.push({type :
'danger',
msg:
'Impossible de modifier
un joueur (cliquer pour essayer de recharger)'}); // TODO
informer
.
informer
(
'
danger
'
,
'
Impossible de modifier
l
\'
équipe
'
);
});
},
function
()
{
...
...
@@ -152,11 +152,12 @@ app.controller('EquipesCtrl', ['$scope', '$location', '$log', '$modal', 'apicall
apicall
.
delEquipe
(
infosEquipe
).
success
(
function
(
data
){
informer
.
informer
(
'
danger
'
,
'
Équipe réinitialisée avec succès
'
);
//$scope.chargerEquipes();
}).
error
(
function
(){
//$scope.alertes.push({type :
'danger',
msg:
'Impossible de
c
ré
er un joueur (cliquer pour essayer de recharger)'}); // TODO
informer
.
informer
(
'
danger
'
,
'
Impossible de ré
initialiser l
\'
équipe
'
);
});
},
function
()
{
...
...
app/scripts/controllers/joueurs.js
View file @
ac7e5fbb
...
...
@@ -69,6 +69,7 @@ app.controller('JoueursCtrl', ['$scope', 'apicall', '$modal', '$log', 'informer'
$scope
.
fonctionAjout
=
function
(){
informer
.
informer
(
'
danger
'
,
'
Test
'
);
var
dialogue
=
$modal
.
open
({
templateUrl
:
'
views/modal/ajoutJoueur.html
'
,
...
...
@@ -127,14 +128,14 @@ app.controller('JoueursCtrl', ['$scope', 'apicall', '$modal', '$log', 'informer'
apicall
.
setJoueur
(
joueur
).
then
(
function
(
donnees
){
/*$log.info(data
);
$scope.chargerJoueurs();*/
informer
.
informer
(
'
danger
'
,
'
Joueur modifié avec succès
'
);
/*
$scope.chargerJoueurs();*/
},
function
(){
angular
.
copy
(
copieEntree
,
entree
);
//$scope.alertes.push({type :
'danger',
msg:
'Impossible de modifier
un joueur (cliquer pour essayer de recharger)'}); // TODO Changer ce truc
informer
.
informer
(
'
danger
'
,
'
Impossible de modifier
le joueur
'
);
});
},
function
()
{
...
...
@@ -173,15 +174,15 @@ app.controller('JoueursCtrl', ['$scope', 'apicall', '$modal', '$log', 'informer'
//$log.info('Suppression du joueur : ', donnees.entree);
apicall
.
delJoueur
(
donnees
.
entree
).
then
(
function
(){
informer
.
informer
(
'
success
'
,
'
Joueur supprimé avec succès
'
);
/*
$log.info(donnees);
$scope.chargerJoueurs();*/
$scope.chargerJoueurs();*/
// TODO
},
function
(){
//$scope.ajouterAlerte('danger', 'Impossible de supprimer un joueur'); // TODO Changer ce truc
informer
.
informer
(
'
danger
'
,
'
Impossible de supprimer le joueur
'
);
});
},
function
(){
...
...
app/scripts/controllers/joueursEquipe.js
View file @
ac7e5fbb
...
...
@@ -9,7 +9,7 @@
*/
var
app
=
angular
.
module
(
'
panelAdminApp
'
);
app
.
controller
(
'
JoueursEquipeCtrl
'
,
[
'
$scope
'
,
'
$routeParams
'
,
'
$modal
'
,
'
$log
'
,
'
apicall
'
,
function
(
$scope
,
$routeParams
,
$modal
,
$log
,
apicall
)
{
app
.
controller
(
'
JoueursEquipeCtrl
'
,
[
'
$scope
'
,
'
$routeParams
'
,
'
$modal
'
,
'
$log
'
,
'
apicall
'
,
'
informer
'
,
function
(
$scope
,
$routeParams
,
$modal
,
$log
,
apicall
,
informer
)
{
$scope
.
methodeMaj
=
apicall
.
getJoueursEquipe
;
$scope
.
paramsMaj
=
[
$routeParams
.
idEquipe
];
...
...
@@ -83,12 +83,12 @@ app.controller('JoueursEquipeCtrl', ['$scope', '$routeParams', '$modal', '$log',
apicall
.
addJoueur
(
joueur
).
success
(
function
(
donnees
){
/*$log.info(data
);
$scope.chargerJoueurs();*/
// TODO
informer
.
informer
(
'
success
'
,
'
Joueur ajouté avec succès
'
);
/*
$scope.chargerJoueurs();*/
// TODO
}).
error
(
function
(){
/*$scope.alertes.push({type :
'danger',
msg:
'Impossible d
e modifier un joueur (cliquer pour essayer de recharger)'});*/
// TODO
informer
.
informer
(
'
danger
'
,
'
Impossible d
\'
ajouter le joueur
'
);
});
},
function
()
{
...
...
@@ -128,11 +128,12 @@ app.controller('JoueursEquipeCtrl', ['$scope', '$routeParams', '$modal', '$log',
apicall
.
setJoueur
(
joueur
).
success
(
function
(
data
){
informer
.
informer
(
'
success
'
,
'
Joueur modifié avec succès
'
);
//$scope.chargerJoueurs();
}).
error
(
function
(){
// TODO $scope.alertes.push({type :
'danger',
msg:
'Impossible de modifier
un joueur (cliquer pour essayer de recharger)'}
);
informer
.
informer
(
'
danger
'
,
'
Impossible de modifier
le joueur
'
);
angular
.
copy
(
copieEntree
,
entree
);
});
...
...
@@ -170,20 +171,19 @@ app.controller('JoueursEquipeCtrl', ['$scope', '$routeParams', '$modal', '$log',
dialogue
.
result
.
then
(
function
()
{
$log
.
info
(
'
Suppression du joueur ID :
'
,
entree
.
IdPlayer
);
$scope
.
$parent
.
ajouterAlerte
(
'
danger
'
,
'
Test
'
);
apicall
.
delJoueur
(
entree
.
IdPlayer
).
success
(
function
(
data
){
$log
.
info
(
data
);
$scope
.
chargerJoueurs
();
informer
.
informer
(
'
success
'
,
'
Joueur supprimé avec succès
'
);
//
$scope.chargerJoueurs();
// TODO
}).
error
(
function
(){
$scope
.
ajouterAlerte
(
'
danger
'
,
'
Impossible de supprimer
un
joueur
'
);
informer
.
informer
(
'
danger
'
,
'
Impossible de supprimer
le
joueur
'
);
});
},
function
(){
$log
.
info
(
'
Modal dismissed at:
'
+
new
Date
()
);
$log
.
info
(
'
Action annulée
'
);
});
}
}
...
...
app/scripts/directives/tableau.js
View file @
ac7e5fbb
...
...
@@ -7,7 +7,7 @@
* # tableau
*/
angular
.
module
(
'
panelAdminApp
'
)
.
directive
(
'
tableau
'
,
[
'
$log
'
,
'
$filter
'
,
function
(
$log
,
$filter
)
{
.
directive
(
'
tableau
'
,
[
'
$log
'
,
'
$filter
'
,
'
informer
'
,
function
(
$log
,
$filter
,
informer
)
{
return
{
restrict
:
'
E
'
,
...
...
@@ -115,7 +115,7 @@ angular.module('panelAdminApp')
}).
error
(
function
(){
//ajouterAlerte
('danger', 'Impossible de récupérer le
s données (cliquez sur actualiser pour essayer de recharger)'); // TODO A changer
informer
.
informer
(
'
danger
'
,
'
Impossible de récupérer le
entrées du tableau
'
);
$scope
.
entrees
=
[];
$scope
.
chargement
=
false
;
...
...
app/scripts/services/informer.js
View file @
ac7e5fbb
...
...
@@ -8,31 +8,35 @@
* Factory in the panelAdminApp.
*/
angular
.
module
(
'
panelAdminApp
'
)
.
factory
(
'
informer
'
,
function
()
{
.
factory
(
'
informer
'
,
[
'
$timeout
'
,
function
(
$timeout
)
{
var
Informer
=
{
messages
:[]
};
Informer
.
informer
=
function
(
type
,
msg
)
{
this
.
messages
.
push
({
var
informer
=
{};
informer
.
messages
=
[];
informer
.
informer
=
function
(
type
,
msg
)
{
var
info
=
{
type
:
'
alert-
'
+
type
,
msg
:
msg
});
};
Informer
.
getInformations
=
function
()
{
return
this
.
messages
;
};
Informer
.
supprimer
=
function
(
info
)
{
this
.
messages
.
splice
(
this
.
messages
.
indexOf
(
info
),
1
);
};
return
Informer
;
});
};
this
.
messages
.
push
(
info
);
$timeout
(
informer
.
supprimer
,
5000
,
true
,
info
);
};
informer
.
getInformations
=
function
()
{
return
informer
.
messages
;
};
informer
.
supprimer
=
function
(
info
)
{
var
fileInfos
=
informer
.
messages
;
fileInfos
.
splice
(
fileInfos
.
indexOf
(
info
),
1
);
};
return
informer
;
}]);
app/styles/main.css
View file @
ac7e5fbb
...
...
@@ -188,22 +188,12 @@ div.centrer-cal table{
margin
:
0
auto
;
}
.close
{
color
:
#000
;
float
:
right
;
font-size
:
31px
;
font-weight
:
bold
;
vertical-align
:
middle
;
opacity
:
0.2
;
text-shadow
:
0
1px
0
#fff
;
}
.msg-erreur
{
color
:
red
;
}
/* Gestion de la liste des pays */
.container-liste-pays
{
margin
:
5px
;
...
...
@@ -279,3 +269,61 @@ div.centrer-cal table{
display
:
inline
;
margin
:
5px
;
}
/* Gestion des alertes */
.anim-alerte.ng-enter
,
.anim-alerte.ng-move
{
-webkit-transition
:
1s
linear
all
;
-moz-transition
:
1s
linear
all
;
-o-transition
:
1s
linear
all
;
transition
:
1s
linear
all
;
opacity
:
0
;
}
.anim-alerte.ng-enter.ng-enter-active
,
.anim-alerte.ng-move.ng-move-active
{
opacity
:
1
;
}
.anim-alerte.ng-leave
{
-webkit-animation
:
1s
my_animation
;
-moz-animation
:
1s
my_animation
;
-o-animation
:
1s
my_animation
;
animation
:
1s
my_animation
;
}
@keyframes
my_animation
{
from
{
opacity
:
1
;
}
to
{
opacity
:
0
;
}
}
@-webkit-keyframes
my_animation
{
from
{
opacity
:
1
;
}
to
{
opacity
:
0
;
}
}
@-moz-keyframes
my_animation
{
from
{
opacity
:
1
;
}
to
{
opacity
:
0
;
}
}
@-o-keyframes
my_animation
{
from
{
opacity
:
1
;
}
to
{
opacity
:
0
;
}
}
.conteneur-alertes
{
position
:
absolute
;
width
:
100%
;
}
.design-alertes
{
position
:
relative
;
margin-right
:
30px
;
opacity
:
0.9
;
z-index
:
1001
;
}
app/views/directives/afficheurAlertes.html
View file @
ac7e5fbb
<div
class=
"row"
>
<div
ng-repeat=
"alerte in alertes"
class=
"alert alert-dismiss {{alerte.type}}"
role=
"alert"
>
<div
class=
"row
conteneur-alertes
"
>
<div
ng-repeat=
"alerte in alertes"
class=
"alert alert-dismiss {{alerte.type}}
anim-alerte design-alertes
"
role=
"alert"
>
<span
class=
"glyphicon glyphicon-exclamation-sign"
></span>
{{alerte.msg}}
<button
type=
"button"
class=
"close"
ng-click=
"fermerAlerte(alerte)"
aria-label=
"Close"
>
...
...
bower.json
View file @
ac7e5fbb
...
...
@@ -7,7 +7,8 @@
"es5-shim"
:
"^4.0.0"
,
"bootstrap"
:
"^3.1.1"
,
"angular-route"
:
"1.3.10"
,
"angular-bootstrap"
:
"~0.12.0"
"angular-bootstrap"
:
"~0.12.0"
,
"angular-animate"
:
"~1.3.15"
},
"devDependencies"
:
{
"angular-mocks"
:
"1.3.10"
,
...
...
@@ -15,6 +16,6 @@
},
"appPath"
:
"app"
,
"resolutions"
:
{
"angular"
:
"1.3.1
0
"
"angular"
:
"1.3.1
5
"
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment