Changeset 5187


Ignore:
Timestamp:
03/19/10 11:17:14 (10 years ago)
Author:
nikrou
Message:

Feature 940 : improve ordering by rank by clip thumbnail to a square

Location:
trunk/admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/element_set_ranks.php

    r4325 r5187  
    154154{ 
    155155  $src = get_thumbnail_url($row); 
     156 
     157  list($thumbnail_width, $thumbnail_height) = getimagesize($src); 
     158  $thumbnail_x_center = $thumbnail_width/2; 
     159  $thumbnail_y_center = $thumbnail_height/2; 
    156160   
    157161  $template->append( 
     
    161165      'TN_SRC' => $src, 
    162166      'RANK' => $current_rank * 10, 
     167      'CLIP_TOP' => round($thumbnail_y_center - 96/2), 
     168      'CLIP_RIGHT' => round($thumbnail_x_center + 96/2), 
     169      'CLIP_BOTTOM' => round($thumbnail_y_center + 96/2), 
     170      'CLIP_LEFT' => round($thumbnail_x_center - 96/2) 
    163171      ) 
    164172    ); 
  • trunk/admin/themes/default/template/element_set_ranks.tpl

    r5169 r5187  
    3535    <ul class="thumbnails"> 
    3636      {foreach from=$thumbnails item=thumbnail} 
    37       <li  class="rank-of-image"> 
    38         <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt=""> 
     37      <li class="rank-of-image"> 
     38        <div class="clipwrapper"> 
     39          <div class="clip" style="clip:rect({$thumbnail.CLIP_TOP}px {$thumbnail.CLIP_RIGHT}px {$thumbnail.CLIP_BOTTOM}px {$thumbnail.CLIP_LEFT}px);top:-{$thumbnail.CLIP_TOP}px;left:-{$thumbnail.CLIP_LEFT}px"> 
     40            <img src="{$thumbnail.TN_SRC}" class="thumbnail" alt=""> 
     41          </div> 
     42        </div> 
    3943        <input type="text" name="rank_of_image[{$thumbnail.ID}]" value="{$thumbnail.RANK}"> 
    4044      </li> 
  • trunk/admin/themes/default/thumbnails.css

    r5123 r5187  
    1818} 
    1919.content ul.thumbnails li.rank-of-image img { 
     20  margin: 0 20px; 
     21  padding: 4px 2px; 
     22  float: left; 
     23} 
     24.clipwrapper { 
     25  position:relative; 
    2026  width: 96px; 
    2127  height: 96px; 
    22   margin: 4px; 
    23   float: left; 
     28} 
     29.clip { 
     30  position:absolute; 
    2431} 
    2532.content ul.thumbnails li.rank-of-image input { 
     
    2734  width: 50px; 
    2835  position: relative; 
    29   top: 0 
     36  top: 4px 
    3037} 
    3138.content UL.thumbnails SPAN.wrap1 { 
Note: See TracChangeset for help on using the changeset viewer.