parlement 0.13 → 0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. data/CHANGES +15 -0
  2. data/Rakefile +1 -1
  3. data/app/controllers/account_controller.rb +20 -20
  4. data/app/controllers/application.rb +18 -17
  5. data/app/controllers/elt_controller.rb +92 -71
  6. data/app/controllers/subscriber_controller.rb +1 -1
  7. data/app/helpers/elt_helper.rb +2 -1
  8. data/app/models/elt.rb +3 -1
  9. data/app/models/mail.rb +0 -3
  10. data/app/views/_help.rhtml +2 -0
  11. data/app/views/account/_login.rhtml +39 -37
  12. data/app/views/account/_show.rhtml +24 -18
  13. data/app/views/elt/_choice.rhtml +22 -22
  14. data/app/views/elt/_elt.rhtml +73 -64
  15. data/app/views/elt/choices.rhtml +22 -18
  16. data/app/views/elt/list/_byDate.rhtml +71 -0
  17. data/app/views/elt/list/_byVote.rhtml +71 -0
  18. data/app/views/elt/{_list.rhtml → list/_children.rhtml} +3 -3
  19. data/app/views/{subscriber/_list.rhtml → elt/list/_subscribers.rhtml} +0 -0
  20. data/app/views/elt/{_listVisitors.rhtml → list/_visitors.rhtml} +0 -0
  21. data/app/views/elt/{_listByVote.rhtml → list/byVote.rhtml} +3 -2
  22. data/app/views/elt/new.rhtml +26 -11
  23. data/app/views/elt/show.rhtml +32 -31
  24. data/app/views/layouts/_title.rhtml +10 -0
  25. data/app/views/layouts/top.rhtml +41 -23
  26. data/app/views/person/_listElts.rhtml +1 -1
  27. data/app/views/person/show.rhtml +19 -16
  28. data/config/boot.rb +2 -2
  29. data/config/environment.rb +1 -1
  30. data/db/ROOT/perso.txt +214 -0
  31. data/db/development_structure.sql +1 -1
  32. data/public/javascripts/mybehaviour.js +21 -21
  33. data/public/javascripts/prototype.js +1 -1
  34. data/public/javascripts/shadedborder.js +249 -0
  35. data/public/stylesheets/blue.css +471 -0
  36. data/public/stylesheets/default.css +165 -310
  37. data/vendor/plugins/engines/README +2 -0
  38. data/vendor/plugins/engines/Rakefile +18 -0
  39. data/vendor/plugins/engines/lib/engines/testing.rb +0 -1
  40. data/vendor/plugins/engines/tasks/engines.rake +4 -2
  41. data/vendor/plugins/login_engine/app/controllers/user_controller.rb +2 -1
  42. metadata +13 -7
  43. data/app/views/elt/_listByDate.rhtml +0 -76
@@ -0,0 +1,10 @@
1
+ <div class="links">
2
+ <h2><a title="Parlement" href="http://leparlement.org">Parlement</a></h2>
3
+ <span class="signets">
4
+ <a href="/people"><%= _('people') %></a>
5
+ <a href="http://rubyforge.org/projects/parlement">forge</a>
6
+ <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>
7
+ <a id="fr" href="/fr">fr</a>
8
+ </span>
9
+ </div>
10
+
@@ -1,31 +1,52 @@
1
1
  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
3
 
4
- <html>
4
+ <html xmlns="http://www.w3.org/1999/xhtml">
5
5
  <head>
6
- <META name="verify-v1" content="5f3d3AgFwXPbIg9jJA/vBU8lZEz8m/F9InWWVNeJWMU=" />
7
- <META name="verify-v1" content="GQG8JPKekfUN1haTZYQRLP+PvKkH43Rg2HQ53OTLgTg=" />
6
+ <meta name="verify-v1" content="5f3d3AgFwXPbIg9jJA/vBU8lZEz8m/F9InWWVNeJWMU=" />
7
+ <meta name="verify-v1" content="GQG8JPKekfUN1haTZYQRLP+PvKkH43Rg2HQ53OTLgTg=" />
8
8
  <!-- For www.echarp.org -->
9
- <META name="verify-v1" content="GQG8JPKekfUN1haTZYQRLP+PvKkH43Rg2HQ53OTLgTg=" />
9
+ <meta name="verify-v1" content="GQG8JPKekfUN1haTZYQRLP+PvKkH43Rg2HQ53OTLgTg=" />
10
10
  <!-- echarp.dyndns.org -->
11
- <META name="verify-v1" content="6espv1bly2noRX0tNze9x9In903DuzgvEzmAQdDw250=" />
11
+ <meta name="verify-v1" content="6espv1bly2noRX0tNze9x9In903DuzgvEzmAQdDw250=" />
12
12
  <title><%= @title %></title>
13
13
 
14
- <link rel="alternate" type="application/rss+xml" title="Latest Posts - <%= @title %>"
14
+ <link rel="alternate" type="application/rss+xml" title="<%= _('Latest posts') %> - <%= @title %>"
15
15
  href="<%= url_for :action => 'rss', :id => @elt %>"/>
16
- <link rel="alternate" type="application/rss+xml" title="Highest posts - <%= @title %>"
16
+ <link rel="alternate" type="application/rss+xml" title="<%= _('Highest posts') %> - <%= @title %>"
17
17
  href="<%= url_for :action => 'vote_rss', :id => @elt %>"/>
18
18
 
19
- <%= stylesheet_link_tag 'default.css' %>
19
+ <%= stylesheet_link_tag 'default' %>
20
+ <%= stylesheet_link_tag 'blue', :title => 'blue', :rel => 'alternate stylesheet' %>
20
21
  <%= javascript_include_tag "/javascripts/prototype" %>
21
22
  <%= javascript_include_tag "/javascripts/scriptaculous" %>
23
+ <%= javascript_include_tag "/javascripts/shadedborder" %>
22
24
 
23
25
  <%= javascript_include_tag "/javascripts/behaviour" %>
24
26
  <%= javascript_include_tag "/javascripts/mybehaviour" %>
25
27
 
26
28
  <!-- compliance patch for microsoft browsers -->
29
+ <script type="text/javascript">
30
+ var displayBorder = true;
31
+ </script>
27
32
  <!--[if lt IE 7]>
28
- <script type="text/javascript">IE7_PNG_SUFFIX = ".png";</script>
33
+ <style type="text/css">
34
+ body { background: white; }
35
+ #sidebar { background: #ddf; }
36
+ /* Crazy, without that, the "test" or "blog" elements kill ie6 */
37
+ a.knobOpened { position: relative !important; }
38
+ ul.top li.elt {
39
+ width: auto; !important;
40
+ background: none !important; }
41
+ ul.top h1 a, ul.top h2 a {
42
+ border-right: white;
43
+ border-left: white; }
44
+ ul.top li.elt { background: none; }
45
+ </style>
46
+ <script type="text/javascript">
47
+ displayBorder = false;
48
+ //IE7_PNG_SUFFIX = "architecture.png";
49
+ </script>
29
50
  <%= javascript_include_tag "/javascripts/ie7.js" %>
30
51
  <![endif]-->
31
52
 
@@ -37,26 +58,23 @@
37
58
  <meta name="robots" content="index, follow"/>
38
59
  <meta name="keywords" content="collaborative writing, democracy, direct democracy, representative democracy, forum, mailing list, chat, delegable proxy, Ruby on Rails, PostgreSQL"/>
39
60
 
40
- <META NAME="DC.title" CONTENT="Parlement" LANG="en"/>
41
- <META NAME="DC.title" CONTENT="Parlement" LANG="fr"/>
61
+ <meta name="DC.title" content="Parlement" lang="en"/>
62
+ <meta name="DC.title" content="Parlement" lang="fr"/>
42
63
  <meta name="DC.description" content="Parlement, a mix between direct and representative democracy, in the shape of a website. A mailing list, forum, chat. Democratic mailing list and forum"/>
43
- <META NAME="DC.subject" CONTENT="Parlement, democratic mailing list and forum"/>
64
+ <meta name="DC.subject" content="Parlement, democratic mailing list and forum"/>
44
65
  <meta name="DC.keywords" content="collaborative writing, democracy, direct democracy, representative democracy, forum, mailing list, chat, delegable proxy, Ruby on Rails, PostgreSQL"/>
45
66
 
46
67
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
47
- </head>
48
68
 
49
- <body>
50
- <div class="links">
51
- <a class="title" href="http://leparlement.org">Parlement</a>
52
- <span class="signets">
53
- <a href="/people"><%= _('people') %></a>
54
- <a href="http://rubyforge.org/projects/parlement">forge</a>
55
- <a href="http://www.gnu.org/licenses/gpl.html">GPL</a>
56
- <a id="fr" href="/fr">fr</a>
57
- </span>
58
- </div>
69
+ <script type="text/javascript">
70
+ if (displayBorder) {
71
+ var border = RUZEE.ShadedBorder.create({ corner: 8, shadow: 16, border: 2 });
72
+ }
73
+ </script>
74
+ </head>
59
75
 
76
+ <body id="body" class="<%= session[:person] ? "logged" : "anon" %> sb">
77
+ <script type="text/javascript">if (displayBorder) { border.render('body'); }</script>
60
78
  <%= @content_for_layout %>
61
79
 
62
80
  <p class="version">
@@ -50,7 +50,7 @@
50
50
  <span class="author">&lt;<%= elt.created_on.strftime('%d/%m %H:%M') %>&gt;</span>
51
51
  <%= link_to elt.subject.gsub(/\[.*\]/, ''), :id => elt, :controller => 'elt', :action => 'show' %>
52
52
  (<%= elt.children.size %> sub element(s))
53
- <span class="choice result"><%= sprintf("%+d", elt.result) %></span>
53
+ <span class="result"><%= sprintf("%+d", elt.result) %></span>
54
54
  <% "&#160;"*22 %>
55
55
  </li>
56
56
  <% end %>
@@ -1,21 +1,24 @@
1
- <div class="sidebar">
2
- <div class="boxTitle">Avatar</div>
3
- <div class="box" id="identity">
4
- <%= image_tag (@person && @person.image ? @person.image : "/javascripts/blank.gif"), :class => "avatar" %>
5
- </div>
6
-
7
- <% if @person.subscribed_elts.size > 0 %>
8
- <div class="boxTitle">Subscribed elts</div>
9
- <% end %>
1
+ <div id="sidebar">
2
+ <script type="text/javascript">border.render('sidebar');</script>
3
+ <%= render :partial => '/layouts/title' %>
10
4
 
11
- <div class="box">
12
- <% for elt in @person.subscribed_elts.reverse[0...LIST_LENGTH] %>
13
- <div class="boxLine">
14
- <%= link_to(elt.subject.gsub(/\[.*\]/, ''), :controller => 'elt', :action => 'show', :id => elt) %>
15
- <span class="choice result"><%= sprintf("%+d", elt.result) %></span>
16
- </div>
17
- <% end %>
5
+ <div class="box identity" id="identity">
6
+ <h3 class="boxTitle"><%= _('Avatar')%></h3>
7
+ <%= image_tag (@person.image ? @person.image : "/javascripts/blank.gif"),
8
+ :id => "person_avatar", :class => "avatar" %>
18
9
  </div>
10
+
11
+ <% if @person.subscribed_elts.size > 0 %>
12
+ <div class="box" id="listByDate">
13
+ <h3 class="boxTitle"><%= _('Subscribed elts') %></h3>
14
+ <% for elt in @person.subscribed_elts.reverse[0...LIST_LENGTH] %>
15
+ <div class="boxLine">
16
+ <span class="result"><%= sprintf("%+d", elt.result) %></span>
17
+ <%= link_to(elt.subject.gsub(/\[.*\]/, ''), :controller => 'elt', :action => 'show', :id => elt) %>
18
+ </div>
19
+ <% end %>
20
+ </div>
21
+ <% end %>
19
22
  </div>
20
23
 
21
24
  <p class="created_on"><%= @person.created_on %></p>
data/config/boot.rb CHANGED
@@ -3,7 +3,7 @@
3
3
  unless defined?(RAILS_ROOT)
4
4
  root_path = File.join(File.dirname(__FILE__), '..')
5
5
 
6
- unless RUBY_PLATFORM =~ /mswin32/
6
+ unless RUBY_PLATFORM =~ /(:?mswin|mingw)/
7
7
  require 'pathname'
8
8
  root_path = Pathname.new(root_path).cleanpath(true).to_s
9
9
  end
@@ -42,4 +42,4 @@ unless defined?(Rails::Initializer)
42
42
  end
43
43
 
44
44
  Rails::Initializer.run(:set_load_path)
45
- end
45
+ end
@@ -112,5 +112,5 @@ end
112
112
 
113
113
  Rubaidh::GoogleAnalytics.tracker_id = 'UA-317241-1'
