Просмотр исходного кода

Ticket #2749 - Show badges in profile unit on friends page.

AntonLV 6 лет назад
Родитель
Сommit
012a1b9b1d
2 измененных файлов с 13 добавлено и 1 удалено
  1. 2 1
      inc/classes/BxDolGridConnections.php
  2. 11 0
      modules/base/profile/template/css/main.css

+ 2 - 1
inc/classes/BxDolGridConnections.php

@@ -103,7 +103,8 @@ class BxDolGridConnections extends BxTemplGrid
         if (!$oProfile)
             return _t('_sys_txt_error_occured');
 
-        return parent::_getCellDefault ($oProfile->getUnit(), $sKey, $aField, $aRow);
+        $sBadges = bx_srv($oProfile->getModule(), 'get_badges', array($oProfile->getContentId()));
+        return parent::_getCellDefault($oProfile->getUnit(0, array('template' => array('vars' => array('addon' => $sBadges)))), $sKey, $aField, $aRow);
     }
 
     protected function _getCellInfo ($mixedValue, $sKey, $aField, $aRow)

+ 11 - 0
modules/base/profile/template/css/main.css

@@ -32,6 +32,17 @@
     box-shadow: inset 0px 0px 4px rgba(0, 0, 0, 0.2);
 }
 
+/* Badges in unit */
+.bx-base-pofile-unit div.bx-badges-list {
+    -webkit-justify-content: flex-start;
+    justify-content: flex-start;
+
+    padding-top: 0.25rem;
+}
+.bx-base-pofile-unit div.bx-badges-list div.bx-badge:first-child {
+    margin-left: 0;
+}
+
 /* browse unit with cover */
 .bx-base-pofile-unit-cover {
     height: 10.0rem;