{include file='include/colorbox.inc.tpl'} {combine_script id='jquery.cluetip' load='async' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'} {footer_script require='jquery.cluetip'} var piwigo_need_update_msg = '{'A new version of Piwigo is available.'|@translate|@escape:"javascript"} '; var ext_need_update_msg = '{'Some upgrades are available for extensions.'|@translate|@escape:"javascript"} '; const str_gb_used = "{'%s GB used'|translate}"; const str_mb_used = "{'%s MB used'|translate}"; const str_gb = "{'%sGB'|translate}".replace(' ', ' '); const str_mb = "{'%sMB'|translate}".replace(' ', ' '); const storage_total = {$STORAGE_TOTAL}; const storage_details = {$STORAGE_CHART_DATA|json_encode}; const translate_files = "{'%d files'|translate|escape:javascript}"; let translate_type = {}; {literal} jQuery().ready(function(){ jQuery('.cluetip').cluetip({ width: 300, splitTitle: '|', positionBy: 'bottomTop' }); {/literal} {if $CHECK_FOR_UPDATES} jQuery.ajax({ type: 'GET', url: 'ws.php', dataType: 'json', data: { method: 'pwg.extensions.checkUpdates', format: 'json' }, timeout: 5000, success: function (data) { if (data['stat'] != 'ok') return; piwigo_update = data['result']['piwigo_need_update']; ext_update = data['result']['ext_need_update'] if ((piwigo_update || ext_update) && !jQuery(".warnings").is('div')) jQuery(".eiw").prepend('
'+ (infos.total.nb_files ? translate_files.replace('%d', infos.total.nb_files) : "~") +'
'); // Display body of Tooltip if (infos.details) { $.each(infos.details, function(ext, data) { // Determinate if we use MB or GB and show it correctly (duplicate code from total size for scaling code) let detail_size = data.filesize; let detail_str_size_type_string; let detail_size_nb = 0; if (detail_size > 1000000) { detail_str_size_type_string = str_gb; detail_size_nb = (detail_size / 1000000).toFixed(2); } else { detail_str_size_type_string = str_mb; detail_size_nb = (detail_size / 1000).toFixed(0) < 1 ? (detail_size / 1000).toFixed(2) : (detail_size / 1000).toFixed(0); } let detail_str_size = detail_str_size_type_string.replace("%s", detail_size_nb); $('#storage-detail-' + type).append(''+ ''+ ''+ ext +''+ ''+ detail_str_size +''+ ''+ translate_files.replace('%d', data.nb_files) +''+ ''+ ''); let ext_bg_color = $('.storage-chart span[data-type="storage-'+type+'"]').css('background-color'); $('#storage-'+type+' .tooltip-details-ext b').css('color', ext_bg_color); }); } else { $('#storage-'+ type +' .separated').attr('style', 'display: none !important'); $('#storage-' + type +' .tooltip-header').css('margin', '0'); } // Fixing storage chart tooltip bug in little screen // Keep showing tooltip and his % when hovered $('#storage-' + type).hover(function() { $(this).css('display', 'block'); $('.storage-chart span[data-type="storage-'+ type +'"] p').css('opacity', '0.4'); }, function() { $(this).css('display', 'none'); $('.storage-chart span[data-type="storage-'+ type +'"] p').css('opacity', '0'); }); $('.storage-chart span[data-type="storage-'+ type +'"]').hover(function() { $(this).find('p').css('opacity', '0.4'); }, function() { $(this).find('p').css('opacity', '0'); }); }); //Tooltip for the storage chart $('.storage-chart span').each(function () { let tooltip = $('.storage-tooltips #'+$(this).data('type')); let arrow = $('.storage-tooltips #'+$(this).data("type")+' .tooltip-arrow'); let left = $(this).position().left + $(this).width()/2 - tooltip.innerWidth()/2; // Move tooltip if he create horizontal scrollbar let storage_width = $('#chart-title-storage').innerWidth(); if(left + tooltip.innerWidth() > storage_width){ let diff = (left + tooltip.innerWidth()) - storage_width; left = left - diff; arrow.css('left', 'calc(50% + '+ diff +'px)'); } tooltip.css('left', left+"px"); // Move tooltip if he create vertical scrollbar let str_chart_pos = $('.storage-chart').offset().top; let str_chart_height = $('.storage-chart').innerHeight(); let tooltip_height = $('.storage-tooltips #'+$(this).data("type")).innerHeight() + str_chart_height; let windows_height = $(window).height(); if (str_chart_pos + tooltip_height > windows_height) { tooltip.css('bottom', 'calc(100% + '+ str_chart_height +'px)'); arrow.addClass('bottom'); } $(this).hover(function() { tooltip.toggle(); }); }); $(window).on('resize', function(){ $('.storage-chart span').each(function () { let tooltip = $('.storage-tooltips #'+$(this).data('type')); let arrow = $('.storage-tooltips #'+$(this).data("type")+' .tooltip-arrow'); let left = $(this).position().left + $(this).width()/2 - tooltip.innerWidth()/2; // Move tooltip if he create horizontal scrollbar let storage_width = $('#chart-title-storage').innerWidth(); if(left + tooltip.innerWidth() > storage_width){ let diff = (left + tooltip.innerWidth()) - storage_width; left = left - diff; arrow.css('left', 'calc(50% + '+ diff +'px)'); } tooltip.css('left', left+"px"); // Move tooltip if he create vertical scrollbar let str_chart_pos = $('.storage-chart').offset().top; let str_chart_height = $('.storage-chart').innerHeight(); let tooltip_height = $('.storage-tooltips #'+$(this).data("type")).innerHeight() + str_chart_height; let windows_height = $(window).height(); if (str_chart_pos + tooltip_height > windows_height) { tooltip.css('bottom', 'calc(100% + '+ str_chart_height +'px)'); arrow.addClass('bottom'); } else { tooltip.css('bottom', ''); arrow.removeClass('bottom'); } }); }); {/literal} {/footer_script} {html_style} .eiw .messages ul li { list-style-type:none !important; } .eiw .messages .eiw-icon { margin-right:10px !important; } {/html_style}{if $ACTIVITY_LAST_WEEKS[$WEEK_NUMBER][$DAY_NUMBER]["number"] > 1}{'%d Activities'|translate:$ACTIVITY_LAST_WEEKS[$WEEK_NUMBER][$DAY_NUMBER]["number"]}{else}{'%d Activity'|translate:$ACTIVITY_LAST_WEEKS[$WEEK_NUMBER][$DAY_NUMBER]["number"]}{/if} {$ACTIVITY_LAST_WEEKS[$WEEK_NUMBER][$DAY_NUMBER]["date"]} {foreach from=$ACTIVITY_LAST_WEEKS[$WEEK_NUMBER][$DAY_NUMBER]["details"] item=actions key=cat} {if $cat == "Group"} {$cat|translate} {elseif $cat == "User"} {$cat|translate} {elseif $cat == "Album"} {$cat|translate} {elseif $cat == "Photo"} {$cat|translate} {elseif $cat == "Tag"} {else} {$cat|translate} {/if} {foreach from=$actions item=number key=action} {if $action == "Edit"} {$number} {elseif $action == "Add"} {$number} {elseif $action == "Delete"} {$number} {elseif $action == "Login"} {$number} {elseif $action == "Logout"} {$number} {elseif $action == "Move"} {$number} {else} ({$action|translate}) {$number} {/if} {/foreach} {/foreach}
{/if} {/if} {/foreach} {/foreach} {foreach from=$DAY_LABELS item=day}{round($details.total.filesize/$STORAGE_TOTAL*100)}%
{/foreach}{/foreach}
{$type|translate}
{if $ENABLE_SYNCHRONIZATION}
{'Quick Local Synchronization'|translate}
{/if}
{if isset($SUBSCRIBE_BASE_URL)}
{/if}