Skip to content

Commit

Permalink
Ticket #3694 - Minor fixes: Participants section in Convos.
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonLV committed Mar 18, 2022
1 parent 3c6da16 commit ac4a115
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 39 deletions.
31 changes: 12 additions & 19 deletions modules/boonex/convos/classes/BxCnvGrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ class BxCnvGrid extends BxBaseModGeneralGridAdministration
{
protected $MODULE;
protected $_sFilter1Name;
protected $_sFilter1Value;
protected $_aFilter1Values;
protected $_sFilter1Value;
protected $_aFilter1Values;

public function __construct ($aOptions, $oTemplate = false)
{
Expand Down Expand Up @@ -93,8 +93,7 @@ protected function _getFilterSelectOne($sFilterName, $sFilterValue, $aFilterValu

public function performActionCompose()
{
$oModule = BxDolModule::getInstance($this->MODULE);
$CNF = &$oModule->_oConfig->CNF;
$CNF = &$this->_oModule->_oConfig->CNF;

$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);

Expand All @@ -103,8 +102,7 @@ public function performActionCompose()

protected function _getActionAdd ($sType, $sKey, $a, $isSmall = false, $isDisabled = false, $aRow = array())
{
$oModule = BxDolModule::getInstance($this->MODULE);
$CNF = &$oModule->_oConfig->CNF;
$CNF = &$this->_oModule->_oConfig->CNF;

$sUrl = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $CNF['URI_ADD_ENTRY']);

Expand All @@ -127,30 +125,25 @@ protected function _getCellPreview ($mixedValue, $sKey, $aField, $aRow)

protected function _getCellLastReplyTimestamp ($mixedValue, $sKey, $aField, $aRow)
{
$oModule = BxDolModule::getInstance($this->MODULE);
$s = $oModule->_oTemplate->entryMessagePreviewInGrid ($aRow);
$s = $this->_oModule->_oTemplate->entryMessagePreviewInGrid ($aRow);
return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
}

protected function _getCellCollaborators ($mixedValue, $sKey, $aField, $aRow)
{
$oModule = BxDolModule::getInstance($this->MODULE);
$s = $oModule->_oTemplate->entryCollaborators ($aRow);
$s = $this->_oModule->_oTemplate->entryCollaborators ($aRow);
return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
}

protected function _getCellComments ($mixedValue, $sKey, $aField, $aRow)
{
$oModule = BxDolModule::getInstance($this->MODULE);
$s = $oModule->_oTemplate->getMessageLabel ($aRow);
return parent::_getCellDefault ('<div class="bx-cnv-grid-field-messages"><span>' . (1 + $mixedValue) . '</span>' . $s . '</div>', $sKey, $aField, $aRow);
$s = $this->_oModule->_oTemplate->getMessageLabel(1 + $mixedValue, $aRow);
return parent::_getCellDefault ($s, $sKey, $aField, $aRow);
}

protected function _doDelete ($iId, $aParams = array())
{
$oModule = BxDolModule::getInstance($this->MODULE);

if ($sErrorMsg = $oModule->deleteConvo ($iId))
if ($sErrorMsg = $this->_oModule->deleteConvo ($iId))
return 0;

return 1;
Expand All @@ -159,9 +152,9 @@ protected function _doDelete ($iId, $aParams = array())
protected function _addJsCss()
{
parent::_addJsCss();
$oModule = BxDolModule::getInstance($this->MODULE);
$oModule->_oTemplate->addJs('main.js');
$oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));

$this->_oModule->_oTemplate->addJs('main.js');
$this->_oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));
}
}

Expand Down
9 changes: 4 additions & 5 deletions modules/boonex/convos/classes/BxCnvTemplate.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function getAuthorDesc ($aData, $oProfile)
return _t('_bx_cnv_author_desc', bx_time_js($aData[$oModule->_oConfig->CNF['FIELD_ADDED']], BX_FORMAT_DATE), bx_time_js($aData['last_reply_timestamp'], BX_FORMAT_DATE));
}

