From 4b181b746fa3660f63de96373caf66686cc470b4 Mon Sep 17 00:00:00 2001 From: rvelices Date: Wed, 1 Aug 2012 17:00:07 +0000 Subject: 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) git-svn-id: http://piwigo.org/svn/branches/2.4@17290 68402e56-0260-453c-a942-63ccdbb3a9ee --- admin/batch_manager.php | 12 ++-- admin/batch_manager_global.php | 23 +++---- admin/element_set_ranks.php | 30 ++++----- admin/themes/clear/theme.css | 4 +- .../default/template/batch_manager_global.tpl | 78 ++++++++++------------ admin/themes/default/theme.css | 63 ++++++++--------- admin/themes/roma/theme.css | 4 +- 7 files changed, 98 insertions(+), 116 deletions(-) diff --git a/admin/batch_manager.php b/admin/batch_manager.php index 113d4c629..7869e4cc2 100644 --- a/admin/batch_manager.php +++ b/admin/batch_manager.php @@ -50,7 +50,7 @@ check_input_parameter('selection', $_POST, true, PATTERN_ID); if (isset($_POST['submitFilter'])) { // echo '
'; print_r($_POST); echo '
'; - + unset($_REQUEST['start']); // new photo set must reset the page $_SESSION['bulk_manager_filter'] = array(); if (isset($_POST['filter_prefilter_use'])) @@ -335,16 +335,16 @@ $page['cat_elements_id'] = $current_set; // category. For exampe, $page['start'] = 12 means we must show elements #12 // and $page['nb_images'] next elements -if (!isset($_GET['start']) - or !is_numeric($_GET['start']) - or $_GET['start'] < 0 - or (isset($_GET['display']) and 'all' == $_GET['display'])) +if (!isset($_REQUEST['start']) + or !is_numeric($_REQUEST['start']) + or $_REQUEST['start'] < 0 + or (isset($_REQUEST['display']) and 'all' == $_REQUEST['display'])) { $page['start'] = 0; } else { - $page['start'] = $_GET['start']; + $page['start'] = $_REQUEST['start']; } // +-----------------------------------------------------------------------+ diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index 99641ce6f..8b6ec5b68 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -472,8 +472,9 @@ $template->assign( 'filter' => $_SESSION['bulk_manager_filter'], 'selection' => $collection, 'all_elements' => $page['cat_elements_id'], + 'START' => $page['start'], 'U_DISPLAY'=>$base_url.get_query_string_diff(array('display')), - 'F_ACTION'=>$base_url.get_query_string_diff(array('cat')), + 'F_ACTION'=>$base_url.get_query_string_diff(array('cat','start')), ) ); @@ -732,7 +733,6 @@ if (count($page['cat_elements_id']) > 0) $conf['order_by'] = ' ORDER BY file, id'; } - $query = ' SELECT id,path,representative_ext,file,filesize,level,name,width,height,rotation FROM '.IMAGES_TABLE; @@ -766,31 +766,30 @@ SELECT id,path,representative_ext,file,filesize,level,name,width,height,rotation ;'; $result = pwg_query($query); + $thumb_params = ImageStdParams::get_by_type(IMG_THUMB); // template thumbnail initialization while ($row = pwg_db_fetch_assoc($result)) { $nb_thumbs_page++; $src_image = new SrcImage($row); - $title = render_element_name($row); - if ($title != get_name_from_file($row['file'])) + $ttitle = render_element_name($row); + if ($ttitle != get_name_from_file($row['file'])) { - $title.= ' ('.$row['file'].')'; + $ttitle.= ' ('.$row['file'].')'; } $template->append( - 'thumbnails', + 'thumbnails', array_merge($row, array( - 'ID' => $row['id'], - 'TN_SRC' => DerivativeImage::url(IMG_THUMB, $src_image), - 'FILE' => $row['file'], - 'TITLE' => $title, - 'LEVEL' => $row['level'], + 'thumb' => new DerivativeImage($thumb_params, $src_image), + 'TITLE' => $ttitle, 'FILE_SRC' => DerivativeImage::url(IMG_LARGE, $src_image), 'U_EDIT' => get_root_url().'admin.php?page=photo-'.$row['id'], ) - ); + )); } + $template->assign('thumb_params', $thumb_params); } $template->assign( diff --git a/admin/element_set_ranks.php b/admin/element_set_ranks.php index cba101022..38b168bec 100644 --- a/admin/element_set_ranks.php +++ b/admin/element_set_ranks.php @@ -239,21 +239,21 @@ if (pwg_db_num_rows($result) > 0) // image order management $sort_fields = array( '' => '', - 'file' => l10n('file name, A → Z'), - 'file DESC' => l10n('file name, Z → A'), - 'name' => l10n('photo title, A → Z'), - 'name DESC' => l10n('photo title, Z → A'), - 'date_creation DESC' => l10n('date created, new → old'), - 'date_creation' => l10n('date created, old → new'), - 'date_available DESC' => l10n('date posted, new → old'), - 'date_available' => l10n('date posted, old → new'), - 'rating_score DESC' => l10n('rating score, high → low'), - 'rating_score' => l10n('rating score, low → high'), - 'hit DESC' => l10n('visits, high → low'), - 'hit' => l10n('visits, low → high'), - 'id' => l10n('numeric identifier, 1 → 9'), - 'id DESC' => l10n('numeric identifier, 9 → 1'), - 'rank' => l10n('manual sort order'), + 'file' => l10n('File name, A → Z'), + 'file DESC' => l10n('File name, Z → A'), + 'name' => l10n('Photo title, A → Z'), + 'name DESC' => l10n('Photo title, Z → A'), + 'date_creation DESC' => l10n('Date created, new → old'), + 'date_creation' => l10n('Date created, old → new'), + 'date_available DESC' => l10n('Date posted, new → old'), + 'date_available' => l10n('Date posted, old → new'), + 'rating_score DESC' => l10n('Rating score, high → low'), + 'rating_score' => l10n('Rating score, low → high'), + 'hit DESC' => l10n('Visits, high → low'), + 'hit' => l10n('Visits, low → high'), + 'id' => l10n('Numeric identifier, 1 → 9'), + 'id DESC' => l10n('Numeric identifier, 9 → 1'), + 'rank' => l10n('Manual sort order'), ); $template->assign('image_order_options', $sort_fields); diff --git a/admin/themes/clear/theme.css b/admin/themes/clear/theme.css index 2a5003fc6..1eed49bc7 100644 --- a/admin/themes/clear/theme.css +++ b/admin/themes/clear/theme.css @@ -97,8 +97,6 @@ h3, .content, .throw, .row1 { background-color: #ddd; } UL.thumbnails span.wrap2:hover { background-color:#7CBA0F; color:#999; } UL.thumbnails span.wrap2 { - padding: 4px; - border-radius: 4px; background-color:#ddd; } @@ -111,7 +109,7 @@ TEXTAREA { cursor:text; font-size: 13px; } .tagSelected LABEL {color:black;} .content ul.categoryActions a img { margin-left: 10px; } -ul.thumbnails input { border:3px double #666; color:#666; font-size:10px; margin:0; background-color:#bbb; text-align: center;} +ul.thumbnails input { color:#666; font-size:10px; margin:0; background-color:#bbb; text-align: center;} INPUT.bigbutton:hover { background-color: #ddd; color:#0cc; border: 0; } .throw { font-size: 120%; line-height: 26px; padding-top: 10px; font-weight: bold; } label { cursor:pointer } diff --git a/admin/themes/default/template/batch_manager_global.tpl b/admin/themes/default/template/batch_manager_global.tpl index 7f5d82d1b..cce55082a 100644 --- a/admin/themes/default/template/batch_manager_global.tpl +++ b/admin/themes/default/template/batch_manager_global.tpl @@ -50,6 +50,7 @@ jQuery(document).ready(function() { $(this).click(function(event) {console.log(event.shiftKey);$(this).triggerHandler("shclick",event)}); }); } + $('ul.thumbnails').enableShiftClick(); }); {/literal}{/footer_script} @@ -481,17 +482,7 @@ $(document).ready(function() { checkPermitAction() }); -jQuery(window).load(function() { - var max_w=0, max_h=0; - $(".thumbnails img").each(function () { - max_w = Math.max(max_w, $(this).width() ); - max_h = Math.max(max_h, $(this).height() ); - }); - max_w += 10; - max_h += 35; - $("ul.thumbnails span, ul.thumbnails label").css('width', max_w+'px').css('height', max_h+'px'); - $('ul.thumbnails').enableShiftClick(); -}); + {/literal}{/footer_script}
@@ -499,6 +490,7 @@ jQuery(window).load(function() {

{'Batch Manager'|@translate}

+
{'Filter'|@translate} @@ -510,7 +502,7 @@ jQuery(window).load(function() { {'Predefined filter'|@translate} @@ -528,9 +520,9 @@ jQuery(window).load(function() { {'Tags'|@translate} @@ -546,7 +538,7 @@ jQuery(window).load(function() { -

+

-
    - {foreach from=$thumbnails item=thumbnail} - {if in_array($thumbnail.ID, $selection)} - {assign var='isSelected' value=true} - {else} - {assign var='isSelected' value=false} - {/if} -
  • - - - -
  • - {/foreach} -
+
    + {html_style} +UL.thumbnails SPAN.wrap2{ldelim} + width: {$thumb_params->max_width()+2}px; +} +UL.thumbnails SPAN.wrap2 {ldelim} + height: {$thumb_params->max_height()+25}px; +} + {/html_style} + {foreach from=$thumbnails item=thumbnail} + {assign var='isSelected' value=$thumbnail.id|@in_array:$selection} +
  • + + + +
  • + {/foreach} +
{if !empty($navbar) }
@@ -713,7 +707,7 @@ jQuery(window).load(function() {
-{$DEL_TAG_SELECTION} +{if !empty($DEL_TAG_SELECTION)}{$DEL_TAG_SELECTION}{/if}
diff --git a/admin/themes/default/theme.css b/admin/themes/default/theme.css index 688c07997..a2cb884cf 100644 --- a/admin/themes/default/theme.css +++ b/admin/themes/default/theme.css @@ -42,12 +42,13 @@ UL.thumbnails li.rank-of-image { float: left; background-color: #333; color: #666; - -moz-border-radius: 5px; + border-radius: 5px; display: block; - width: 104px; - height: 104px; + width: 120px; + height: 120px; cursor: move; - margin: 10px; + margin: 4px; + overflow: hidden; } .clipwrapper { position:relative; @@ -58,8 +59,7 @@ UL.thumbnails li.rank-of-image { .clip { position:absolute; } -UL.thumbnails li.rank-of-image input { -} + UL.thumbnails SPAN.wrap1 { margin: 5px; display: table-cell; display: inline-table; @@ -71,25 +71,28 @@ UL.thumbnails SPAN.wrap2 { margin: 0; /* important reset the margins */ display: table-cell; /* block prevents vertical-align here */ vertical-align: middle; /* Ok with Opera and Geko not IE6 */ + border-radius: 4px; +} +UL.thumbnails LABEL { + position: relative; + display: block; + border-bottom: none; } -UL.thumbnails LABEL { display: block; border-bottom: none; } + UL.thumbnails IMG { - margin-bottom: -4px; /* why ??? something wrong with Geko and Opera ignored by IE6*/ + vertical-align: middle; + margin-top: 12px; } -UL.thumbnails LABEL { position: relative; } + UL.thumbnails INPUT { - position: relative; /* <= Opera can handle relative here */ - top: -20px; -} -:root UL.thumbnails INPUT { /* hide from Opera */ - position: absolute; /* <= Opera hide 1 checkbox over 2 !!! */ + position: absolute; left: 2px; top: 2px; } UL.thumbnails .levelIndicatorB { -display:block; position:absolute; z-index:100;padding:0px 0 0 14px; color:black; font-weight:bold; font-size:120%; +display:block; position:absolute; z-index:100; padding:7px 0 0 2px; color:black; font-weight:bold; font-size:120%; } UL.thumbnails .levelIndicatorF { -display:block; position:absolute; z-index:101;padding:1px 0 0 15px; color:white; font-weight:bold; font-size:120%; +display:block; position:absolute; z-index:101; padding:8px 0 0 3px; color:white; font-weight:bold; font-size:120%; } /* default-layout.css */ @@ -297,7 +300,7 @@ text-align: left; font-size: 150%; font-weight: normal; font-style:italic; -padding: 8px 0 0 10px; +padding: 2px 0 0 10px; margin: 0; float:left; } @@ -306,7 +309,7 @@ float:left; #pwgHead A {color:#ccc;} #pwgHead A:hover {color:#fff;border-bottom:1px solid #fff} -#headActions {float:right; height:46px; line-height:46px; margin-right:10px;} +#headActions {float:right; height:36px; line-height:36px; margin-right:10px;} A { text-decoration:none; @@ -589,7 +592,7 @@ img.ui-datepicker-trigger { #pwgHead { background-color:#464646; - height:46px; + height: 36px; } html, body {height:100%; margin:0; padding:0;} @@ -603,11 +606,12 @@ html, body {height:100%; margin:0; padding:0;} position:absolute; bottom:0; width:100%; - height:46px; - background: url(images/logo.png) no-repeat 7px 8px; - background-color:#464646; + height: 34px; + line-height: 34px; + background-repeat: no-repeat; + background-position: 7px 2px; + background-color:#464646; color:#aaa; - line-height:46px; } #footer A {color:#ccc;} @@ -768,17 +772,6 @@ BODY { #thePopuphelpPage #pwgHead {display:none} #thePopuphelpPage #footer {display:none} -/* Set some sizes according to your maximum thumbnail width and height */ -UL.thumbnails SPAN, -UL.thumbnails SPAN.wrap2 A, -UL.thumbnails LABEL { - width: 140px; /* max thumbnail width + 2px */ -} -UL.thumbnails SPAN.wrap2 { - height: 140px; /* max thumbnail height + 2px */ -} - - .themeBox {display:inline-table; text-align:center; height:192px; background-color:#eee; margin:5px; -moz-border-radius:5px; overflow:hidden; } .themeBox IMG {border:1px solid white; margin:0 15px;} @@ -978,7 +971,7 @@ LEGEND { #batchManagerGlobal ul.thumbnails div.actions a {color:#fff;} #batchManagerGlobal ul.thumbnails div.actions a:hover {border-color:#fff;} #batchManagerGlobal ul.thumbnails span.wrap1:hover div.actions {display:block;} -#batchManagerGlobal #selectedMessage {padding:5px; -moz-border-radius:5px;-webkit-border-radius:5px;} +#batchManagerGlobal #selectedMessage {padding:5px; border-radius:5px;} #batchManagerGlobal #selectSet a {border-bottom:1px dotted;} #batchManagerGlobal #applyOnDetails {font-style:italic;} #batchManagerGlobal .actionButtons {text-align:left;} diff --git a/admin/themes/roma/theme.css b/admin/themes/roma/theme.css index a1509ed1e..e6d9eea30 100644 --- a/admin/themes/roma/theme.css +++ b/admin/themes/roma/theme.css @@ -64,8 +64,6 @@ h3, .row2, .content { background-color: #222; } UL.thumbnails span.wrap2:hover { background-color#7CBA0F; color:#666; } UL.thumbnails span.wrap2 { - padding: 4px; - border-radius: 4px; background-color:#333; } @@ -80,7 +78,7 @@ TEXTAREA { cursor:text; font-size: 13px; } .tagSelection LI.tagSelected {background-color:#aaa;} .tagSelected LABEL {color:#000;} .content ul.categoryActions a img { margin-left: 10px; } -ul.thumbnails input { border:3px double #999; color:#999; font-size:10px; margin:0; background-color:#444; text-align: center;} +ul.thumbnails input { color:#999; font-size:10px; margin:0; background-color:#444; text-align: center;} INPUT[type="submit"]:hover , INPUT[type="reset"]:hover { cursor: pointer; } INPUT.bigbutton:hover { background-color: #222; color:#f33; border: 0; } .throw { font-size: 120%; line-height: 26px; padding-top: 10px; font-weight: bold; color: #ff3363; } -- cgit v1.2.3