114
114
 
115
- PARLEMENT_VERSION='0.13'
115
+ PARLEMENT_VERSION='0.14'
116
116
 
data/db/ROOT/perso.txt ADDED
@@ -0,0 +1,214 @@
1
+ echarp
2
+
3
+ <style>
4
+ .eltSubs, .eltSubsClose { display: none; }
5
+ </style>
6
+
7
+ <div class="sidebar" style="clear:right">
8
+ <div class="boxTitle">Amis et famille</div>
9
+ <div class="box">
10
+ <div class="boxLine">
11
+ Fr�rot <a href="http://www.christhalie.free.fr">christophe</a>,et des
12
+ <a href="http://www.motorun.net">motos!</a>
13
+ </div>
14
+ <div class="boxLine">
15
+ <a href="http://www.copinedegeek.com">Copine De Geek</a>
16
+ </div>
17
+ <div class="boxLine"><a href="http://www.paulhac.org">Coralie</a></div>
18
+ <div class="boxLine">
19
+ <a href="http://inferno.cs.univ-paris8.fr/~naoko/">naoko</a>
20
+ </div>
21
+ <div class="boxLine">
22
+ <a href="http://perso.club-internet.fr/olberger">Olivier Berger</a>
23
+ </div>
24
+ <div class="boxLine">
25
+ <a href="http://jf.hardy.free.fr">JF Hardy</a>
26
+ </div>
27
+ </div>
28
+
29
+ <div class="boxTitle">Un ptit peu de logiciels libres</div>
30
+ <div class="box">
31
+ <a href="http://www.fsf.org">FSF</a>
32
+ <a href="http://april.org">APRIL</a>
33
+ <a href="http://debian.org">debian</a> <a href="http://cocoon.apache.org">Cocoon</a>
34
+ <a href="http://postgresql.org">PostgreSQL</a>
35
+ <a href="http://jboss.org">JBoss</a>
36
+ <a href="http://vim.sf.net">VIM</a>
37
+ <a href="http://web.wt.net/~billw/gkrellm/gkrellm.html">GKrellm</a>
38
+ <a href="http://slashdot.org">/.</a> <a href="http://linuxfr.org">linuxFr</a>
39
+ <a href="http://kuro5hin.org">kuro5hin</a> <a href="http://javalobby.org">javalobby</a>
40
+ </div>
41
+
42
+ <div class="boxTitle">Int�ressants</div>
43
+ <div class="box">
44
+ <div class="boxLineR">
45
+ <a href="http://www.radioparadise.com">Radio Paradise</a>
46
+ </div>
47
+ <div class="boxLine"><a href="http://wikipedia.org">Wikipedia</a></div>
48
+ <div class="boxLine">
49
+ <a href="http://ocw.mit.edu">MIT OpenCourseWare</a>
50
+ </div>
51
+ <div class="boxLine">
52
+ <a href="http://www.edge.org/3rd_culture/bios/dawkins.html" title="vive l'�volution">
53
+ Richard Dawkins</a>
54
+ </div>
55
+ <div class="boxLine" title="Un intello de premi�re">
56
+ Noam Chomsky
57
+ <a href="http://www.zmag.org/chomsky/index.cfm">archive</a>
58
+ &amp;
59
+ <a href="http://blog.zmag.org/ttt/">blog</a>
60
+ </div>
61
+ <div class="boxLine">
62
+ <a href="http://old.law.columbia.edu" title="loi et logiciel libre">
63
+ Eben Moglen</a>
64
+ </div>
65
+ </div>
66
+
67
+ <div class="boxTitle">De mon histoire</div>
68
+ <div class="box">
69
+ <div class="boxLine">
70
+ <a href="http://www.editronics-edu.fr" title="liquid�">Editronics</a>
71
+ </div>
72
+ <div class="boxLine">
73
+ <a href="http://www.alcove.com" title="liquid�">Alc�ve</a>
74
+ </div>
75
+ <div class="boxLine">
76
+ <a href="http://www.fisystem.com" title="liquid�">Fi System</a>
77
+ </div>
78
+ <div class="boxLine">
79
+ <a href="http://www.altran.net">Altran</a>
80
+ </div>
81
+ <div class="boxLine">
82
+ <a href="http://www-iasc.enst-bretagne.fr" title="la Bretagne �a me gagne :)">LIASC</a>
83
+ </div>
84
+ <div class="boxLine">
85
+ <a href="http://www.utbm.fr" title="Brrr, qu'il fait froid � belfort">
86
+ UTBM</a>
87
+ </div>
88
+ <div class="boxLine">
89
+ <a href="http://www.eso.org/projects/vlt/" title="Very Large Telescope, je suis fier d'y avoir particip�">
90
+ VLT</a>
91
+ </div>
92
+ <div class="boxLine">
93
+ <a href="http://www.cge.asso.fr/ecoles/ECOLE32.phtml">
94
+ ENI de Tarbes</a>
95
+ </div>
96
+ <div class="boxLine">
97
+ <a href="http://www.strath.ac.uk" title="Vive l'�cosse!!!">
98
+ Strathclyde University</a>
99
+ </div>
100
+ <div class="boxLine">
101
+ <a href="http://www.tourisme.fr/office-de-tourisme/moncontour.htm" title="... son lac et sa tour">
102
+ Moncontour</a>
103
+ </div>
104
+ <div class="boxLine" title="Trop petit pour un lien, et pourtant c'�tait le grand Vatres">
105
+ Vatres
106
+ </div>
107
+ </div>
108
+ </div>
109
+
110
+ Bonjour le monde
111
+
112
+ Je suis un parisien d'origine paysanne. Cru 1973 et �lev� dans une bonne ferme
113
+ pleine de poules et de ch�vres. Quand j'�tais petit, je passais du temps dans
114
+ les pr�s et les chemins. Autant vous dire que j'�tais un grand fan d'heidi!
115
+
116
+ !{width:10em;float:right;margin:1em;}/images/image/viveLeSki.jpg!:/images/image/viveLeSki.jpg
117
+
118
+ Dire qu'aujourd'hui je suis devenu un intello qui aime se prendre la t�te sur
119
+ toutes sortes de sujets. Politique, philosophie, psychologie, science fiction
120
+ hard.
121
+
122
+ En 1997 j'ai imagin� une chose qui me tient � coeur, un outil d'�criture
123
+ collaborative o� un groupe peut �crire n'importe quel genre de texte structur�
124
+ de mani�re d�mocratique.
125
+
126
+ !{width:10em;float:left;margin:1em;}/images/image/echarp.jpg!:/images/image/echarp.jpg
127
+
128
+ L'id�e est simple (si si), c'est un mix de d�mocratie participative et
129
+ repr�sentative: proposer des �l�ments de texte, voter oui/non pour chaque
130
+ �l�ment propos� (�a c'est de la d�mocratie participative) ou encore d�l�guer
131
+ votre vote � un tiers (d�mocratie repr�sentative). Votre d�l�gu� peut lui m�me
132
+ d�l�guer � un autre, c'est transitif (et tr�s compliqu� en cas de boucle). Les
133
+ votes sont permanents, c'est � dire que l'on peut changer d'avis � tout moment.
134
+ Cette permanence r�duit grandement l'int�r�t des diff�rentes m�thodes de votes
135
+ comme condorcet ou par tour.
136
+
137
+ Ah, l'outil s'appelle "VeniVidiVoti":http://echarp.dyndns.org, oui oui, le nom
138
+ est idiot expr�s :)
139
+
140
+ Pour moi ces projets sont importants, car cela fait partie de ma nature:
141
+ j'adore construire, imaginer. D�j� tout petit je faisais plein de trucs
142
+ inutilies avec des l�gos. Comme quoi avec les ann�es on ne change pas tant que
143
+ �a...
144
+
145
+ <pre style="float: left; color: #aa0;">
146
+
147
+ \ | /
148
+ |
149
+ ___
150
+ \ /
151
+ \_|_/
152
+ \ | /
153
+ </pre>
154
+ <pre style="float: left; color: #aa0;">
155
+
156
+ \ | /
157
+ |
158
+ ___
159
+ \ /
160
+ .
161
+ </pre>
162
+
163
+ Les deux figures bizarres � gauche sont le clavier d'un alphabet imaginaire. Je
164
+ l'appelle smile :)
165
+
166
+ !{float:right; margin-left:1em; width:14em;}/images/image/smileCircles.png!:/images/image/smileCircles.png
167
+
168
+ Cela consiste en six traits qui forment un carr� et ses diagonales. Six carr�s
169
+ forment les six faces d'un cube. En vue isom�trique cela donne deux hexagones.
170
+
171
+ Mais bon, c'est bien gentil d'avoir des mots qui peuvent �tre repr�sent�s en 3D
172
+ ou sous des projections �tranges, mais je n'ai aucune s�mantique � leur
173
+ appliquer... Pourtant il y a plein de combinaisons/mots possibles! Si vous avez
174
+ une id�e appelez moi!
175
+
176
+ Euh, sinon je tiens � ajouter une chose pour toutes les femmes qui passent ici:
177
+ je suis grand, b�, fort, riche et tr�s intelligent. Et puis modeste bien s�r.
178
+ J'ai �t� �lev� au grand air, � la ferme. Je suis facile � vivre et fr�le la
179
+ !{width:13em; float:right; margin:1em;}/images/image/cheveuxLongs.jpg!:/images/image/cheveuxLongs.jpg
180
+ perfection en tout. Pour entretenir mon corps de dieu grec je fais de la
181
+ piscine, et puis je poss�de des rollers (les salauds, ils ne sortent plus
182
+ depuis qq temps d�j�).
183
+
184
+ Ma photo en ski c'est pour la frime. En 93 je me suis lux� l'�paule en
185
+ descendant une rouge (je le savais bien, moi, qu'il fallait pas prendre une
186
+ rouge d�s le premier jour, d�s la premi�re descente). En 2003 je me suis relux�
187
+ l'�paule (quand on aime on ne compte pas), mais cette fois-ci en poursuivant le
188
+ m�tro. Salopris de gr�ves et de sol mouill�!!! Bref en 2004 j'�tais heureux de
189
+ constater ma capacit� � vraiment faire du ski, du vrai de vrai qu'on tombe et
190
+ tout et tout, mais qu'on aime �a.
191
+
192
+ !{float:left; margin:1em;}/images/image/cdgRomanPhoto.jpg!:http://copinedegeek.com
193
+ Les informaticiens qui aiment ce qu'ils font sont parfois appel�s des geeks. Et
194
+ parce que c'est une situation insupportable les copines de geeks se sont
195
+ r�unies en une "association":http://copinedegeek.com o� elles peuvent se r�unir
196
+ et �changer. Enfin surtout se moquer de leurs amis.
197
+
198
+ Voil� un roman photo idiot o� j'�tais heureux de participer: "le geek qui
199
+ murmurait � l'oreille des PC".
200
+
201
+ !{width:15em; float:right; margin:1em;}/images/image/capture.png!:/images/image/capture.png
202
+ Pour le fun et vous montrer ce qu'est un geek, voici mon bureau. Je suis dessus
203
+ une large partie de mes journ�es.
204
+
205
+ Vous pouvez voir un navigateur (galeon bas� sur mozilla), gkrellm qui me permet
206
+ de suivre l'�tat de mes ordinateurs (3 en ce moment), 3 terminaux avec irssi
207
+ pour le chat, vim pour �diter ce texte, et xtail pour suivre l'�tat de mon
208
+ serveur de d�veloppement.
209
+
210
+ En haut � droite c'est un xplanet avec la couverture nuageuse du moment.
211
+
212
+ Bon, je parlerai de politique une prochaine fois ;)
213
+
214
+ Bye bye
@@ -2,7 +2,7 @@
2
2
  -- PostgreSQL database dump
