From f77f079d37b8df728eefb4333717ec34f27732d4 Mon Sep 17 00:00:00 2001 From: Lombra Date: Sat, 9 May 2026 10:32:24 +0200 Subject: [PATCH] Update appearance for consistency (#1030) - Make cards look closer to Bootstrap reference implementation by removing padding and using the proper header element. - Vertically center align table row content. - Add a theme adaptive background to the navigation bar, and reuse the design for non logged in pages. thanks @Lombra --- templates/index.tpl | 30 +- templates/list-virtual.tpl | 24 +- templates/list-virtual_mailbox.tpl | 248 ++++++++-------- templates/list.tpl | 274 +++++++++--------- templates/login.tpl | 10 - templates/menu.tpl | 451 ++++++++++++++--------------- templates/password-change.tpl | 10 - templates/password-recover.tpl | 10 - 8 files changed, 512 insertions(+), 545 deletions(-) diff --git a/templates/index.tpl b/templates/index.tpl index e3e016b0..51498016 100644 --- a/templates/index.tpl +++ b/templates/index.tpl @@ -21,17 +21,27 @@ -{* Hide menu for some templates *} -{if !in_array($smarty_template, ["login", "login-mfa", "password-recover", "password-change"])} -{config_load file="menu.conf" section=$smarty_template} - {if $authentication_has_role.user} - {include file='users_menu.tpl'} - {else} - {include file='menu.tpl'} - {/if} -{/if} + + +
{if $authentication_has_role.user && $CONF.motd_user}
{$CONF.motd_user}
{elseif $authentication_has_role.global_admin && $CONF.motd_superadmin} diff --git a/templates/list-virtual.tpl b/templates/list-virtual.tpl index 2709a77c..65eb6b43 100644 --- a/templates/list-virtual.tpl +++ b/templates/list-virtual.tpl @@ -73,7 +73,7 @@
{/if} {if $tab=='mailbox' || $tab=='all'} -
+
{$nav_bar_mailbox.top} {assign var="colspan" value=9} {if $CONF.vacation_control_admin===YES}{assign var="colspan" value="`$colspan+1`"}{/if} @@ -85,18 +85,16 @@ diff --git a/templates/list-virtual_mailbox.tpl b/templates/list-virtual_mailbox.tpl index 217ffb0c..a467ae25 100644 --- a/templates/list-virtual_mailbox.tpl +++ b/templates/list-virtual_mailbox.tpl @@ -4,140 +4,142 @@ {assign var="search" value=''} {/if} - - - - - +
+ {$PALANG.pOverview_mailbox_title} +
- {#tr_header#} - {if $CONF.show_status===YES} - - {/if} - - {if $display_mailbox_aliases==true} - - {/if} - - {if $CONF.quota===YES} - {/if} - - - {if $CONF.smtp_active_flag===YES} - {/if} - {assign var="colspan" value="`$colspan-6`"} - - - - - {foreach from=$tMailbox item=item key=i} - - {if $CONF.show_status===YES} - - {/if} - + {/if} + {else} + + {/if} + {assign var="edit_aliases" value=0} + {if $authentication_has_role.global_admin!==true && $CONF.alias_control_admin===YES}{assign var="edit_aliases" value=1}{/if} + {if $authentication_has_role.global_admin==true && $CONF.alias_control===YES}{assign var="edit_aliases" value=1}{/if} + {if $edit_aliases==1} + + {/if} + + + + {/foreach} + +
{$PALANG.pOverview_mailbox_title}
{$PALANG.pOverview_mailbox_username}{$PALANG.to}{$PALANG.name}{$PALANG.pOverview_mailbox_quota}{$PALANG.last_modified}{$PALANG.active}{$PALANG.smtp_active} 
{$gen_show_status_mailbox[$i]} - {if $search eq ""} - {$item.username} - {else} - {$item.username|replace:$search:"$search"} +
+ + + {#tr_header#} + {if $CONF.show_status===YES} + + {/if} + + {if $display_mailbox_aliases==true} + + {/if} + + {if $CONF.quota===YES} + {/if} + + + {if $CONF.smtp_active_flag===YES} + {/if} + {assign var="colspan" value="`$colspan-6`"} + + + + + {foreach from=$tMailbox item=item key=i} + + {if $CONF.show_status===YES} + {/if} - - {if $display_mailbox_aliases==true} - {/if} - - {if $CONF.quota===YES} - + {/if} + + {if $CONF.quota===YES} + - {/if} - - - {if $CONF.smtp_active_flag===YES} - + {/if} + + - {/if} - {if $CONF.vacation_control_admin===YES && $CONF.vacation===YES} - {if $item.v_active!==-1} - {if $item.v_active==1} - {assign var="v_active" value=$PALANG.pOverview_vacation_edit} - {else} - {assign var="v_active" value=$PALANG.pOverview_vacation_option} - {/if} - + {if $CONF.smtp_active_flag===YES} + {/if} - {else} - - {/if} - {assign var="edit_aliases" value=0} - {if $authentication_has_role.global_admin!==true && $CONF.alias_control_admin===YES}{assign var="edit_aliases" value=1}{/if} - {if $authentication_has_role.global_admin==true && $CONF.alias_control===YES}{assign var="edit_aliases" value=1}{/if} - {if $edit_aliases==1} - - {/if} - - - - {/foreach} - -
{$PALANG.pOverview_mailbox_username}{$PALANG.to}{$PALANG.name}{$PALANG.pOverview_mailbox_quota}{$PALANG.last_modified}{$PALANG.active}{$PALANG.smtp_active} 
{$gen_show_status_mailbox[$i]} - {if $item.goto_mailbox == 1} - {$PALANG.To_Mailbox} -
+ {if $search eq ""} + {$item.username} {else} - {$PALANG.To_Forward_Only} -
+ {$item.username|replace:$search:"$search"} {/if} - {foreach from=$item.goto_other item=item2 key=j} - {if $search eq ""} - {$item2} - {else} - {$item2|replace:$search:"$search"} - {/if} -
- {/foreach}
{$item.name} - {if $item.quota==0} - {$PALANG.pOverview_unlimited} - {elseif $item.quota<0} - {$PALANG.pOverview_disabled} - {else} - {if $boolconf_used_quotas} - {assign var="quota_level" value="low"} - {if $divide_quota.percent[$i] > $CONF.quota_level_high_pct} - {assign var="quota_level" value="high"} - {elseif $divide_quota.percent[$i] > $CONF.quota_level_med_pct} - {assign var="quota_level" value="mid"} + {if $display_mailbox_aliases==true} + + {if $item.goto_mailbox == 1} + {$PALANG.To_Mailbox} +
+ {else} + {$PALANG.To_Forward_Only} +
+ {/if} + {foreach from=$item.goto_other item=item2 key=j} + {if $search eq ""} + {$item2} + {else} + {$item2|replace:$search:"$search"} {/if} -
-
-
{$divide_quota.current[$i]} - / {$divide_quota.quota[$i]}
+
+ {/foreach} +
{$item.name} + {if $item.quota==0} + {$PALANG.pOverview_unlimited} + {elseif $item.quota<0} + {$PALANG.pOverview_disabled} {else} - {$divide_quota.quota[$i]} + {if $boolconf_used_quotas} + {assign var="quota_level" value="low"} + {if $divide_quota.percent[$i] > $CONF.quota_level_high_pct} + {assign var="quota_level" value="high"} + {elseif $divide_quota.percent[$i] > $CONF.quota_level_med_pct} + {assign var="quota_level" value="mid"} + {/if} +
+
+
{$divide_quota.current[$i]} + / {$divide_quota.quota[$i]}
+ {else} + {$divide_quota.quota[$i]} + {/if} {/if} - {/if} -
{$item.modified}{if $item.active==1} - - {$PALANG.YES}{else} - - {$PALANG.NO}{/if}{if $item.smtp_active==1} + {$item.modified}{if $item.active==1} {$PALANG.YES}{else} {$PALANG.NO}{/if}{$v_active}{if $item.smtp_active==1} + + {$PALANG.YES}{else} + + {$PALANG.NO}{/if}  {$PALANG.alias} {$PALANG.edit} -
- - - {CSRF_Token} - -
-
+ {if $CONF.vacation_control_admin===YES && $CONF.vacation===YES} + {if $item.v_active!==-1} + {if $item.v_active==1} + {assign var="v_active" value=$PALANG.pOverview_vacation_edit} + {else} + {assign var="v_active" value=$PALANG.pOverview_vacation_option} + {/if} +
{$v_active}  {$PALANG.alias} {$PALANG.edit} +
+ + + {CSRF_Token} + +
+
+
diff --git a/templates/list.tpl b/templates/list.tpl index b22a4704..acb03a66 100644 --- a/templates/list.tpl +++ b/templates/list.tpl @@ -1,4 +1,4 @@ -
+
{if ($admin_list|count > 1)}
@@ -27,154 +27,148 @@ {/if} {/if} - - - - {if $msg.list_header} - {assign var="colcount" value=2} - {foreach key=key item=field from=$struct} - {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} - {assign var="colcount" value=$colcount+1} - {/if} - {/foreach} - - - - {/if} + {if $msg.list_header} +
+ {$PALANG.{$msg.list_header}} +
+ {/if} - - {foreach key=key item=field from=$struct} - {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} - - {/if} - {/foreach} - - - - - - {foreach key=raw_itemkey from=$RAW_items item=RAW_item} - {assign var="itemkey" value=$raw_itemkey|htmlentities_no_double_encode} {* array keys in $items are escaped by PFASmarty::sanitise() *} - {assign var="item" value=$items[$itemkey]} +
+
{$PALANG.{$msg.list_header}}
{$field.label}  
+ + - {foreach key=key item=field from=$struct} - {if $field.display_in_list == 1 && $field.label} - - {if $field.linkto != '' && ($item.$id_field != '' || $item.$id_field > 0) } - {assign "linkto" "{$field.linkto|replace:'%s':{$item.$id_field|escape:url}}"} {* TODO: use label field instead *} - {assign "linktext" "{$item.{$key}}"} - {else} - {assign "linktext" $item.$key} - {/if} - - {if $table == 'foo' && $key == 'bar'} - - {else} - - {/if} + {if $field.display_in_list == 1 && $field.label}{* don't show fields without a label *} + {/if} {/foreach} - - - + + - {/foreach} - -
Special handling (complete table row) for {$table} / {$key} - {if $table == 'foo' && $key == 'bar'} - Special handling (td content) for {$table} / {$key} - {elseif $table == 'aliasdomain' && $key == 'target_domain' && $struct.target_domain.linkto == 'target'} - {$item.target_domain} - {* do we need escape:url or escpae:quotes here? see #705 *} - {* {elseif $table == 'domain' && $key == 'domain'} - {$item.domain} - *} - {elseif $key == 'active'} - {if $item._can_edit} - - {if $item._active == $PALANG['YES']} - - {else} - - {/if} - {$item._active} - - {else} - {$item._active} - {/if} - {elseif $field.type == 'bool'} - {assign "tmpkey" "_{$key}"}{$item.{$tmpkey}} - {elseif $field.type == 'list'} - {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} - {elseif $field.type == 'pass'} - (hidden) - {elseif $field.type == 'quot'} - {assign "tmpkey" "_{$key}_percent"} - - {if $item[$tmpkey] > $CONF.quota_level_high_pct} - {assign var="quota_level" value="high"} - {elseif $item[$tmpkey] > $CONF.quota_level_med_pct} - {assign var="quota_level" value="mid"} - {else} - {assign var="quota_level" value="low"} - {/if} - {if $item[$tmpkey] > -1} -
-
-
{$linktext}
- {else} -
-
{$linktext}
- {/if} - - {elseif $field.type == 'txtl'} - {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} - {elseif $field.type == 'html'} - {$RAW_item.$key} - {else} - {$linktext} - {/if} -
{$field.label}{if $item._can_edit} - {$PALANG.edit} - {else}  - {/if} - {if $item._can_delete} -
- - - {CSRF_Token} - - -
- {else} {/if} -
  
+ + + {foreach key=raw_itemkey from=$RAW_items item=RAW_item} + {assign var="itemkey" value=$raw_itemkey|htmlentities_no_double_encode} {* array keys in $items are escaped by PFASmarty::sanitise() *} + {assign var="item" value=$items[$itemkey]} + + + {foreach key=key item=field from=$struct} + {if $field.display_in_list == 1 && $field.label} + + {if $field.linkto != '' && ($item.$id_field != '' || $item.$id_field > 0) } + {assign "linkto" "{$field.linkto|replace:'%s':{$item.$id_field|escape:url}}"} {* TODO: use label field instead *} + {assign "linktext" "{$item.{$key}}"} + {else} + {assign "linktext" $item.$key} + {/if} + + {if $table == 'foo' && $key == 'bar'} + Special handling (complete table row) for {$table} / {$key} + {else} + + {if $table == 'foo' && $key == 'bar'} + Special handling (td content) for {$table} / {$key} + {elseif $table == 'aliasdomain' && $key == 'target_domain' && $struct.target_domain.linkto == 'target'} + {$item.target_domain} + {* do we need escape:url or escpae:quotes here? see #705 *} + {* {elseif $table == 'domain' && $key == 'domain'} + {$item.domain} + *} + {elseif $key == 'active'} + {if $item._can_edit} + + {if $item._active == $PALANG['YES']} + + {else} + + {/if} + {$item._active} + + {else} + {$item._active} + {/if} + {elseif $field.type == 'bool'} + {assign "tmpkey" "_{$key}"}{$item.{$tmpkey}} + {elseif $field.type == 'list'} + {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} + {elseif $field.type == 'pass'} + (hidden) + {elseif $field.type == 'quot'} + {assign "tmpkey" "_{$key}_percent"} + + {if $item[$tmpkey] > $CONF.quota_level_high_pct} + {assign var="quota_level" value="high"} + {elseif $item[$tmpkey] > $CONF.quota_level_med_pct} + {assign var="quota_level" value="mid"} + {else} + {assign var="quota_level" value="low"} + {/if} + {if $item[$tmpkey] > -1} +
+
+
{$linktext}
+ {else} +
+
{$linktext}
+ {/if} + + {elseif $field.type == 'txtl'} + {foreach key=key2 item=field2 from=$item.$key}{$field2}
{/foreach} + {elseif $field.type == 'html'} + {$RAW_item.$key} + {else} + {$linktext} + {/if} + + {/if} + {/if} + {/foreach} + + {if $item._can_edit} + {$PALANG.edit} + {else}  + {/if} + + {if $item._can_delete} +
+ + + {CSRF_Token} + + +
+ {else} {/if} + + + {/foreach} + + +
diff --git a/templates/login.tpl b/templates/login.tpl index 6246e158..8c1eb2dc 100644 --- a/templates/login.tpl +++ b/templates/login.tpl @@ -1,13 +1,3 @@ - -

{if $logintype=='admin'}{$PALANG.pLogin_welcome}{else}{$PALANG.pUsersLogin_welcome}{/if}

diff --git a/templates/menu.tpl b/templates/menu.tpl index b875405e..162d0758 100644 --- a/templates/menu.tpl +++ b/templates/menu.tpl @@ -6,238 +6,231 @@ {assign var="url_domain" value="&domain={$url_domain|escape:url}"} {/if} {/strip} - +
  • {$PALANG.pMenu_totp_exceptions} +
  • + {if $CONF.app_passwords==='YES'} +
  • {$PALANG.pMenu_app_passwords} +
  • + {/if} + + + {/strip} + {else} + {* password *} +
  • + + {$PALANG.pMenu_password}
  • + {/if} + {* update check *} + {if $authentication_has_role.global_admin} +
  • + + {$PALANG.pUpdate_title}
  • + {/if} + {* backup *} + {if $authentication_has_role.global_admin && $CONF.database_type!=='pgsql' && $CONF.backup === 'YES'} +
  • + + {$PALANG.pAdminMenu_backup}
  • + {/if} + {* viewlog *} + {if $CONF.logging==='YES'} +
  • + + {$PALANG.pMenu_viewlog}
  • + {/if} + {* logout *} +
  • + + {$PALANG.pMenu_logout}
  • + +
    + diff --git a/templates/password-change.tpl b/templates/password-change.tpl index b798dceb..cc47ba05 100644 --- a/templates/password-change.tpl +++ b/templates/password-change.tpl @@ -1,13 +1,3 @@ - -

    {$PALANG.pPassword_welcome}

    diff --git a/templates/password-recover.tpl b/templates/password-recover.tpl index 7d538d70..8acd83fd 100644 --- a/templates/password-recover.tpl +++ b/templates/password-recover.tpl @@ -1,13 +1,3 @@ - -

    {$PALANG.pPassword_recovery_title}