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

#1560 Different avatars for members without avatars in Convos module

Alex Trofimov 8 лет назад
Родитель
Сommit
294a131c97

+ 4 - 15
modules/boonex/convos/classes/BxCnvTemplate.php

@@ -59,36 +59,25 @@ class BxCnvTemplate extends BxBaseModTextTemplate
         );
         $i = 0;
         foreach ($aCollaborators as $iProfileId => $iReadComments) {
-            $oProfile = BxDolProfile::getInstance($iProfileId);
-            if (!$oProfile)
-                continue;
-
-            $sInfo = '';
-            if ($aContentInfo[$CNF['FIELD_AUTHOR']] == $iProfileId)
-                $sInfo = _t('_bx_cnv_collaborator_author');
-            if ($aContentInfo['last_reply_profile_id'] == $iProfileId)
-                $sInfo .= ', ' . _t('_bx_cnv_collaborator_last_replier');
-            $sInfo = trim($sInfo, ', ');
-            $sInfo = $sInfo ? _t('_bx_cnv_collaborator_info', $oProfile->getDisplayName(), $sInfo) : $oProfile->getDisplayName();
+            $oProfile = BxDolProfile::getInstanceMagic($iProfileId);
 
             $aCollaborator = array (
                 'id' => $oProfile->id(),
-                'url' => $oProfile->getUrl(),
-                'thumb_url' => $oProfile->getThumb(),
-                'title' => $oProfile->getDisplayName(),
-                'title_attr' =>  bx_html_attribute($sInfo),
+                'unit' => $oProfile->getUnit(0, array('template' => 'unit_wo_info')),
                 'float' => $sFloat,
                 'class' => $aContentInfo[$CNF['FIELD_AUTHOR']] == $iProfileId ? 'bx-cnv-collaborator-author' : '',
                 'bx_if:last_replier' => array (
                     'condition' => ($aContentInfo['last_reply_profile_id'] == $iProfileId),
                     'content' => array (
                         'id' => $oProfile->id(),
+                        'title' => bx_html_attribute(_t('_bx_cnv_collaborator_last_replier')),
                     ),
                 ),
                 'bx_if:author'  => array (
                     'condition' => $aContentInfo[$CNF['FIELD_AUTHOR']] == $iProfileId,
                     'content' => array (
                         'id' => $oProfile->id(),
+                        'title' => bx_html_attribute(_t('_bx_cnv_collaborator_author')),
                     ),
                 ),
             );

+ 0 - 1
modules/boonex/convos/install/langs/en.xml

@@ -102,7 +102,6 @@
     <string name="_bx_cnv_grid_action_delete"><![CDATA[Delete]]></string>
     <string name="_bx_cnv_grid_action_compose"><![CDATA[New conversation]]></string>
 
-    <string name="_bx_cnv_collaborator_info"><![CDATA[{0} ({1})]]></string>
     <string name="_bx_cnv_collaborator_author"><![CDATA[author]]></string>
     <string name="_bx_cnv_collaborator_last_replier"><![CDATA[last replier]]></string>
     <string name="_bx_cnv_more"><![CDATA[{0} more]]></string>

+ 5 - 5
modules/boonex/convos/template/collaborators.html

@@ -1,17 +1,17 @@
 <div class="bx-cnv-collaborators bx-def-margin-sec-right bx-clearfix" style="float:__float__;">
 
     <bx_repeat:collaborators>
-        <div class="bx-cnv-collaborator bx-def-unit bx-def-margin-sec-__float__-auto __class__">
-            <a href="__url__" title="__title_attr__"><img class="bx-def-thumb bx-def-thumb-size" src="__thumb_url__" /></a>
+        <div class="bx-cnv-collaborator bx-def-margin-sec-__float__-auto __class__">
+            __unit__
             <bx_if:last_replier>
-                <div class="bx-def-unit-alert bg-col-blue2-dark" style="left:0; right:auto;"><i class="sys-icon comments bx-def-font-contrasted"></i></div>
+                <div title="__title__" class="bx-cnv-collaborator-last-replier bx-def-unit-alert bg-col-blue2-dark"><i class="sys-icon comments bx-def-font-contrasted"></i></div>
             </bx_if:last_replier>
             <bx_if:author>
-                <div class="bx-def-unit-alert bg-col-blue2-dark"><i class="sys-icon user bx-def-font-contrasted"></i></div>
+                <div title="__title__" class="bx-cnv-collaborator-author bx-def-unit-alert bg-col-blue2-dark"><i class="sys-icon user bx-def-font-contrasted"></i></div>
             </bx_if:author>
         </div>
     </bx_repeat:collaborators>
-   
+
     <bx_if:collaborators_more>
         <div class="bx-cnv-collaborator bx-def-unit bx-def-thumb-size bx-def-margin-sec-__float__-auto">
             <a href="javascript:void(0);" onclick="$('#__id__').dolPopup({pointer:{el:$(this)}})">__title_more__</a>            

+ 11 - 5
modules/boonex/convos/template/css/main.css

@@ -4,12 +4,18 @@
 .bx-cnv-collaborators {
     white-space:nowrap;
 }
-.bx-popup-content .bx-cnv-collaborators {
-    margin-right:0px;
-}
 .bx-cnv-collaborator {
-	display:inline;
-    display:inline-block;
+	position:relative;
+    display:block;
+}
+.bx-cnv-collaborator.bx-def-margin-sec-left-auto {
+    float:left;
+}
+.bx-cnv-collaborator.bx-def-margin-sec-right-auto {
+    float:right;
+}
+.bx-cnv-collaborator-last-replier {
+    left:0; right:auto;
 }
 
 .bx-grid-table .bx-cnv-collaborator,

+ 0 - 1
modules/boonex/russian/data/langs/bx_convos/ru.xml

@@ -102,7 +102,6 @@
     <string name="_bx_cnv_grid_action_delete"><![CDATA[Удалить]]></string>
     <string name="_bx_cnv_grid_action_compose"><![CDATA[Новое сообщение]]></string>
 
-    <string name="_bx_cnv_collaborator_info"><![CDATA[{0} ({1})]]></string>
     <string name="_bx_cnv_collaborator_author"><![CDATA[автор]]></string>
     <string name="_bx_cnv_collaborator_last_replier"><![CDATA[последний ответивший]]></string>
     <string name="_bx_cnv_more"><![CDATA[{0} ещё]]></string>