3
3
  --
4
4
 
5
- SET client_encoding = 'LATIN9';
5
+ SET client_encoding = 'LATIN1';
6
6
  SET standard_conforming_strings = off;
7
7
  SET check_function_bodies = false;
8
8
  SET client_min_messages = warning;
@@ -1,13 +1,7 @@
1
+ //var border = RUZEE.ShadedBorder.create({ corner:8, shadow:16, border:2 });
1
2
  var myrules = {
2
- /*
3
- * Possibility to open and close elements
4
- *
5
- * Two things:
6
- * - an opening or closing will open or close all sub elements
7
- * - an opened element contained by a closed element will be closed if any
8
- * sub element is also closed (due to technical limitations)
9
- */
10
- '.eltSub' : function(elt) {
3
+ '#sidebar' : function(elt) {
4
+ border.render(elt);
11
5
  }
12
6
  };
13
7
 
@@ -16,7 +10,7 @@ var myrules = {
16
10
  /* Called for each element to set its knobs */
17
11
  function setKnobs(elt) {
18
12
  // To not filter out the top element
19
- if (elt.parentNode.getAttribute('class') == 'top') return;
13
+ if (Element.hasClassName(elt.parentNode, 'top')) return;
20
14
 
21
15
  var knobOpened = document.createElement("a");
22
16
  Element.addClassName(knobOpened, "knobOpened");
@@ -41,9 +35,9 @@ function setKnobs(elt) {
41
35
  */
42
36
  function setKnob(elt, result) {
43
37
  // To not filter out the top element
44
- if (elt.parentNode.getAttribute('class') == 'top') return;
38
+ if (Element.hasClassName(elt.parentNode, 'top')) return;
45
39
 
46
- var f = document.filterForm.filter;
40
+ var f = $("filterForm").filter;
47
41
  var filter = parseInt(f.options[f.selectedIndex].value);
48
42
 
49
43
  if (filter == 'null' || result >= filter) {
@@ -122,37 +116,37 @@ function setCookie(name, value) {
122
116
  * The parameter 'filter' is not the value itself, but an index!
123
117
  */
124
118
  function setFilter(filter, elt) {
125
- setCookie('filter', document.filterForm.filter.selectedIndex);
119
+ setCookie('filter', $("filterForm").filter.selectedIndex);
126
120
 
127
121
  new Ajax.Updater('listByVote', '/elt/listByVote/'+elt, { asynchronous:true, evalScripts:true });
128
122
  new Ajax.Updater('listByDate', '/elt/listByDate/'+elt, { asynchronous:true, evalScripts:true });
129
123
 
130
124
  document.getElementsByClassName('result').each( function(result) {
131
125
  //alert(parseInt(result.innerHTML)+', '+filter);
132
- Element.removeClassName(result.parentNode.parentNode.parentNode, 'opened');
126
+ Element.removeClassName(result.parentNode.parentNode, 'opened');
133
127
  if (filter == 'null' || parseInt(result.innerHTML) >= parseInt(filter)) {
134
- Element.removeClassName(result.parentNode.parentNode.parentNode, 'closed');
128
+ Element.removeClassName(result.parentNode.parentNode, 'closed');
135
129
  } else if (parseInt(result.innerHTML) < parseInt(filter)) {
136
- Element.addClassName(result.parentNode.parentNode.parentNode, 'closed');
130
+ Element.addClassName(result.parentNode.parentNode, 'closed');
137
131
  }
138
132
  });
139
133
  }
140
134
 
141
135
  function setFilterFromCookie() {
142
136
  if (getCookie('filter') != null) {
143
- document.filterForm.filter.selectedIndex = getCookie('filter');
137
+ $("filterForm").filter.selectedIndex = getCookie('filter');
144
138
  }
145
139
  }
146
140
 
147
141
  function decrementFilter() {
148
- document.filterForm.filter.selectedIndex--;
149
- document.filterForm.filter.onchange();
142
+ $("filterForm").filter.selectedIndex--;
143
+ $("filterForm").filter.onchange();
150
144
  return false;
151
145
  }
152
146
 
153
147
  function incrementFilter() {
154
- document.filterForm.filter.selectedIndex++;
155
- document.filterForm.filter.onchange();
148
+ $("filterForm").filter.selectedIndex++;
149
+ $("filterForm").filter.onchange();
156
150
  return false;
157
151
  }
158
152
 
@@ -176,6 +170,12 @@ function updateChoices(choices) {
176
170
  Element.addClassName(choice, 'selected');
177
171
  }
178
172
  });
173
+ $A(document.getElementsByClassName('result', document.body)).each( function(choice) {
174
+ if (choices[choice.parentNode.parentNode.id] == "-1"
175
+ || choices[choice.parentNode.parentNode.id] == "1") {
176
+ Element.addClassName(choice, 'selected');
177
+ }
178
+ });
179
179
  $A(document.getElementsByClassName('pro', document.body)).each( function(choice) {
180
180
  if (choices[choice.parentNode.parentNode.parentNode.id] == "1") {
181
181
  Element.addClassName(choice, 'selected');
@@ -2512,4 +2512,4 @@ if (/Konqueror|Safari|KHTML/.test(navigator.userAgent)) {
2512
2512
  }
2513
2513
  }
2514
2514
 
2515
- Element.addMethods();
2515
+ Element.addMethods();