Changeset 17290 for branches


Ignore:
Timestamp:
Aug 1, 2012, 7:00:07 PM (12 years ago)
Author:
rvelices
Message:

merge -r17289 from trunk to 2.4: batch manager improvements/fixes:

  • when refreshing photo set, start is set to 0 (otherwise if the new set is smaller that start, it looks like it is empty)
  • correct positioning of thumbnails (width/height) is done in template instead of javascript (immediate instead on ready + no reflows)
  • less space lost on batch manager page
  • fix wrong page title in batch manager because of global variable $title overriden
  • fix language keys in element_set_ranks (capital/lowercase issue)
Location:
branches/2.4/admin
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • branches/2.4/admin/batch_manager.php

    r16929 r17290  
    5151{
    5252  // echo '<pre>'; print_r($_POST); echo '</pre>';
    53 
     53  unset($_REQUEST['start']); // new photo set must reset the page
    5454  $_SESSION['bulk_manager_filter'] = array();
    5555
     
    336336// and $page['nb_images'] next elements
    337337
    338 if (!isset($_GET['start'])
    339     or !is_numeric($_GET['start'])
    340     or $_GET['start'] < 0
    341     or (isset($_GET['display']) and 'all' == $_GET['display']))
     338if (!isset($_REQUEST['start'])
     339    or !is_numeric($_REQUEST['start'])
     340    or $_REQUEST['start'] < 0
     341    or (isset($_REQUEST['display']) and 'all' == $_REQUEST['display']))
    342342{
    343343  $page['start'] = 0;
     
    345345else
    346346{
    347   $page['start'] = $_GET['start'];
     347  $page['start'] = $_REQUEST['start'];
    348348}
    349349
  • branches/2.4/admin/batch_manager_global.php

    r14143 r17290  
    473473    'selection' => $collection,
    474474    'all_elements' => $page['cat_elements_id'],
     475    'START' => $page['start'],
    475476    'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')),
    476     'F_ACTION'=>$base_url.get_query_string_diff(array('cat')),
     477    'F_ACTION'=>$base_url.get_query_string_diff(array('cat','start')),
    477478   )
    478479 );
     
    733734  }
    734735
    735 
    736736  $query = '
    737737SELECT id,path,representative_ext,file,filesize,level,name,width,height,rotation
     
    767767  $result = pwg_query($query);
    768768
     769  $thumb_params = ImageStdParams::get_by_type(IMG_THUMB);
    769770  // template thumbnail initialization
    770771  while ($row = pwg_db_fetch_assoc($result))
     
    773774    $src_image = new SrcImage($row);
    774775
    775     $title = render_element_name($row);
    776     if ($title != get_name_from_file($row['file']))
    777     {
    778       $title.= ' ('.$row['file'].')';
     776    $ttitle = render_element_name($row);
     777    if ($ttitle != get_name_from_file($row['file']))
     778    {
     779      $ttitle.= ' ('.$row['file'].')';
    779780    }
    780781
    781782    $template->append(
    782       'thumbnails',
     783      'thumbnails', array_merge($row,
    783784      array(
    784         'ID' => $row['id'],
    785         'TN_SRC' => DerivativeImage::url(IMG_THUMB, $src_image),
    786         'FILE' => $row['file'],
    787         'TITLE' => $title,
    788         'LEVEL' => $row['level'],
     785        'thumb' => new DerivativeImage($thumb_params, $src_image),
     786        'TITLE' => $ttitle,
    789787        'FILE_SRC' => DerivativeImage::url(IMG_LARGE, $src_image),
    790788        'U_EDIT' => get_root_url().'admin.php?page=photo-'.$row['id'],
    791789        )
    792       );
    793   }
     790      ));
     791  }
     792  $template->assign('thumb_params', $thumb_params);
    794793}
    795794
  • branches/2.4/admin/element_set_ranks.php

    r14205 r17290  
    240240$sort_fields = array(
    241241  ''                    => '',
    242   'file'                => l10n('file name, A &rarr; Z'),
    243   'file DESC'           => l10n('file name, Z &rarr; A'),
    244   'name'                => l10n('photo title, A &rarr; Z'),
    245   'name DESC'           => l10n('photo title, Z &rarr; A'),
    246   'date_creation DESC'  => l10n('date created, new &rarr; old'),
    247   'date_creation'       => l10n('date created, old &rarr; new'),
    248   'date_available DESC' => l10n('date posted, new &rarr; old'),
    249   'date_available'      => l10n('date posted, old &rarr; new'),
    250   'rating_score DESC'   => l10n('rating score, high &rarr; low'),
    251   'rating_score'        => l10n('rating score, low &rarr; high'),
    252   'hit DESC'            => l10n('visits, high &rarr; low'),
    253   'hit'                 => l10n('visits, low &rarr; high'),
    254   'id'                  => l10n('numeric identifier, 1 &rarr; 9'),
    255   'id DESC'             => l10n('numeric identifier, 9 &rarr; 1'),
    256   'rank'                => l10n('manual sort order'),
     242  'file'                => l10n('File name, A &rarr; Z'),
     243  'file DESC'           => l10n('File name, Z &rarr; A'),
     244  'name'                => l10n('Photo title, A &rarr; Z'),
     245  'name DESC'           => l10n('Photo title, Z &rarr; A'),
     246  'date_creation DESC'  => l10n('Date created, new &rarr; old'),
     247  'date_creation'       => l10n('Date created, old &rarr; new'),
     248  'date_available DESC' => l10n('Date posted, new &rarr; old'),
     249  'date_available'      => l10n('Date posted, old &rarr; new'),
     250  'rating_score DESC'   => l10n('Rating score, high &rarr; low'),
     251  'rating_score'        => l10n('Rating score, low &rarr; high'),
     252  'hit DESC'            => l10n('Visits, high &rarr; low'),
     253  'hit'                 => l10n('Visits, low &rarr; high'),
     254  'id'                  => l10n('Numeric identifier, 1 &rarr; 9'),
     255  'id DESC'             => l10n('Numeric identifier, 9 &rarr; 1'),
     256  'rank'                => l10n('Manual sort order'),
    257257  );
    258258
  • branches/2.4/admin/themes/clear/theme.css

    r16391 r17290  
    9898UL.thumbnails span.wrap2:hover { background-color:#7CBA0F; color:#999; }
    9999UL.thumbnails span.wrap2 {
    100         padding: 4px;
    101         border-radius: 4px;
    102100        background-color:#ddd;
    103101}
     
    112110
    113111.content ul.categoryActions a img { margin-left: 10px; }
    114 ul.thumbnails input { border:3px double #666; color:#666; font-size:10px; margin:0; background-color:#bbb; text-align: center;}
     112ul.thumbnails input { color:#666; font-size:10px; margin:0; background-color:#bbb; text-align: center;}
    115113INPUT.bigbutton:hover { background-color: #ddd;  color:#0cc; border: 0; }
    116114.throw  { font-size: 120%; line-height: 26px; padding-top: 10px; font-weight: bold; }
  • branches/2.4/admin/themes/default/template/batch_manager_global.tpl

    r13646 r17290  
    5151    });
    5252  }
     53        $('ul.thumbnails').enableShiftClick();
    5354});
    5455{/literal}{/footer_script}
     
    482483});
    483484
    484 jQuery(window).load(function() {
    485         var max_w=0, max_h=0;
    486         $(".thumbnails img").each(function () {
    487                 max_w = Math.max(max_w, $(this).width() );
    488                 max_h = Math.max(max_h, $(this).height() );
    489         });
    490         max_w += 10;
    491         max_h += 35;
    492         $("ul.thumbnails span, ul.thumbnails label").css('width', max_w+'px').css('height', max_h+'px');
    493         $('ul.thumbnails').enableShiftClick();
    494 });
     485
    495486{/literal}{/footer_script}
    496487
     
    500491
    501492  <form action="{$F_ACTION}" method="post">
     493        <input type="hidden" name="start" value="{$START}">
    502494
    503495  <fieldset>
     
    511503        <select name="filter_prefilter">
    512504          {foreach from=$prefilters item=prefilter}
    513           <option value="{$prefilter.ID}" {if $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option>
     505          <option value="{$prefilter.ID}" {if isset($filter.prefilter) && $filter.prefilter eq $prefilter.ID}selected="selected"{/if}>{$prefilter.NAME}</option>
    514506          {/foreach}
    515507        </select>
     
    529521        {'Tags'|@translate}
    530522        <select id="tagsFilter" name="filter_tags">
    531           {foreach from=$filter_tags item=tag}
     523          {if isset($filter_tags)}{foreach from=$filter_tags item=tag}
    532524          <option value="{$tag.id}">{$tag.name}</option>
    533           {/foreach}
     525          {/foreach}{/if}
    534526        </select>
    535527        <label><span><input type="radio" name="tag_mode" value="AND" {if !isset($filter.tag_mode) or $filter.tag_mode eq 'AND'}checked="checked"{/if}> {'All tags'|@translate}</span></label>
     
    547539    </ul>
    548540
    549     <p class="actionButtons" style="">
     541    <p class="actionButtons">
    550542      <select id="addFilter">
    551543        <option value="-1">{'Add a filter'|@translate}</option>
     
    587579  </p>
    588580
    589     <ul class="thumbnails">
    590                         {foreach from=$thumbnails item=thumbnail}
    591                                 {if in_array($thumbnail.ID, $selection)}
    592                                         {assign var='isSelected' value=true}
    593                                 {else}
    594                                         {assign var='isSelected' value=false}
    595                                 {/if}
    596                         <li>
    597                                 <span class="wrap1">
    598                                         <label>
    599                                                 <span class="wrap2{if $isSelected} thumbSelected{/if}">
    600                                                 <div class="actions"><a href="{$thumbnail.FILE_SRC}" class="preview-box">{'Zoom'|@translate}</a> &middot; <a href="{$thumbnail.U_EDIT}" target="_blank">{'Edit'|@translate}</a></div>
    601                                                         {if $thumbnail.LEVEL > 0}
    602                                                         <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
    603                                                         <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.LEVEL))}</em>
    604                                                         {/if}
    605                                                         <span>
    606                                                                 <img src="{$thumbnail.TN_SRC}" alt="{$thumbnail.FILE}" title="{$thumbnail.TITLE|@escape:'html'}" class="thumbnail">
    607                                                         </span>
    608                                                 </span>
    609                                                 <input type="checkbox" name="selection[]" value="{$thumbnail.ID}" {if $isSelected}checked="checked"{/if}>
    610                                         </label>
    611                                 </span>
    612                         </li>
    613       {/foreach}
    614     </ul>
     581        <ul class="thumbnails">
     582                {html_style}
     583UL.thumbnails SPAN.wrap2{ldelim}
     584  width: {$thumb_params->max_width()+2}px;
     585}
     586UL.thumbnails SPAN.wrap2 {ldelim}
     587  height: {$thumb_params->max_height()+25}px;
     588}
     589                {/html_style}
     590                {foreach from=$thumbnails item=thumbnail}
     591                {assign var='isSelected' value=$thumbnail.id|@in_array:$selection}
     592                <li>
     593                        <span class="wrap1">
     594                                <label>
     595                                        <input type="checkbox" name="selection[]" value="{$thumbnail.id}" {if $isSelected}checked="checked"{/if}>
     596                                        <span class="wrap2{if $isSelected} thumbSelected{/if}">
     597                                        <div class="actions"><a href="{$thumbnail.FILE_SRC}" class="preview-box">{'Zoom'|@translate}</a> &middot; <a href="{$thumbnail.U_EDIT}" target="_blank">{'Edit'|@translate}</a></div>
     598                                                {if $thumbnail.level > 0}
     599                                                <em class="levelIndicatorB">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.level))}</em>
     600                                                <em class="levelIndicatorF" title="{'Who can see these photos?'|@translate} : ">{$pwg->l10n($pwg->sprintf('Level %d',$thumbnail.level))}</em>
     601                                                {/if}
     602                                                <img src="{$thumbnail.thumb->get_url()}" alt="{$thumbnail.file}" title="{$thumbnail.TITLE|@escape:'html'}" {$thumbnail.thumb->get_size_htm()}>
     603                                        </span>
     604                                </label>
     605                        </span>
     606                </li>
     607                {/foreach}
     608        </ul>
    615609
    616610  {if !empty($navbar) }
     
    714708    <!-- del_tags -->
    715709    <div id="action_del_tags" class="bulkAction">
    716 {$DEL_TAG_SELECTION}
     710{if !empty($DEL_TAG_SELECTION)}{$DEL_TAG_SELECTION}{/if}
    717711    </div>
    718712
  • branches/2.4/admin/themes/default/theme.css

    r17008 r17290  
    4343  background-color: #333;
    4444  color: #666;
    45   -moz-border-radius: 5px;
     45  border-radius: 5px;
    4646  display: block;
    47   width: 104px;
    48   height: 104px;
     47  width: 120px;
     48  height: 120px;
    4949  cursor: move;
    50   margin: 10px;
     50  margin: 4px;
     51        overflow: hidden;
    5152}
    5253.clipwrapper {
     
    5960  position:absolute;
    6061}
    61 UL.thumbnails li.rank-of-image input {
    62 }
     62
    6363UL.thumbnails SPAN.wrap1 {
    6464  margin: 5px;
     
    7272  display: table-cell;          /* block prevents vertical-align here */
    7373  vertical-align: middle;       /* Ok with Opera and Geko not IE6 */
    74 }
    75 UL.thumbnails LABEL { display: block; border-bottom: none; }
     74        border-radius: 4px;
     75}
     76UL.thumbnails LABEL {
     77        position: relative;
     78        display: block;
     79        border-bottom: none;
     80}
     81
    7682UL.thumbnails IMG {
    77   margin-bottom: -4px;  /* why ??? something wrong with Geko and Opera ignored by IE6*/
    78 }
    79 UL.thumbnails LABEL { position: relative; }
     83        vertical-align: middle;
     84        margin-top: 12px;
     85}
     86
    8087UL.thumbnails INPUT {
    81   position: relative;   /* <= Opera can handle relative here */
    82   top: -20px;
    83 }
    84 :root UL.thumbnails INPUT { /* hide from Opera */
    85   position: absolute;   /* <= Opera hide 1 checkbox over 2 !!! */
     88  position: absolute;
    8689  left: 2px; top: 2px;
    8790}
    8891UL.thumbnails .levelIndicatorB {
    89 display:block; position:absolute; z-index:100;padding:0px 0 0 14px; color:black; font-weight:bold; font-size:120%;
     92display:block; position:absolute; z-index:100; padding:7px 0 0 2px; color:black; font-weight:bold; font-size:120%;
    9093}
    9194UL.thumbnails .levelIndicatorF {
    92 display:block; position:absolute; z-index:101;padding:1px 0 0 15px; color:white; font-weight:bold; font-size:120%;
     95display:block; position:absolute; z-index:101; padding:8px 0 0 3px; color:white; font-weight:bold; font-size:120%;
    9396}
    9497
     
    298301font-weight: normal;
    299302font-style:italic;
    300 padding: 8px 0 0 10px;
     303padding: 2px 0 0 10px;
    301304margin: 0;
    302305float:left;
     
    307310#pwgHead A:hover {color:#fff;border-bottom:1px solid #fff}
    308311
    309 #headActions {float:right; height:46px; line-height:46px; margin-right:10px;}
     312#headActions {float:right; height:36px; line-height:36px; margin-right:10px;}
    310313
    311314A {
     
    590593#pwgHead {
    591594  background-color:#464646;
    592   height:46px;
     595        height: 36px;
    593596}
    594597
     
    604607  bottom:0;
    605608  width:100%;
    606   height:46px;
    607   background: url(images/logo.png) no-repeat 7px 8px;
    608   background-color:#464646;
     609        height: 34px;
     610        line-height: 34px;
     611        background-repeat: no-repeat;
     612        background-position: 7px 2px;
     613        background-color:#464646;
    609614  color:#aaa;
    610   line-height:46px;
    611615}
    612616
     
    768772#thePopuphelpPage #pwgHead {display:none}
    769773#thePopuphelpPage #footer  {display:none}
    770 
    771 /* Set some sizes according to your maximum thumbnail width and height */
    772 UL.thumbnails SPAN,
    773 UL.thumbnails SPAN.wrap2 A,
    774 UL.thumbnails LABEL {
    775   width: 140px;      /* max thumbnail width + 2px */
    776 }
    777 UL.thumbnails SPAN.wrap2 {
    778   height: 140px;    /* max thumbnail height + 2px */
    779 }
    780 
    781774
    782775.themeBox {display:inline-table; text-align:center; height:192px; background-color:#eee; margin:5px; -moz-border-radius:5px; overflow:hidden; }
     
    979972#batchManagerGlobal ul.thumbnails div.actions a:hover {border-color:#fff;}
    980973#batchManagerGlobal ul.thumbnails span.wrap1:hover div.actions {display:block;}
    981 #batchManagerGlobal #selectedMessage {padding:5px; -moz-border-radius:5px;-webkit-border-radius:5px;}
     974#batchManagerGlobal #selectedMessage {padding:5px; border-radius:5px;}
    982975#batchManagerGlobal #selectSet a {border-bottom:1px dotted;}
    983976#batchManagerGlobal #applyOnDetails {font-style:italic;}
  • branches/2.4/admin/themes/roma/theme.css

    r16391 r17290  
    6565UL.thumbnails span.wrap2:hover { background-color#7CBA0F; color:#666; }
    6666UL.thumbnails span.wrap2 {
    67         padding: 4px;
    68         border-radius: 4px;
    6967        background-color:#333;
    7068}
     
    8179.tagSelected LABEL {color:#000;}
    8280.content ul.categoryActions a img { margin-left: 10px; }
    83 ul.thumbnails input { border:3px double #999; color:#999; font-size:10px; margin:0; background-color:#444; text-align: center;}
     81ul.thumbnails input { color:#999; font-size:10px; margin:0; background-color:#444; text-align: center;}
    8482INPUT[type="submit"]:hover , INPUT[type="reset"]:hover  { cursor: pointer; }
    8583INPUT.bigbutton:hover { background-color: #222;  color:#f33; border: 0; }
Note: See TracChangeset for help on using the changeset viewer.