Changeset 1395


Ignore:
Timestamp:
Sep 20, 2010, 3:25:12 AM (10 years ago)
Author:
roux
Message:

premiers essais pour la carte

Location:
cpc/trunk/project
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/apps/frontend/modules/api/actions/actions.class.php

    r1344 r1395  
    2323  {
    2424    $date = $request->getParameter('date');
    25     $this->forward404Unless(preg_match('/(\d{4})\d{2}/', $date, $d));
     25    $this->forward404Unless(preg_match('/(\d{2,4})-?\d{2}/', $date, $d));
     26    $date = preg_replace('/-/', '', $date);
     27    $date = preg_replace('/^(\d{2})(\d{2})$/', '20\\1\\2', $date);
     28    $d[1] = preg_replace('/^(\d{2})$/', '20\\1', $d[1]);
    2629    $vg = Doctrine::getTable('VariableGlobale')->findOneByChamp('stats_month_'.$d[1]);
    2730    $top = unserialize($vg->value);
  • cpc/trunk/project/apps/frontend/modules/circonscription/templates/listSuccess.php

    r1333 r1395  
    1 <h1 class="list_inter">Toutes les circonscriptions électorales</h1><?php
    2 $sf_response->setTitle('Toutes les circonscriptions électorales'); ?>
    3 <h2>Carte des circonscriptions</h2>
    4 <p><?php CirconscriptionActions::echoCircoMap("full", 900, 0); ?></p>
    5 <h2>Liste des départements</h2>
    6 <div id="circo_table">
    7 <table>
    8 <tr><td><ul>
    9 <?php $div = floor(count($circos)/4)+1; $ct = 0;
    10 foreach($circos as $num => $circo)
    11 {
    12   $ct++ ;
     1<h1 class="list_inter">Toutes les circonscriptions par département</h1><?php
     2$sf_response->setTitle('Toutes les circonscriptions électorales par département - NosDéputés.fr'); ?>
     3<?php // CirconscriptionActions::echoCircoMap("full", 900, 0); ?>
     4<div class="list_circo">
     5<?php $div = floor(count($circos)/6)+1; $ct = 0;
     6foreach($circos as $num => $circo) {
     7  $ct++;
    138  if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num);
    14   echo '<li>'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).' ('.strtoupper($num).')</li>';
    15   if ($ct == $div || $ct == (2*$div) || $ct == (3*$div))
    16     echo '</ul></td><td style="width:23%;"><ul>';
    17  
     9  echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.$num.'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';
     10  if ($ct == 27)
     11    break;
    1812} ?>
    19 </ul></td></tr>
    20 </table>
    2113</div>
     14<?php echo include_partial('circonscription/mapDeptmts', array()); ?>
     15<div class="list_circo borderleft">
     16<?php $ct = 0;
     17foreach($circos as $num => $circo) {
     18  $ct++;
     19  if ($ct <= 27)
     20    continue;
     21  if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num);
     22  echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.$num.'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';
     23  if ($ct == 55)
     24    break;
     25} ?>
     26</div>
     27<div class="list_circo borderleft">
     28<?php $ct = 0;
     29foreach($circos as $num => $circo) {
     30  $ct++;
     31  if ($ct <= 55)
     32    continue;
     33  if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num);
     34  echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.$num.'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';
     35  if ($ct == 66)
     36    break;
     37} ?>
     38</div>
     39<div class="list_circo borderleft">
     40<?php $ct = 0;
     41foreach($circos as $num => $circo) {
     42  $ct++;
     43  if ($ct <= 66)
     44    continue;
     45  if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num);
     46  echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.$num.'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';
     47  if ($ct == 77)
     48    break;
     49} ?>
     50</div>
     51<div class="list_circo borderleft">
     52<?php $ct = 0;
     53foreach($circos as $num => $circo) {
     54  $ct++;
     55  if ($ct <= 77)
     56    continue;
     57  if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num);
     58  echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.$num.'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';
     59  if ($ct == 88)
     60    break;
     61} ?>
     62</div>
     63<div class="list_circo borderleft">
     64<?php $ct = 0;
     65foreach($circos as $num => $circo) {
     66  $ct++;
     67  if ($ct <= 88)
     68    continue;
     69  if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num);
     70  echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.$num.'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';
     71  if ($ct == 96)
     72    break;
     73} ?>
     74</div>
     75<div class="list_circo borderleft">
     76<h3 class="align_center">DOM-TOMs&nbsp;:</h3>
     77<?php $ct = 0;
     78foreach($circos as $num => $circo) {
     79  $ct++;
     80  if ($ct <= 96)
     81    continue;
     82  if (preg_match('/^\d$/', $num)) $num = sprintf("%02d",$num);
     83  echo '<p onclick="document.location=\''.url_for('@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'\'" class="dept" id="dep'.$num.'">'.link_to($circo, '@list_parlementaires_departement?departement='.preg_replace('/ /', '_', $circo)).'</p>';
     84 } ?>
     85</div>
     86
  • cpc/trunk/project/bin/updateDB3.sh

    r1393 r1395  
    129129
    130130php symfony top:Deputes
    131 for month in 06 07 08 09 10 11 12; do
    132   php symfony top:Deputes 2007-$month-01
    133 done
    134 for year in 2008 2009; do
    135   for month in 01 02 03 04 05 06 07 08 09 10 11 12; do
    136     php symfony top:Deputes $year-$month-01
    137   done
    138 done
    139 for month in 01 02 03 04 05 06 07 08 09; do
    140   php symfony top:Deputes 2010-$month-01
    141 done
    142 
     131bash bin/update_tops
    143132
    144133#bash bin/update_hardcache_all
  • cpc/trunk/project/web/css/xneth/style.css

    r1393 r1395  
    10991099.carte_departement {
    11001100  float: right;
    1101   padding-top: 2px;
    1102   padding-right: 2px;
     1101  margin-top: 10px;
     1102  margin-right: 35px;
    11031103}
    11041104.didascalie {
     
    16681668.list_circo {
    16691669  float: left;
    1670   margin-bottom: 30px;
    1671   width: 33%;
    1672 }
     1670  margin-left: 15px;
     1671  width: 12%;
     1672  font-size: 12px;
     1673  text-align: center;
     1674}
     1675.dept {
     1676  padding: 2px;
     1677  text-align: center;
     1678}
     1679.dept:hover {
     1680  background-color: rgb(198,229,81);
     1681}
     1682
    16731683.list_choix {
    16741684  text-align: center;
  • cpc/trunk/project/web/js/jquery.maphilight.min.js

    r829 r1395  
    11/* Modified by Gabriel Kerneis for the purpose of NosDeputes.fr */
    2 (function(C){var A,B,I,J,K,G,E,D,F,H;A=document.namespaces;has_canvas=document.createElement("canvas");has_canvas=has_canvas&&has_canvas.getContext;if(!(has_canvas||A)){C.fn.maphilight=function(){return this};return }if(has_canvas){E=function(M,N,L){if(N<=1){M.style.opacity=N;window.setTimeout(E,10,M,N+0.1,10)}};D=function(L){return Math.max(0,Math.min(parseInt(L,16),255))};F=function(L,M){return"rgba("+D(L.substr(0,2))+","+D(L.substr(2,2))+","+D(L.substr(4,2))+","+M+")"};B=function(L){var M=C('<canvas style="width:'+L.width+"px;height:"+L.height+'px;"></canvas>').get(0);M.getContext("2d").clearRect(0,0,M.width,M.height);return M};I=function(Q,M,L,P){var O,N=Q.getContext("2d");N.beginPath();if(M=="rect"){N.rect(L[0],L[1],L[2]-L[0],L[3]-L[1])}else{if(M=="poly"){N.moveTo(L[0],L[1]);for(O=2;O<L.length;O+=2){N.lineTo(L[O],L[O+1])}}else{if(M=="circ"){N.arc(L[0],L[1],L[2],0,Math.PI*2,false)}}}N.closePath();if(P.fill){N.fillStyle=F(P.fillColor,P.fillOpacity);N.fill()}if(P.stroke){N.strokeStyle=F(P.strokeColor,P.strokeOpacity);N.lineWidth=P.strokeWidth;N.stroke()}if(P.fade){E(Q,0)}};J=function(L,M){L.getContext("2d").clearRect(0,0,L.width,L.height)}}else{document.createStyleSheet().addRule("v\\:*","behavior: url(#default#VML); antialias: true;");document.namespaces.add("v","urn:schemas-microsoft-com:vml");B=function(L){return C('<var style="zoom:1;overflow:hidden;display:block;width:'+L.width+"px;height:"+L.height+'px;"></var>').get(0)};I=function(P,M,L,O){var R,S,N,Q;R='<v:fill color="#'+O.fillColor+'" opacity="'+(O.fill?O.fillOpacity:0)+'" />';S=(O.stroke?'strokeweight="'+O.strokeWidth+'" stroked="t" strokecolor="#'+O.strokeColor+'"':'stroked="f"');N='<v:stroke opacity="'+O.strokeOpacity+'"/>';if(M=="rect"){Q=C('<v:rect filled="t" '+S+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+L[0]+"px;top:"+L[1]+"px;width:"+(L[2]-L[0])+"px;height:"+(L[3]-L[1])+'px;"></v:rect>')}else{if(M=="poly"){Q=C('<v:shape filled="t" '+S+' coordorigin="0,0" coordsize="'+P.width+","+P.height+'" path="m '+L[0]+","+L[1]+" l "+L.join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+P.width+"px;height:"+P.height+'px;"></v:shape>')}else{if(M=="circ"){Q=C('<v:oval filled="t" '+S+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(L[0]-L[2])+"px;top:"+(L[1]-L[2])+"px;width:"+(L[2]*2)+"px;height:"+(L[2]*2)+'px;"></v:oval>')}}}Q.get(0).innerHTML=R+N;C(P).append(Q)};J=function(L){C(L).empty()}}K=function(N){var M,L=N.getAttribute("coords").split(",");for(M=0;M<L.length;M++){L[M]=parseFloat(L[M])}return[N.getAttribute("shape").toLowerCase().substr(0,4),L]};H=function(L){if(!L.complete){return false}if(typeof L.naturalWidth!="undefined"&&L.naturalWidth==0){return false}return true};G={position:"absolute",left:0,top:0,padding:0,border:0};C.fn.maphilight=function(L){L=C.extend({},C.fn.maphilight.defaults,L);return this.each(function(){var N,Q,P,R,O,M;N=C(this);if(!H(this)){return window.setTimeout(function(){N.maphilight()},200)}P=C.metadata?C.extend({},L,N.metadata()):L;R=C('map[name="'+N.attr("usemap").substr(1)+'"]');if(!(N.is("img")&&N.attr("usemap")&&R.size()>0&&!N.hasClass("maphilighted"))){return }Q=C("<div>").css({display:"block",background:"url("+this.src+")",position:"relative",padding:0,width:this.width,height:this.height}).addClass(N.attr("class"));N.before(Q).css("opacity",0).css(G).remove();if(C.browser.msie){N.css("filter","Alpha(opacity=0)")}Q.append(N);O=B(this);C(O).css(G);O.height=this.height;O.width=this.width;M=function(T){var S=K(this);I(O,S[0],S[1],C.metadata?C.extend({},P,C(this).metadata()):P)};if(P.alwaysOn){C(R).find("area[coords]").each(M)}else{C(R).find("area[coords]").mouseover(M).mouseout(function(S){J(O)})}N.before(O);N.addClass("maphilighted")})};C.fn.maphilight.defaults={fill:true,fillColor:"ff0000",fillOpacity:0.2,stroke:true,strokeColor:"ff0000",strokeOpacity:1,strokeWidth:1,fade:false,alwaysOn:false}})(jQuery);
     2(function(C){var A,B,I,J,K,G,E,D,F,H;A=document.namespaces;has_canvas=document.createElement("canvas");has_canvas=has_canvas&&has_canvas.getContext;if(!(has_canvas||A)){C.fn.maphilight=function(){return this};return }if(has_canvas){E=function(M,N,L){if(N<=1){M.style.opacity=N;window.setTimeout(E,10,M,N+0.1,10)}};D=function(L){return Math.max(0,Math.min(parseInt(L,16),255))};F=function(L,M){return"rgba("+D(L.substr(0,2))+","+D(L.substr(2,2))+","+D(L.substr(4,2))+","+M+")"};B=function(L){var M=C('<canvas style="width:'+L.width+"px;height:"+L.height+'px;"></canvas>').get(0);M.getContext("2d").clearRect(0,0,M.width,M.height);return M};I=function(Q,M,L,P){var O,N=Q.getContext("2d");N.beginPath();if(M=="rect"){N.rect(L[0],L[1],L[2]-L[0],L[3]-L[1])}else{if(M=="poly"){N.moveTo(L[0],L[1]);for(O=2;O<L.length;O+=2){N.lineTo(L[O],L[O+1])}}else{if(M=="circ"){N.arc(L[0],L[1],L[2],0,Math.PI*2,false)}}}N.closePath();if(P.fill){N.fillStyle=F(P.fillColor,P.fillOpacity);N.fill()}if(P.stroke){N.strokeStyle=F(P.strokeColor,P.strokeOpacity);N.lineWidth=P.strokeWidth;N.stroke()}if(P.fade){E(Q,0)}};J=function(L,M){L.getContext("2d").clearRect(0,0,L.width,L.height)}}else{document.createStyleSheet().addRule("v\\:*","behavior: url(#default#VML); antialias: true;");document.namespaces.add("v","urn:schemas-microsoft-com:vml");B=function(L){return C('<var style="zoom:1;overflow:hidden;display:block;width:'+L.width+"px;height:"+L.height+'px;"></var>').get(0)};I=function(P,M,L,O){var R,S,N,Q;R='<v:fill color="#'+O.fillColor+'" opacity="'+(O.fill?O.fillOpacity:0)+'" />';S=(O.stroke?'strokeweight="'+O.strokeWidth+'" stroked="t" strokecolor="#'+O.strokeColor+'"':'stroked="f"');N='<v:stroke opacity="'+O.strokeOpacity+'"/>';if(M=="rect"){Q=C('<v:rect filled="t" '+S+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+L[0]+"px;top:"+L[1]+"px;width:"+(L[2]-L[0])+"px;height:"+(L[3]-L[1])+'px;"></v:rect>')}else{if(M=="poly"){Q=C('<v:shape filled="t" '+S+' coordorigin="0,0" coordsize="'+P.width+","+P.height+'" path="m '+L[0]+","+L[1]+" l "+L.join(",")+' x e" style="zoom:1;margin:0;padding:0;display:block;position:absolute;top:0px;left:0px;width:'+P.width+"px;height:"+P.height+'px;"></v:shape>')}else{if(M=="circ"){Q=C('<v:oval filled="t" '+S+' style="zoom:1;margin:0;padding:0;display:block;position:absolute;left:'+(L[0]-L[2])+"px;top:"+(L[1]-L[2])+"px;width:"+(L[2]*2)+"px;height:"+(L[2]*2)+'px;"></v:oval>')}}}Q.get(0).innerHTML=R+N;C(P).append(Q)};J=function(L){C(L).empty()}}K=function(N){var M,L=N.getAttribute("coords").split(",");for(M=0;M<L.length;M++){L[M]=parseFloat(L[M])}return[N.getAttribute("shape").toLowerCase().substr(0,4),L]};H=function(L){if(!L.complete){return false}if(typeof L.naturalWidth!="undefined"&&L.naturalWidth==0){return false}return true};G={position:"absolute",left:0,top:0,padding:0,border:0};C.fn.maphilight=function(L){L=C.extend({},C.fn.maphilight.defaults,L);return this.each(function(){var N,Q,P,R,O,M;N=C(this);if(!H(this)){return window.setTimeout(function(){N.maphilight()},200)}P=C.metadata?C.extend({},L,N.metadata()):L;R=C('map[name="'+N.attr("usemap").substr(1)+'"]');if(!(N.is("img")&&N.attr("usemap")&&R.size()>0&&!N.hasClass("maphilighted"))){return }Q=C("<div>").css({display:"block",background:"url("+this.src+")",position:"relative",padding:0,width:this.width,height:this.height}).addClass(N.attr("class"));N.before(Q).css("opacity",0).css(G).remove();if(C.browser.msie){N.css("filter","Alpha(opacity=0)")}Q.append(N);O=B(this);C(O).css(G);O.height=this.height;O.width=this.width;M=function(T){var S=K(this);I(O,S[0],S[1],C.metadata?C.extend({},P,C(this).metadata()):P)};if(P.alwaysOn){C(R).find("area[coords]").each(M)}else{C(R).find("area[coords]").mouseover(M).mouseout(function(S){J(O)})}N.before(O);N.addClass("maphilighted")})};C.fn.maphilight.defaults={fill:true,fillColor:"C6E551",fillOpacity:0.5,stroke:true,strokeColor:"C6E551",strokeOpacity:1,strokeWidth:1,fade:false,alwaysOn:false}})(jQuery);
    33$(function(){$('.carte_departement').maphilight();});
Note: See TracChangeset for help on using the changeset viewer.