Changeset 1483


Ignore:
Timestamp:
Sep 29, 2010, 12:08:35 AM (10 years ago)
Author:
teymour
Message:

Gestion des photos de députés avec title en js

Location:
cpc/trunk/project/apps/frontend/modules/solr
Files:
2 edited

Legend:

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

    r1469 r1483  
    1717    case 'Intervention':
    1818      if ($obj->getParlementaire())
    19         return url_for('@resized_photo_parlementaire?height=70&slug='.$obj->getIntervenant()->getSlug());
    20       return '';
     19        return $this->getPartial('parlementaire/photoParlementaire', array('parlementaire'=>$obj->getIntervenant(), 'height'=>70));
    2120    case 'QuestionEcrite':
    22       return url_for('@resized_photo_parlementaire?height=70&slug='.$obj->getParlementaire()->getSlug());
     21      return $this->getPartial('parlementaire/photoParlementaire', array('parlementaire'=>$obj->getParlementaire(), 'height'=>70));
    2322    case 'Amendement':
    2423      return '';
    2524    case 'Parlementaire':
    26       return url_for('@resized_photo_parlementaire?height=70&slug='.$obj->getSlug());
     25      return $this->getPartial('parlementaire/photoParlementaire', array('parlementaire'=>$obj, 'height'=>70));
    2726    case 'Commentaire':
    28       return url_for('@photo_citoyen?slug='.$obj->getCitoyen()->getSlug());
     27      return '<img width="53" src="'.url_for('@photo_citoyen?slug='.$obj->getCitoyen()->getSlug()).'"/>';
    2928    case 'Citoyen':
    30       return url_for('@photo_citoyen?slug='.$obj->getSlug());
     29      return '<img width="53" src="'.url_for('@photo_citoyen?slug='.$obj->getSlug()).'"/>';
    3130    }
    3231  }
     
    115114      $this->sort_type = 'date';
    116115    }
     116    if ($from) {
     117      $to = $request->getParameter('to', 'NOW');
     118      $query .= ' date:['.$from.' TO '.$to.']';
     119      $params['facet.date.start']=$from;
     120      $params['facet.date.end'] = $to;
     121      $params['facet.date.gap'] = '+1MONTH';
     122      $this->selected['from'][$from] = 1;
     123      $this->selected['to'][$to] = 1;
     124    }
    117125    if ($date) {
    118       $dates = explode(',', $date);
    119       $date = array_pop($dates);
    120       $period = 'MONTH';
    121       if (count($dates) == 1)
    122             $period = 'DAY';
    123       $query .= ' date:['.$date.' TO '.$date.'+1'.$period.']';
    124126      $this->selected['date'][$date] = 1;
    125       $params['facet.date.start']=$date;
    126       $params['facet.date.end'] = $date.'+1'.$period;
    127       $params['facet.date.gap'] = '+1DAY';
    128     }else {
    129       if ($from) {
    130               $to = $request->getParameter('to', 'NOW');
    131               $query .= ' date:['.$from.' TO '.$to.']';
    132         $params['facet.date.start']=$from;
    133               $params['facet.date.end'] = $to;
    134               $params['facet.date.gap'] = '+1MONTH';
     127      if (!$from) {
     128        $dates = explode(',', $date);
     129        $date = array_pop($dates);
     130        $period = 'MONTH';
     131        if (count($dates) == 1)
     132          $period = 'DAY';
     133        $query .= ' date:['.$date.' TO '.$date.'+1'.$period.']';
     134        $params['facet.date.start']=$date;
     135        $params['facet.date.end'] = $date.'+1'.$period;
     136        $params['facet.date.gap'] = '+1DAY';
    135137      }
    136138    }
  • cpc/trunk/project/apps/frontend/modules/solr/templates/searchSuccess.php

    r1477 r1483  
    229229<div class="item">
    230230      <h4><a href="<?php echo $record['link']; ?>"><?php echo $record['titre']; ?></a></h4>
    231       <?php if ($record['photo']) { ?><p class="photo"><a href="<?php echo $record['link']; ?>" rel="nofollow"><img width="53" src="<?php echo $record['photo']; ?>"/></a></p><?php } ?>
     231      <?php if ($record['photo']) { ?><p class="photo"><a href="<?php echo $record['link']; ?>" rel="nofollow"><?php echo $record['photo']; ?></a></p><?php } ?>
    232232      <p class="intervenant"><a href="<?php echo $record['link']; ?>" rel="nofollow"><?php echo $record['personne']; ?></a></p>
    233233      <p class="content"><?php echo $record['highlighting']; ?></p>
Note: See TracChangeset for help on using the changeset viewer.