Papy-tools 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,271 @@
1
+ <html>
2
+ <head>
3
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8">
4
+
5
+ <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js" type="text/javascript"></script>
6
+
7
+ <script type="text/javascript">
8
+
9
+ function cycle(){
10
+ $("tr.joueur").removeClass("ligneclaire lignefonce visible");
11
+ last="ligneclaire";
12
+ $("tr.joueur").each(function(i){
13
+ has_class=$(this).hasClass("invisible");
14
+ if(has_class == false){
15
+ $(this).addClass("visible");
16
+ }
17
+ });
18
+ $("tr.visible").each(function(i){
19
+ if(last == "ligneclaire"){
20
+ $(this).addClass("lignefonce");
21
+ last="lignefonce";
22
+ }
23
+ else{
24
+ $(this).addClass("ligneclaire");
25
+ last="ligneclaire";
26
+ };
27
+ });
28
+ }
29
+
30
+ function select(ligne,texte,filtre){
31
+ if( (filtre != "tous") && (filtre != texte)){
32
+ ligne.addClass("invisible");
33
+ }
34
+ }
35
+
36
+ function debug(message){
37
+ $("#debug").append(message+"<br/>");
38
+ }
39
+
40
+ function element_selected(){
41
+ categorie=$("#categorie option:selected").html();
42
+ ligue=$("#ligue option:selected").html();
43
+ club=$("#club option:selected").html();
44
+ message="";
45
+ if(categorie != "tous"){
46
+ message+="catégorie:"+categorie;
47
+ }
48
+ if(ligue != "tous"){
49
+ if(message !=""){
50
+ message+=" et ";
51
+ }
52
+ message+="ligue:"+ligue;
53
+ }
54
+ if(club != "tous"){
55
+ if(message !=""){
56
+ message+=" et ";
57
+ }
58
+ message+="club:"+club;
59
+ }
60
+ $("#filtre").text("filtre par "+message);
61
+ $("tr.joueur").removeClass("invisible");
62
+ $("tr.joueur").each(function(i){
63
+ cel_categorie=$(this).children().eq(5).html();
64
+ cel_ligue=$(this).children().eq(6).html();
65
+ cel_club=$(this).children().eq(7).html();
66
+ select($(this),cel_categorie,categorie);
67
+ select($(this),cel_ligue,ligue);
68
+ select($(this),cel_club,club);
69
+ });
70
+ cycle();
71
+ }
72
+
73
+ $(document).ready(function(){
74
+ $("#categorie option").click(function(event){
75
+ element_selected();
76
+ });
77
+ $("#ligue option").click(function(event){
78
+ option=$("#club").children().eq(0);
79
+ option.prop("selected",true);
80
+ element_selected();
81
+ });
82
+ $("#club option").click(function(event){
83
+ option=$("#ligue").children().eq(0);
84
+ option.prop("selected",true);
85
+ element_selected();
86
+ });
87
+ });
88
+ </script>
89
+
90
+
91
+ <style type="text/css">
92
+ table #grille{
93
+ background: #F1EFE2;
94
+ font: normal 80%/1em Arial,Helvetica;
95
+ color: #382E1F;
96
+ margin: 0;
97
+ padding: 0 0 2em 0;
98
+ text-align: left;
99
+ line-height:1.3;
100
+ }
101
+ .invisible{
102
+ display:none;
103
+ }
104
+ table{
105
+ border-collapse:collapse;
106
+ }
107
+ tr{
108
+ color:#382E1F;
109
+ width: 600px;
110
+ }
111
+ tr.lignefonce{
112
+ background:#E6D6BD;
113
+ border:#FFFFFF solid 3px;
114
+ font-weight:bold;
115
+ }
116
+ tr.ligneclaire{
117
+ background:#F7EEDF;
118
+ border:#FFFFFF solid 3px;
119
+ color:#382E1F;
120
+ font-weight:normal;
121
+ }
122
+ td{
123
+ padding-top:3px;
124
+ padding-bottom:3px;
125
+ }
126
+
127
+ div.infobox{
128
+ position:relative;
129
+ width:100%;
130
+ z-index:0;
131
+ }
132
+ div.infobox:hover {
133
+ position:relative;
134
+ width:100%;
135
+ z-index:50;
136
+ }
137
+ div.infobox table{
138
+ float: right;
139
+ width:100%;
140
+ }
141
+ div.infobox table tr{
142
+
143
+ }
144
+
145
+
146
+ div.infobox .more{
147
+ display:none;
148
+ border:black solid 1px;
149
+
150
+ }
151
+ div.infobox:hover .more{
152
+ display:block;
153
+ position:absolute;
154
+ left:4px;
155
+ top:4px;
156
+ width:540px;
157
+ padding:10px 10px 10px 10px;
158
+ border:1px solid grey;
159
+ background-color:white;
160
+ color:#382E1F;
161
+ }
162
+
163
+ div.noir{
164
+ border: 1px solid #848484;
165
+ background-color:black;
166
+ float: left;
167
+ padding: 5px;
168
+ margin-top:4px;
169
+ margin-right:2px;
170
+ }
171
+ div.blanc{
172
+ border: 1px solid #848484;
173
+ background-color:white;
174
+ float: left;
175
+ padding: 5px;
176
+ margin-top:4px;
177
+ margin-right:2px;
178
+ }
179
+ </style>
180
+ </head>
181
+ <h2><%=@tournoi.titre%></h2>
182
+ <p>
183
+ <strong>Pointer</strong>
184
+ la souris sur le nom du joueur pour afficher le cadre de ses résultats.
185
+
186
+ </p>
187
+ <p id="debug">
188
+ </p>
189
+ <p id="filtre">
190
+ </p>
191
+ <form>
192
+ <select id="ligue">
193
+ <option>tous</option>
194
+ <%@ligues.each do |ligue|%>
195
+ <option><%=ligue%></option>
196
+ <%end%>
197
+ </select>
198
+ <select id="club">
199
+ <option>tous</option>
200
+ <%@clubs.each do |club|%>
201
+ <option><%=club%></option>
202
+ <%end%>
203
+ </select>
204
+ <select id="categorie">
205
+ <option>tous</option>
206
+ <%@categories.each do |categorie|%>
207
+ <option><%=categorie%></option>
208
+ <%end%>
209
+ </select>
210
+ </form>
211
+ <table id="grille">
212
+ <tr>
213
+ <td>Pl</td>
214
+ <td>&nbsp;</td>
215
+ <td>Nom</td>
216
+ <td>Elo</td>
217
+ <td <%=visibilite(:categorie)%>>Cat.</td>
218
+ <td <%=visibilite(:pays)%>>Fede</td>
219
+ <td <%=visibilite(:ligue)%>>Ligue</td>
220
+ <td <%=visibilite(:club)%>>club</td>
221
+ <%1.step(@tournoi.nombre_rondes,1) do |i|%>
222
+ <td>Rd<%=i%></td>
223
+ <%end%>
224
+ <td>Pts</td>
225
+ <%if @tournoi.departages%>
226
+ <%@tournoi.departages.each do |departage| %>
227
+ <td <%=visibilite(:departages)%>><%=departage%></td>
228
+ <%end%>
229
+ <%end%>
230
+ </tr>
231
+ <%@joueurs_filtres.each do |j|%>
232
+ <tr class="<%=couleur_ligne(@couleur)%> joueur">
233
+ <td><%=j.place%></td>
234
+ <td><%=format_titre(j.titre)%></td>
235
+ <td><div class="infobox">
236
+ <%=j.nom%>
237
+ <div class="more">
238
+ <table>
239
+ <%j.rondes.each do |ronde|%>
240
+ <tr class=<%=couleurligne(ronde.numeroronde)%>>
241
+ <td><%=couleur_joueur(ronde,:div)%><%=j.nom%></td>
242
+ <td><%=j.elo%></td>
243
+ <td><%=ronde.resultat%>
244
+ <td><%=couleur_joueur_adversaire(ronde,:div)%>
245
+ <%=nom_adversaire(ronde,@joueurs)%>
246
+ </td>
247
+ <td><%=elo_adversaire(ronde,@joueurs)%></td>
248
+ </tr>
249
+ <%end%>
250
+ </table>
251
+ </div>
252
+ </div>
253
+ </td>
254
+ <td><%=j.elo%></td>
255
+ <td <%=visibilite(:categorie)%>><%=j.categorie%></td>
256
+ <td <%=visibilite(:pays)%>><%=j.pays%></td>
257
+ <td <%=visibilite(:ligue)%>><%=j.ligue%></td>
258
+ <td <%=visibilite(:club)%>><%=j.club%></td>
259
+ <%j.rondes.each do |ronde|%>
260
+ <td><%=ronde.resultat_condense()%></td>
261
+ <%end%>
262
+ <td><%=j.pts%></td>
263
+ <%if @tournoi.departages%>
264
+ <%j.departages.each do |departage|%>
265
+ <td <%=visibilite(:departages)%>><%=departage%></td>
266
+ <%end%>
267
+ <%end%>
268
+ </tr>
269
+ <%end%>
270
+ </table>
271
+ </html>
@@ -0,0 +1 @@
1
+ <%=@tournoi.to_a.to_json%>
@@ -0,0 +1 @@
1
+ <%=@tournoi.to_yaml%>
metadata ADDED
@@ -0,0 +1,125 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: Papy-tools
3
+ version: !ruby/object:Gem::Version
4
+ hash: 29
5
+ prerelease:
6
+ segments:
7
+ - 0
8
+ - 1
9
+ - 3
10
+ version: 0.1.3
11
+ platform: ruby
12
+ authors:
13
+ - Fabien Turmel
14
+ autorequire:
15
+ bindir: bin
16
+ cert_chain: []
17
+
18
+ date: 2011-11-30 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rake
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :development
33
+ version_requirements: *id001
34
+ - !ruby/object:Gem::Dependency
35
+ name: yard
36
+ prerelease: false
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ">="
41
+ - !ruby/object:Gem::Version
42
+ hash: 3
43
+ segments:
44
+ - 0
45
+ version: "0"
46
+ type: :development
47
+ version_requirements: *id002
48
+ - !ruby/object:Gem::Dependency
49
+ name: hpricot
50
+ prerelease: false
51
+ requirement: &id003 !ruby/object:Gem::Requirement
52
+ none: false
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ hash: 3
57
+ segments:
58
+ - 0
59
+ version: "0"
60
+ type: :runtime
61
+ version_requirements: *id003
62
+ description: "outils qui permet de transformer les fichiers html g\xC3\xA9neres par papy en des grilles americaines adapt\xC3\xA9s au web"
63
+ email: thegnou2@gmail.com
64
+ executables:
65
+ - papy-tools
66
+ extensions: []
67
+
68
+ extra_rdoc_files:
69
+ - LICENSE
70
+ - README.md
71
+ - NEWS.md
72
+ files:
73
+ - bin/papy-tools
74
+ - lib/papy-tools/fabriquetournoi.rb
75
+ - lib/papy-tools/commande.rb
76
+ - lib/papy-tools/presentation.rb
77
+ - lib/papy-tools/fabriquejoueur.rb
78
+ - lib/papy-tools/tournoi.rb
79
+ - lib/papy-tools.rb
80
+ - helper/defaulthelper.rb
81
+ - template/format.yaml.erb
82
+ - template/format.json.erb
83
+ - template/etendu.html.erb
84
+ - template/default.html.erb
85
+ - Rakefile
86
+ - LICENSE
87
+ - README.md
88
+ - NEWS.md
89
+ homepage: http://www.caenalekhine.fr/papy-tools.html
90
+ licenses: []
91
+
92
+ post_install_message:
93
+ rdoc_options:
94
+ - --main
95
+ - README.md
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ none: false
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ hash: 3
104
+ segments:
105
+ - 0
106
+ version: "0"
107
+ required_rubygems_version: !ruby/object:Gem::Requirement
108
+ none: false
109
+ requirements:
110
+ - - ">="
111
+ - !ruby/object:Gem::Version
112
+ hash: 3
113
+ segments:
114
+ - 0
115
+ version: "0"
116
+ requirements: []
117
+
118
+ rubyforge_project:
119
+ rubygems_version: 1.8.11
120
+ signing_key:
121
+ specification_version: 3
122
+ summary: outils pour creer des grilles americaines
123
+ test_files: []
124
+
125
+ has_rdoc: