Improve virtual list responsiveness and quota tooltip (#1050)

This PR includes two small UI improvements:

* Add horizontal scroll wrappers to virtual mailbox/alias lists so
action buttons and table content do not overflow narrow desktop/tablet
widths.
* Add a domain quota tooltip showing assigned quota and real used quota,
while preserving the existing visible assigned quota text and
usage-based bar color.
  
Tested locally with PHP lint for DomainHandler.php.

thanks @trapoSAMA
This commit is contained in:
Rodrigo Cortés Cano authored and GitHub committed 2026-06-28 08:49:53 +01:00
1 parent 74c50fb12b
commit 730ddcb909
6 files changed
+23 -3

No files matched your search

+2
View File
@@ -102,6 +102,8 @@ $PALANG['and_x_more'] = '[and %s more...]';
$PALANG['pOverview_mailbox_username'] = 'Email';
$PALANG['name'] = 'Name';
$PALANG['pOverview_mailbox_quota'] = 'Quota (MB)';
$PALANG['quota_assigned'] = 'Assigned';
$PALANG['quota_used'] = 'Used';
$PALANG['pOverview_vacation_edit'] = 'VACATION IS ON';
$PALANG['pOverview_vacation_option'] = 'Set Vacation';
$PALANG['no_domains_for_this_admin'] = 'You don\'t have permissions for any domains.';
+2
View File
@@ -94,6 +94,8 @@ $PALANG['and_x_more'] = '[y %s más...]';
$PALANG['pOverview_mailbox_username'] = 'E-mail';
$PALANG['name'] = 'Nombre';
$PALANG['pOverview_mailbox_quota'] = 'Cuota (MB)';
$PALANG['quota_assigned'] = 'Asignado';
$PALANG['quota_used'] = 'Usado';
$PALANG['pOverview_vacation_edit'] = 'AUTORESPUESTA ESTÁ ACTIVADO';
$PALANG['pOverview_vacation_option'] = 'Autorespuesta';
$PALANG['no_domains_for_this_admin'] = 'No tienes permisos sobre ningún dominio.';
+1
View File
@@ -121,6 +121,7 @@ class DomainHandler extends PFAHandler
# Domain quota
'quota' => self::pacol($edit_dom_q,$edit_dom_q, 0, 'num', 'pAdminEdit_domain_quota' , 'pAdminEdit_domain_maxquota_text' , $domain_quota_default),
'total_quota' => self::pacol(0, 0, 1, 'vnum', '' , '' , '', array(), 0, 0, "$query_used_domainquota AS total_quota" /*extrafrom*//* already in mailbox_count */),
'total_quota_used' => self::pacol(0, 0, 1, 'vnum', '' , '' , '', array(), 0, 0, "$query_display_domainquota AS total_quota_used" /*extrafrom*//* already in mailbox_count */),
'total_quot' => self::pacol(0, 0, $dom_q, 'quot', 'pAdminEdit_domain_quota' , '' , 0, array(), 0, 0, db_quota_text($query_used_domainquota, 'quota', 'total_quot')),
'_total_quot_percent' => self::pacol(0, 0, $dom_q, 'vnum', '' , '' , 0, array(), 0, 0, db_quota_percent($query_display_domainquota, 'quota', '_total_quot_percent')),
+5
View File
@@ -151,3 +151,8 @@ div#login{ max-width: 35em; }
#admin_table td.list-col-action { width: 46px; }
#admin_table .list-action-icon,
#mailbox_table .list-action-icon { width: 34px; padding-left: 0; padding-right: 0; }
.mailbox-list-scroll { display: block; width: 100%; overflow-x: auto; }
.mailbox-list-scroll > #mailbox_table { min-width: 820px; margin-bottom: 0; }
.virtual-list-scroll { display: block; width: 100%; overflow-x: auto; }
.virtual-list-scroll > #admin_table { min-width: 720px; margin-bottom: 0; }
+2
View File
@@ -9,6 +9,7 @@
</div>
<div class="card-body">
<div class="mailbox-list-scroll">
<table class="table table-hover table-sm table-striped align-middle" id="mailbox_table">
<thead>
{#tr_header#}
@@ -141,4 +142,5 @@
{/foreach}
</tbody>
</table>
</div>
</div>
+11 -3
View File
@@ -34,7 +34,11 @@
{/if}
<div class="card-body">
{if $table == 'domain'}<div class="domain-list-scroll">{/if}
{if $table == 'domain'}
<div class="domain-list-scroll">
{elseif $table == 'alias' || $table == 'aliasdomain'}
<div class="virtual-list-scroll">
{/if}
<table class="table table-hover table-sm table-striped align-middle" id='admin_table'>
<!-- TODO: 'admin_table' needed because of CSS for table header -->
<thead>
@@ -121,7 +125,11 @@
{else}
{assign var="quota_level" value="low"}
{/if}
<div class="quota_bar{if $item[$tmpkey] <= -1} quota_no_border{/if}">
{assign "quota_tooltip" ""}
{if $table == 'domain' && $key == 'total_quot' && isset($item.total_quota_used)}
{assign "quota_tooltip" "{$PALANG.quota_assigned}: {$linktext}&#10;{$PALANG.quota_used}: {$item.total_quota_used} MB"}
{/if}
<div class="quota_bar{if $item[$tmpkey] <= -1} quota_no_border{/if}"{if $quota_tooltip != ''} title="{$quota_tooltip}"{/if}>
{if $item[$tmpkey] > -1}
<span class="quota_fill quota_{$quota_level}" style="width:{$item[$tmpkey]}%;"></span>
<span class="quota_label quota_text_{$quota_level}">{$linktext}</span>
@@ -166,7 +174,7 @@
{/foreach}
</tbody>
</table>
{if $table == 'domain'}</div>{/if}
{if $table == 'domain' || $table == 'alias' || $table == 'aliasdomain'}</div>{/if}
</div>
<div class="card-footer">