-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
executable file
·255 lines (225 loc) · 12.2 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>On teste angularJS</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="bower_components/animate.css/animate.min.css" media="screen"/>
<link rel="stylesheet" href="bower_components/materialize/dist/css/materialize.min.css" media="screen"/>
<link rel="stylesheet" href="bower_components/angular-materialize/css/style.css" media="screen" >
<!-- Angular Material style sheet -->
<style media="screen">
.card .card-image img {
display: inline-block;
left: 40%;
width: 20%;
}
#merde {
display: block;
}
</style>
</head>
<!-- Pour angular, tout le body est une application qui se nomme MyPhonesApp -->
<!-- ng-X est une directive propre à angularjs -->
<body ng-app="MyApp">
<!-- Une applicaton peut contenir un ou plusieurs contrôleurs -->
<!-- Un contrôleur est une zone de contrôle pour angular -->
<div class="container" ng-controller="MainCtrl">
<!-- {{ title }} sert à afficher la variable de la $scope -->
<h2>{{ title }}</h2>
<div class="row"> <!-- Carte calculs etc -->
<div class="col s12 m6">
<div class="card blue-grey darken-1">
<div class="card-content white-text">
<span class="card-title">Traitement données</span>
<p ng-show="utilisateurs.length > 1">Nombre d'utilisateurs : {{ utilisateurs.length }}</p>
<p ng-show="utilisateurs.length == 0">Aucun utilisateur trouvé</p>
<p ng-hide="!utilisateurs.length">Moyenne d'âge : {{ moyenneAge() }} ans</p>
<p ng-show="(vieux() > utilisateurs.length/2)">Il y a plus de jeunes que de vieux... Soit {{ vieux() }} personnes de moins de 46 ans</p>
</div>
</div>
<!-- Dropdown Trigger -->
<a class='dropdown-button btn' href='#' data-activates='dropdown1'>Utilisateurs en favoris</a>
<!-- Dropdown Structure -->
<ul id='dropdown1' class='dropdown-content'>
<li class="divider"></li>
<li ng-repeat="utilisateur in utilisateurs | fav:lesLikes"><a href="#!">{{ utilisateur.NomPrenom }}</a></li>
</ul>
<div>
<p>
Trier par ville : <br>
<input id="toutes" type="radio" name="region" value="" ng-model="selectedRadioDeMerde">
<label for="toutes">Toutes</label><br>
<input id="Lyon" type="radio" name="region" value="Lyon" ng-model="selectedRadioDeMerde">
<label for="Lyon">Lyon</label><br>
<input id="Marseille" type="radio" name="region" value="Marseille" ng-model="selectedRadioDeMerde">
<label for="Marseille">Marseille</label><br>
<input id="Paris" type="radio" name="region" value="Paris" ng-model="selectedRadioDeMerde">
<label for="Paris">Paris</label>
</p>
</div>
<div>
<p>
Trier par tranche d'âge : <br>
<input id="tout" type="radio" name="intervalleAge" value="" ng-model="trancheAge">
<label for="tout">Tout</label><br>
<input id="1020" type="radio" name="intervalleAge" value="^(([1][0-9])|(20))$" ng-model="trancheAge">
<label for="1020">10-20 ans</label><br>
<input id="2030" type="radio" name="intervalleAge" value="^(([2][1-9])|(30))$" ng-model="trancheAge">
<label for="2030">20-30 ans</label><br>
<input id="3040" type="radio" name="intervalleAge" value="^(([3][1-9])|(40))$" ng-model="trancheAge">
<label for="3040">30-40 ans</label><br>
<input id="4050" type="radio" name="intervalleAge" value="^([4][1-9])|(50)$" ng-model="trancheAge">
<label for="4050">40-50 ans</label><br>
<input id="50plus" type="radio" name="intervalleAge" value="^(5[1-9]|[6-9][0-9])$" ng-model="trancheAge">
<label for="50plus">50 ans et plus</label><br>
</p>
<div class="switch">
<p>
Trier par majorité
</p>
<label>
Mineurs
<input type="checkbox" ng-model="tousMineurs">
<span class="lever"></span>
Majeurs
</label>
</div>
</div>
</div>
</div>
<div class="row">
<form action="#">
<p>
Trier par note de bac
</p>
<p class="range-field">
<input value="0" ng-model="triNoteBac" type="range" id="triNoteBac" min="0" max="20" />
<label for="triNoteBac">Note du bac</label>
</p>
</form>
</div>
<div class="row">
<input type="date" ng-change="filtre" ng-model="filtre">
<input type="text" name="NP" placeholder="Chercher un nom ou un prénom dans les cards" ng-model="triNomPrenom">
<input type="text" name="departement" placeholder="Chercher un département par Code Postal dans les cards" ng-model="departement">
<div>
<p>
Trier par :
</p>
<select id="merde" ng-change="search" ng-model="search">
<option value="" disabled selected>Choisir une option</option>
<option value="nom">Nom</option>
<option value="prenom">Prénom</option>
<option value="age">Âge</option>
<option value="noteBac">Note au bac</option>
<option value="ville">Ville</option>
</select>
</div>
</div>
<div class="row">
<div class="collection col s6" ng-repeat="user in utilisateurs | filter:selectedRadioDeMerde | orderTab:trancheAge | filtreAge:filtre | triNoteBacFilter:triNoteBac | mineur:tousMineurs | filter:{NomPrenom:triNomPrenom} | filter:{codeP:departement} |orderBy:search" >
<div class="card col s12">
<i ng-show="moisAnnif(user)" class="material-icons animated infinite swing">cake</i>
<div class="card-image waves-effect waves-block waves-light">
<img class="activator" ng-src="{{ user.photo }}">
</div>
<div class="col s12 center">
<button ng-click="suppUser(user)" class="btn-floating" type="button" name="button">
<i class="material-icons">delete_sweep</i>
</button>
<button ng-click="plusUn(user.aydee)" class="btn-floating" type="button" name="button">
<i class="material-icons blue">plus_one</i>
</button>
<button ng-click="addLikeOrRemove(user)" class="btn-floating" type="button" name="button"> <!-- Ajoute ou enlève l'ID de l'user au clique -->
<i ng-show="estDedans(user.aydee) == false" class="material-icons pink">favorite_border</i>
<i ng-show="estDedans(user.aydee) == true" class="material-icons red">favorite</i>
<!-- dans le i, juste vérifier la présence de l'indice dans le tableau lesLikes -->
</button>
</div>
<div class="card-content">
<span class="card-title activator grey-text text-darken-4">#{{ user.aydee }} {{ user.prenom }} {{ user.nom }}<i class="material-icons right">more_vert</i></span>
<p>Date de naissance : {{ user.birth }} - {{ user.age }} ans</p>
<p>Sexe : {{ user.sexe | sexe}}</p>
<p>Langue : <img ng-src="{{ user.langue | drapeau }}"/></p>
<p ng-show="nbrPlus[user.aydee] != undefined">Nombre de votes : +{{ nbrPlus[user.aydee] }}</p>
</div>
<div class="card-reveal">
<p>Ville : {{ user.ville }}</p>
<p ng-class="{red:user.noteBac < 10}">Note du Baccalauréat : {{ user.noteBac }}/20</p>
<span class="card-title grey-text text-darken-4">Biographie<i class="material-icons right">close</i></span>
<p>{{ user.bio }}</p>
</div>
</div>
</div>
</div>
<div class="row">
<form class="col s12" ng-submit="add()">
<div class="row">
<div class="input-field col s6">
<input ng-model="sexe" id="keum" value="true" name="sexe" type="radio" class="validate">
<label for="keum">Homme</label>
<input ng-model="sexe" id="meuf" value="false" name="sexe" type="radio" class="validate">
<label for="meuf">Femme</label>
</div>
<div class="clearfix clear"> </div>
<div class="input-field col s6">
<input ng-model="prenom" ng-trim="true" id="first_name" type="text" class="validate" placeholder="Prenom">
</div>
<div class="input-field col s6">
<input ng-model="nom" ng-trim="true" id="last_name" type="text" class="validate" placeholder="Nom">
</div>
<div class="input-field col s3">
<input ng-model="age" ng-trim="true" id="age" type="text" class="validate" placeholder="Age">
</div>
<div class="input-field col s6">
<input ng-model="photo" ng-trim="true" id="photo" type="text" class="validate" placeholder="Photo">
</div>
<div class="input-field col s6">
<input ng-model="birth" ng-trim="true" id="dob" type="date" class="validate">
</div>
<div class="input-field col s6">
<input ng-model="ville" id="lyon" value="Lyon" name="city" type="radio" class="validate">
<label for="lyon">Lyon</label>
<input ng-model="ville" id="paris" value="Paris" name="city" type="radio" class="validate">
<label for="paris">Paris</label>
<input ng-model="ville" id="marseille" value="Marseille" name="city" type="radio" class="validate">
<label for="marseille">Marseille</label>
</div>
<div class="input-field col s6">
<input ng-model="noteBac" ng-trim="true" id="bac" type="text" class="validate" placeholder="Note Bac">
</div>
<div class="input-field col s6">
<textarea ng-model="bio" ng-trim="true" id="biographie" class="materialize-textarea" placeholder="Biographie"></textarea>
</div>
<div class="input-field col s6">
<textarea ng-model="langue" ng-trim="true" id="langue" class="materialize-textarea" placeholder="Langue"></textarea>
</div>
<div class="input-field col 12">
<button type="submit" class="waves-effect waves-light btn" onclick="Materialize.toast('Utilisateur créé', 4000, 'rounded')" name="button">Enregistrer cet utilisaturs</button>
</div>
</div>
</form>
</div>
</div> <!-- Fin de container MainCtrl -->
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.2/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<!-- My librairies underscore animate moment materialize angular -->
<script src="bower_components/angular/angular.min.js" charset="utf-8"></script>
<script src="bower_components/moment/min/moment.min.js" charset="utf-8"></script>
<script src="bower_components/underscore/underscore-min.js" charset="utf-8"></script>
<script src="bower_components/jquery/dist/jquery.min.js" charset="utf-8"></script>
<script src="bower_components/materialize/dist/js/materialize.min.js" charset="utf-8"></script>
<script src="bower_components/angular-materialize/src/angular-materialize.js" charset="utf-8"></script>
<script src="main.js" charset="utf-8"></script>
<!-- <script type="text/javascript">
Materialize.toast('I am a toast!', 4000);
</script> -->
</body>
</html>