1 | <?php $sf_response->setTitle('NosDéputés.fr : Observatoire citoyen de l\'activité parlementaire'); $style = "xneth"; ?> |
---|
2 | <script type="text/javascript"> |
---|
3 | <!-- |
---|
4 | // preload img fond sous-menu |
---|
5 | $('<img />').attr('src', '<?php echo $sf_request->getRelativeUrlRoot()."/css/".$style."/images/sous_menu_combined.png"; ?>'); |
---|
6 | |
---|
7 | // Widget page d'accueil |
---|
8 | commentaires = new Array (); |
---|
9 | commentaires_update = new Array (); |
---|
10 | apparait = 500; |
---|
11 | disparait = 300; |
---|
12 | change = 7000; |
---|
13 | update = 60000; |
---|
14 | reprends_a = 0; |
---|
15 | timerWidget = null; |
---|
16 | i = 0; |
---|
17 | |
---|
18 | $(document).ready(function() { |
---|
19 | getWidget(); |
---|
20 | timerUpdate = setInterval(function(){updateWidget();}, update); |
---|
21 | }); |
---|
22 | |
---|
23 | function getWidget() { |
---|
24 | $.ajax({ |
---|
25 | url: "<?php echo url_for('@commentaires_widget'); ?>", |
---|
26 | async: true, |
---|
27 | cache: false, |
---|
28 | beforeSend: function(xhr) { |
---|
29 | xhr.setRequestHeader("If-Modified-Since","0"); |
---|
30 | commentaires = new Array (); // à virer |
---|
31 | i = 0; |
---|
32 | $(".box_widget").css("overflow", "hidden"); |
---|
33 | $("#coms_widget").css("overflow", "hidden"); |
---|
34 | $("#coms_widget").css("display", "none"); |
---|
35 | $(".box_widget h2").append('<div id="chargement_widget"><\/div>'); |
---|
36 | }, |
---|
37 | success: function(html){ |
---|
38 | if ($.browser.msie == true) { |
---|
39 | obj = document.getElementById("coms_widget"); |
---|
40 | obj.innerHTML = html; |
---|
41 | } |
---|
42 | else { |
---|
43 | $("#coms_widget").text(""); |
---|
44 | $("#coms_widget").append(html); |
---|
45 | } |
---|
46 | launchWidget(); |
---|
47 | }, |
---|
48 | complete: function() { |
---|
49 | $("#coms_widget").fadeIn(1000); |
---|
50 | $("#chargement_widget").remove(); |
---|
51 | } |
---|
52 | }); |
---|
53 | } |
---|
54 | |
---|
55 | function launchWidget() { |
---|
56 | $(".commentaire_widget").each(function () { |
---|
57 | commentaires[i] = $(this).attr("id"); |
---|
58 | $(this).css("display", "none"); |
---|
59 | i++; |
---|
60 | }); |
---|
61 | changeCommentaire(0); |
---|
62 | } |
---|
63 | |
---|
64 | function changeCommentaire(i) { |
---|
65 | if(i == commentaires.length) { i = 0; } |
---|
66 | cache = i - 2; |
---|
67 | if(i == 0) { cache = commentaires.length -2; } |
---|
68 | if(i == 1) { cache = commentaires.length -1; } |
---|
69 | com_suivant = $("#"+commentaires[i]).detach(); |
---|
70 | $("#coms_widget").prepend(com_suivant); |
---|
71 | com_suivant = null; |
---|
72 | $("#"+commentaires[cache]).fadeOut(disparait); |
---|
73 | $("#"+commentaires[i]).slideDown(apparait); |
---|
74 | i++; |
---|
75 | timerWidget = setTimeout(function(){changeCommentaire(i);}, change); |
---|
76 | } |
---|
77 | |
---|
78 | function updateWidget() { |
---|
79 | $.ajax({ |
---|
80 | url: "<?php echo url_for('@commentaires_widget'); ?>", |
---|
81 | async: true, |
---|
82 | cache: false, |
---|
83 | beforeSend: function(xhr) { |
---|
84 | xhr.setRequestHeader("If-Modified-Since","0"); |
---|
85 | clearTimer(); |
---|
86 | $(".box_widget h2").append('<div id="chargement_widget"><\/div>'); |
---|
87 | }, |
---|
88 | success: function(html){ |
---|
89 | if ($.browser.msie == true) { |
---|
90 | obj = document.getElementById("coms_widget_update"); |
---|
91 | obj.innerHTML = html; |
---|
92 | } |
---|
93 | else { |
---|
94 | $("#coms_widget_update").text(""); |
---|
95 | $("#coms_widget_update").append(html); |
---|
96 | } |
---|
97 | reorderWidget(); |
---|
98 | }, |
---|
99 | complete: function() { |
---|
100 | $("#chargement_widget").remove(); |
---|
101 | $("#coms_widget").text(""); |
---|
102 | $(".commentaire_widget").css("display", "none"); |
---|
103 | i = 0; |
---|
104 | changeCommentaire(i); |
---|
105 | }, |
---|
106 | error: function() { |
---|
107 | $("#chargement_widget").remove(); |
---|
108 | } |
---|
109 | }); |
---|
110 | } |
---|
111 | |
---|
112 | function reorderWidget() { |
---|
113 | q = 0; |
---|
114 | $("#coms_widget_update div[class='commentaire_widget']").each(function () { |
---|
115 | commentaires_update[q] = $(this).attr("id"); |
---|
116 | $("#"+commentaires_update[q]).css("display", "none"); |
---|
117 | q++; |
---|
118 | }); |
---|
119 | commentaires = commentaires_update; |
---|
120 | commentaires_update = new Array (); |
---|
121 | |
---|
122 | /* $.merge(commentaires, commentaires_update); |
---|
123 | commentaires_update = null; |
---|
124 | commentaires_temp = uniqueArray(commentaires); |
---|
125 | commentaires_temp.sort(); |
---|
126 | commentaires_temp.reverse(); |
---|
127 | commentaires = new Array(); |
---|
128 | q = 0; |
---|
129 | $(commentaires_temp).each(function () { |
---|
130 | commentaires[q] = $("#"+this).attr("id"); q++; |
---|
131 | }); |
---|
132 | commentaires_temp = null; */ |
---|
133 | } |
---|
134 | |
---|
135 | function clearTimer() { |
---|
136 | clearTimeout(timerWidget); |
---|
137 | } |
---|
138 | |
---|
139 | $(".commentaire_widget").live("mouseover", function() { |
---|
140 | clearInterval(timerUpdate); |
---|
141 | clearTimeout(timerWidget); |
---|
142 | reprends_a = i; |
---|
143 | }); |
---|
144 | |
---|
145 | $(".commentaire_widget").live("mouseout", function() { |
---|
146 | timerUpdate = setInterval(function(){updateWidget();}, update); |
---|
147 | timerWidget = setTimeout(function(){changeCommentaire(reprends_a);}, 1000); |
---|
148 | }); |
---|
149 | //--> |
---|
150 | </script> |
---|
151 | <div class="clear"> |
---|
152 | <div class ="accueil_message"> |
---|
153 | <div class="accueil_message_content"> |
---|
154 | <h1>Bienvenue sur NosDéputés.fr</h1> |
---|
155 | <p>NosDéputés.fr est un site qui cherche à mettre en valeur l'activité parlementaire des députés de l'Assemblée Nationale Française.</p> |
---|
156 | <p>En synthétisant les différentes activités législatives et de contrôle du gouvernement des élus de la nation, ce site essaie de donner aux citoyens de nouveaux outils pour comprendre et analyser le travail de leurs représentants.</p> |
---|
157 | <p>Conçu comme une plateforme de médiation entre citoyens et députés, le site propose à chacun de participer et de s'exprimer sur les débats parlementaires. Au travers de leurs commentaires, les utilisateurs sont invités à créer le débat en partageant leur expertise lorsque cela leur semble utile. Peut-être pourront-ils ainsi nourrir le travail de leurs élus ?</p> |
---|
158 | </div> |
---|
159 | <div class="accueil_message_signature"> |
---|
160 | <p>Toute l'équipe du collectif <a href="http://www.regardscitoyens.org/">RegardsCitoyens.org</a>.</p> |
---|
161 | </div> |
---|
162 | </div> |
---|
163 | |
---|
164 | <div class="accueil_deputes_jour"> |
---|
165 | <?php echo include_component('parlementaire', 'duJour'); ?> |
---|
166 | </div> |
---|
167 | </div> |
---|
168 | <div class="clear"></div> |
---|
169 | <div class="clear accueil"> |
---|
170 | <div class="box_news"> |
---|
171 | <div class="carte"> |
---|
172 | <h2><span style="margin-right: 5px;"><img alt="actu" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/ico_nosdeputes.png" /></span>Touver son député</h2> |
---|
173 | <div class="cont_box_news"> |
---|
174 | <p><?php include_partial('circonscription/map', array('circo' => "full", 'width'=>200, 'height'=>0)); ?></p> |
---|
175 | </div> |
---|
176 | <div class="message"> |
---|
177 | <p>Pour consulter la fiche de votre député, saisissez son nom. Si vous ne le connaissez pas, indiquez votre code postal ou le nom de votre ville, nous essayerons de le trouver pour vous :</p> |
---|
178 | <form action="<?php echo url_for('solr/search?object_name=Parlementaire'); ?>"> |
---|
179 | <input name="search"/><input type="submit" value="Rechercher"/> |
---|
180 | </form> |
---|
181 | </div> |
---|
182 | </div> |
---|
183 | </div> |
---|
184 | <div class="clear"></div> |
---|
185 | <div class="box_container"> |
---|
186 | <div class="box_repartition aligncenter"><div style="margin: auto;"> |
---|
187 | <h2><span style="margin-right: 5px;"><img alt="activite" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/ico_graph.png" /></span><a href="<?php echo url_for('@top_global'); ?>">Activité parlementaire des 12 derniers mois</a></h2> |
---|
188 | <?php echo include_component('plot', 'newGroupes', array('type' => 'home')); ?> |
---|
189 | <?php // echo include_component('plot', 'groupes', array('plot' => 'total')); ?> |
---|
190 | </div></div> |
---|
191 | <div class="box_tags"> |
---|
192 | <h2><span style="margin-right: 5px;"><img alt="tags" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/assemblee-nationale.png" /></span><?php echo link_to('En ce moment à l\'Assemblée nationale', '@parlementaires_tags'); ?></h2> |
---|
193 | <?php echo include_component('tag', 'globalActivite'); ?> |
---|
194 | </div> |
---|
195 | </div> |
---|
196 | <div class="clear"></div> |
---|
197 | <div class="box_widget"> |
---|
198 | <h2><span style="margin-right: 5px;"><img alt="comments" src="<?php echo $sf_request->getRelativeUrlRoot(); ?>/images/xneth/ico_comment.png" /></span><a href="<?php echo url_for('@commentaires'); ?>">Les derniers commentaires</a><span class="rss"><a href="<?php echo url_for('@commentaires_rss'); ?>"><?php echo image_tag('xneth/rss.png', 'alt="Flux rss"'); ?></a></span></h2> |
---|
199 | <div id="coms_widget"> |
---|
200 | <noscript> |
---|
201 | <?php include_component('commentaire', 'showWidget'); ?> |
---|
202 | </noscript> |
---|
203 | </div> |
---|
204 | <div style="display: hidden;" id="coms_widget_update"></div> |
---|
205 | </div> |
---|
206 | </div> |
---|