function getMessageLabel ($r, $oProfileLast = null)
function getMessageLabel ($iCount, $r, $oProfileLast = null)
{
$oModule = BxDolModule::getInstance($this->MODULE);

Expand All @@ -132,7 +132,8 @@ function getMessageLabel ($r, $oProfileLast = null)
if (!isset($r['unread_messages']))
$r['unread_messages'] = $r['comments'] - $r['read_comments'];

$aVars = array (
return $this->parseHtmlByName('message_label.html', array (
'count' => $iCount,
'bx_if:unread_messages' => array (
'condition' => $r['unread_messages'] > 0,
'content' => array (
Expand All @@ -147,9 +148,7 @@ function getMessageLabel ($r, $oProfileLast = null)
'condition' => $bReadByAll,
'content' => array (),
),
);

return $this->parseHtmlByName('message_label.html', $aVars);
));
}

function getMessagesPreviews ($a)
Expand Down
4 changes: 2 additions & 2 deletions modules/boonex/convos/template/collaborators.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
<div class="bx-cnv-collaborator bx-def-margin-sec-__float__-auto __class__">
__unit__
<bx_if:last_replier>
<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>
<div title="__title__" class="bx-cnv-collaborator-last-replier bx-def-unit-alert p-0 bg-col-blue2-dark"><i class="sys-icon comments bx-def-font-contrasted"></i></div>
</bx_if:last_replier>
<bx_if:author>
<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>
<div title="__title__" class="bx-cnv-collaborator-author bx-def-unit-alert p-0 bg-col-blue2-dark"><i class="sys-icon user bx-def-font-contrasted"></i></div>
</bx_if:author>
</div>
</bx_repeat:collaborators>
Expand Down
10 changes: 6 additions & 4 deletions modules/boonex/convos/template/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
.bx-cnv-collaborator.bx-def-margin-sec-right-auto {
float:right;
}
.bx-cnv-collaborator-last-replier {
left:0; right:auto;
.bx-cnv-collaborator .bx-cnv-collaborator-last-replier {
left: -2px;
right: auto;
}

.bx-grid-table .bx-cnv-collaborator,
Expand All @@ -36,8 +37,9 @@
overflow:hidden;
}

.bx-cnv-grid-field-label {
display:inline-block;
.bx-cnv-grid-field-messages .bx-cnv-grid-field-label {
position: relative;
display: inline-block;
}

.bx-cnv-preview .bx-cnv-grid-field-label {
Expand Down
16 changes: 12 additions & 4 deletions modules/boonex/convos/template/message_label.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@

<bx_if:unread_messages><div class="bx-cnv-grid-field-label bx-def-margin-thd-left bx-def-unit-alert-middle bg-col-blue2-dark">__unread_messages__</div></bx_if:unread_messages>
<bx_if:viewer_is_last_replier><div class="bx-cnv-grid-field-label bx-def-margin-thd-left"><i title="<bx_text_attribute:_bx_cnv_you_are_last_replier />" class="sys-icon reply bx-def-font-grayed"></i></div></bx_if:viewer_is_last_replier>
<bx_if:is_read_by_all><div class="bx-cnv-grid-field-label bx-def-margin-thd-left"><i title="<bx_text_attribute:_bx_cnv_read_by_all />" class="sys-icon check bx-def-font-grayed"></i></div></bx_if:is_read_by_all>
<div class="bx-cnv-grid-field-messages flex items-center">
<span>__count__</span>
<bx_if:unread_messages>
<div class="bx-cnv-grid-field-label bx-def-margin-thd-left bx-def-unit-alert p-0 bg-col-blue2-dark">__unread_messages__</div>
</bx_if:unread_messages>
<bx_if:viewer_is_last_replier>
<div class="bx-cnv-grid-field-label bx-def-margin-thd-left"><i title="<bx_text_attribute:_bx_cnv_you_are_last_replier />" class="sys-icon reply bx-def-font-grayed"></i></div>
</bx_if:viewer_is_last_replier>
<bx_if:is_read_by_all>
<div class="bx-cnv-grid-field-label bx-def-margin-thd-left"><i title="<bx_text_attribute:_bx_cnv_read_by_all />" class="sys-icon check bx-def-font-grayed"></i></div>
</bx_if:is_read_by_all>
</div>
2 changes: 1 addition & 1 deletion plugins_public/tailwind/css/tailwind.min.css

Large diffs are not rendered by default.

12 changes: 8 additions & 4 deletions plugins_public/tailwind/js/tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,17 @@ module.exports = {
'./modules/boonex/artificer/data/template/**/*.html',
'./modules/boonex/artificer/template/*.html',

// Convos
'./modules/boonex/convos/js/*.js',
'./modules/boonex/convos/template/*.html',

// Forum
'./modules/boonex/forum/js/*.js',
'./modules/boonex/forum/template/*.html',

// Messenger
'./modules/boonex/messenger/js/*.js',
'./modules/boonex/messenger/template/*.html',

// Forum
'./modules/boonex/forum/js/*.js',
'./modules/boonex/forum/template/*.html',

'./template/*.html',
],
Expand Down

0 comments on commit ac4a115

Please sign in to comment.