Jelajahi Sumber

Ticket #3467 - Updated Avatar block.

AntonLV 5 tahun lalu
induk
melakukan
48c8727535

+ 3 - 0
template/css/account.css

@@ -27,6 +27,9 @@
     -webkit-flex: 0 2 auto;
     flex: 0 2 auto;
 }
+.sys-profile-switch-row-control .sys-icon {
+    font-size: 1.5rem;
+}
 .sys-profile-switch-row-control .bx-btn {
     float: none;
 }

+ 9 - 5
template/css/general.css

@@ -321,13 +321,17 @@ div.bx-account-unit-online {
     text-overflow: ellipsis;
 }
 
-#bx-profile-switcher .bx-popup-content {
-    padding-top: 0.5rem;
-    padding-bottom: 0.5rem;
-}
-#bx-profile-switcher .bx-def-hr {
+.bx-profile-avatar-switcher .bx-def-hr {
     display: none;
 }
+.bx-profile-avatar-switcher .sys-profile-switch-row {
+    padding-left: 0px;
+    padding-right: 0px;
+}
+.bx-profile-avatar-switcher .bx-pas-list-link .bx-btn {
+    float: none;
+    display: inline-block;
+}
 
 
 /* --------------- Profile Stats */

+ 12 - 12
template/profile_avatar.html

@@ -1,19 +1,19 @@
 <div class="bx-profile-avatar bx-def-border-radius-block">
-    <div class="bx-profile-avatar-cnt">
-        <div class="bx-pa-img">__profile_unit__</div>
-        <div class="bx-pa-info">
-            <div class="bx-pa-info-cnt bx-def-padding-left bx-def-box-sizing">
-                <div class="bx-pai-line bx-def-font-h2"><a href="__profile_url__" title="__profile_title_attr__">__profile_title__</a></div>
-                <div class="bx-pai-line bx-def-margin-thd-top">
-                    <div><i class="sys-icon __profile_acl_icon__"></i><span class="bx-def-padding-sec-left">__profile_acl_title__</span></div>
+    <a href="javascript:void(0)" onclick="javascript:$('#bx-profile-switcher').dolPopup({});">
+        <div class="bx-profile-avatar-cnt">
+            <div class="bx-pa-img">__profile_unit__</div>
+            <div class="bx-pa-info">
+                <div class="bx-pa-info-cnt bx-def-padding-left bx-def-box-sizing">
+                    <div class="bx-pai-line bx-def-font-h2">__profile_title__</div>
+                    <div class="bx-pai-line bx-def-margin-thd-top">
+                        <div><i class="sys-icon __profile_acl_icon__"></i><span class="bx-def-padding-sec-left">__profile_acl_title__</span></div>
+                    </div>
                 </div>
             </div>
-        </div>
-        <div class="bx-pa-actions">
-            <div class="bx-pa-action bx-def-margin-sec-left">
-                <a href="javascript:void(0)" onclick="javascript:$('#bx-profile-switcher').dolPopup({pointer: {el:$(this)}});"><i class="sys-icon arrows-alt-v"></i></a>
+            <div class="bx-pa-actions">
+                <div class="bx-pa-action bx-def-margin-sec-left"><i class="sys-icon arrows-alt-v"></i></div>
             </div>
         </div>
-    </div>
+    </a>
 </div>
 __profile_switcher__

+ 12 - 0
template/profile_avatar_switcher.html

@@ -0,0 +1,12 @@
+<div class="bx-profile-avatar-switcher bx-popup-width">
+    <div class="bx-pas-cnt bx-def-padding-leftright bx-def-padding-sec-topbottom">
+        <div class="bx-pas-list">__profile_switcher__</div>
+        <bx_if:multiple_profiles_mode>
+            <div class="bx-pas-list-link bx-def-padding-top bx-def-padding-sec-bottom bx-def-font-align-center">
+                <a class="bx-btn" href="__url_switch_profile__">
+                    <i class="sys-icon plus"></i><span class="bx-def-padding-sec-left"><bx_text:_sys_txt_my_profiles /></span>
+                </a>
+            </div>
+        </bx_if:multiple_profiles_mode>
+    </div>
+</div>

+ 3 - 0
template/profile_switch_row.html

@@ -3,6 +3,9 @@
     <div class="sys-profile-switch-row bx-def-padding-leftright bx-def-padding-sec-topbottom">
         <div class="sys-profile-switch-row-unit">__unit__</div>
         <div class="sys-profile-switch-row-control bx-def-margin-left">
+            <bx_if:active>
+                <i class="sys-icon check-circle"></i>
+            </bx_if:active>
             <bx_if:inactive>
                 <a class="bx-btn bx-btn-small" href="__url_switch__">__button_title__</i></a>
             </bx_if:inactive>

+ 18 - 6
template/scripts/BxBaseServiceProfiles.php

@@ -50,18 +50,30 @@ class BxBaseServiceProfiles extends BxDol
         $aAcl = $oAcl->getMemberMembershipInfo($iProfileId);
         $aAclInfo = $oAcl->getMembershipInfo($aAcl['id']);
 
-        $aSwitcher = bx_srv('system', 'account_profile_switcher', array(), 'TemplServiceProfiles');
-        $sSwitcher = $aSwitcher !== false ? BxTemplFunctions::getInstance()->transBox('bx-profile-switcher', $aSwitcher['content'], true) : '';
+        $oTemplate = BxDolTemplate::getInstance();
+
+        $aSwitcher = bx_srv('system', 'account_profile_switcher', array(false, null, '', true), 'TemplServiceProfiles');
+        $sSwitcher = $aSwitcher !== false ? BxTemplFunctions::getInstance()->transBox('bx-profile-switcher', $oTemplate->parseHtmlByName('profile_avatar_switcher.html', array(
+            'profile_switcher' => $aSwitcher['content'],
+            'bx_if:multiple_profiles_mode' => array(
+                'condition' => (int)getParam('sys_account_limit_profiles_number') != 1,
+                'content' => array(
+                    'url_switch_profile' => BxDolPermalinks::getInstance()->permalink('page.php?i=account-profile-switcher')
+                )
+            )
+        )), true) : '';
+
+        $sDisplayName = $oProfile->getDisplayName();
 
         $aVars = array(
             'profile_id' => $oProfile->id(),
             'profile_url' => $oProfile->getUrl(),
             'profile_edit_url' => $oProfile->getEditUrl(),
-            'profile_title' => $oProfile->getDisplayName(),
-            'profile_title_attr' => bx_html_attribute($oProfile->getDisplayName()),
+            'profile_title' => $sDisplayName,
+            'profile_title_attr' => bx_html_attribute($sDisplayName),
             'profile_ava_url' => $oProfile->getAvatar(),
             'profile_unit' => $oProfile->getUnit(0, array('template' => array(
-                'name' => 'unit_wo_info',
+                'name' => 'unit_wo_info_links',
                 'size' => 'ava'
             ))),
             'profile_acl_title' => _t($aAclInfo['name']),
@@ -69,7 +81,7 @@ class BxBaseServiceProfiles extends BxDol
             'profile_switcher' => $sSwitcher
         );
 
-        return BxDolTemplate::getInstance()->parseHtmlByName('profile_avatar.html', $aVars);
+        return $oTemplate->parseHtmlByName('profile_avatar.html', $aVars);
     }
 
     public function serviceProfileMenu ($iProfileId = 0)