RomanL 4 лет назад
Родитель
Сommit
61bed5ec97

+ 4 - 1
modules/base/general/template/css/main.css

@@ -304,14 +304,17 @@ div.bx-badge span{
 	text-overflow: ellipsis; 
     overflow: hidden;
 }
+div.bx-badge:not(.bx-badge-compact-to) .sys-icon{
+    margin-right: 0.5rem;
+}
 div.bx-badge:not(.bx-badge-compact-to) .sys-icon,
 div.bx-badge:not(.bx-badge-compact-to) span{
 	color: inherit !important;
-	margin-right: 0.5rem;
 }
 div.bx-badge.bx-badge-compact{
 	width: 1.25rem;
 	text-align: center;
+    padding: 0px;
 }
 div.bx-badge.bx-badge-compact-to{
 	padding: 0;

+ 5 - 6
modules/boonex/artificer/data/template/bx_forum/entry-preview.html

@@ -1,15 +1,14 @@
 <div class="bx-forum-grid-preview">
-    <div class="bx-forum-gp-meta bx-forum-gpm-top text-xs">
-        <bx_if:meta_main><div class="bx-base-general-unit-meta bx-forum-gpm-main">__content__</div></bx_if:meta_main>
-        <bx_if:meta_counters><div class="bx-base-general-unit-meta bx-forum-gpm-counters bx-def-media-phone-hide">__content__</div></bx_if:meta_counters>
-    </div>
     <div class="bx-forum-gp-title text-base">
     	<bx_if:show_stick><i class="sys-icon thumbtack" title="<bx_text_attribute:_bx_forum_txt_entry_sticked />"></i></bx_if:show_stick>
     	<bx_if:show_lock><i class="sys-icon lock" title="<bx_text_attribute:_bx_forum_txt_entry_locked />"></i></bx_if:show_lock>
-    	<a class="text-lg lg:text-xl font-semibold text-gray-700 dark:text-gray-200 hover:text-gray-900 dark:hover:text-white" href="__url__">__title__</a> __badges__
+    	<a class="text-lg lg:text-xl font-semibold text-gray-700 dark:text-gray-200 hover:text-gray-900 dark:hover:text-white" href="__url__">__title__</a>
     </div>
-    <div class="bx-forum-gp-text text-sm pt-1">__text__</div>
     <div class="bx-forum-gp-meta bx-forum-gpm-bottom text-xs">
         <bx_if:meta_reply><div class="bx-base-general-unit-meta bx-forum-gpm-reply">__content__</div></bx_if:meta_reply>
     </div>
+    <div class="bx-forum-gp-meta bx-forum-gpm-top text-xs">
+        <bx_if:meta_main><div class="bx-base-general-unit-meta bx-forum-gpm-main ">__content__</div></bx_if:meta_main>
+        <bx_if:meta_counters><div class="bx-base-general-unit-meta bx-forum-gpm-counters bx-def-media-phone-hide">__content__</div></bx_if:meta_counters>
+    </div>
 </div>

+ 6 - 0
modules/boonex/artificer/data/template/bx_forum/menu_custom_hor_bx_forum_snippet_meta_main.html

@@ -0,0 +1,6 @@
+<ul id="__html_id__" class="bx-menu-custom bx-menu-custom-hor bx-menu-hor-inline<bx_if:show_more_auto_class> bx-menu-more-auto</bx_if:show_more_auto_class> bx-menu-object-__object__ flex justify-start items-center">
+    <bx_repeat:menu_items>
+        <li class="bx-menu-item bx-menu-item-__name____class__ flex">__item__</li>
+    </bx_repeat:menu_items>
+</ul>
+__js_code__

+ 24 - 0
modules/boonex/artificer/data/template/bx_forum/unit_gallery.html

@@ -0,0 +1,24 @@
+<div class="__class__ bx-base-text-unit bx-forum-unit bx-base-text-unit-gallery bx-def-gal-unit-size flex flex-col w-full p-2 box-border">
+    <div class="bx-base-text-unit-cnt rounded ring-1 ring-gray-200 dark:ring-gray-700 overflow-hidden bg-white dark:bg-gray-800">
+        <bx_if:thumb>
+            <a href="__content_url__" title="__summary_attr__">
+                <div class="flex-shrink-0 m-1">
+                    <img class="h-48 w-full object-cover rounded" src="__gallery_url__" alt="">
+                </div>
+            </a>
+        </bx_if:thumb>
+        <bx_if:no_thumb>
+            <div class="bx-def-gal-img-column flex-shrink-0">
+                <div class="bx-base-text-unit-no-thumb flex flex-col items-center justify-center h-48 p-4 bg-gradient-to-b box-border rounded-sm"></div>
+            </div>
+        </bx_if:no_thumb>
+        <div class="bx-base-text-unit-text p-3 md:p-4 lg:p-6 pt-2 md:pt-3 lg:pt-5 box-border">
+            <div class="bx-base-text-unit-info flex text-sm text-gray-500 dark:text-gray-400">
+                <bx_if:meta><div class="bx-base-general-unit-meta pb-2">__meta__</div></bx_if:meta>
+            </div>
+            <div class="bx-base-text-unit-title flex items-center text-left">
+                <a href="__content_url__" class="text-ellipsis whitespace-nowrap overflow-hidden text-base font-semibold text-gray-700 group-hover:text-gray-900 dark:text-gray-200 dark:group-hover:text-white">__title__</a>
+            </div>
+        </div>
+    </div>
+</div>

+ 27 - 26
modules/boonex/artificer/data/template/mod_general/css/main.css

@@ -19,59 +19,60 @@
 }
 
 
-/* badges */
+/* Badges */
 div.bx-badges-list {
     display: inline-flex;
     align-items: center;
     justify-content:center;
 }
 div.bx-badge {
-    display: flex;
+	display: flex;
     align-items:center;
-    text-align: center;
+	text-align: center;
     color:#fff;	
-    max-width: 9rem;
+	max-width: 9rem;
     min-width: 1.25rem;
-    vertical-align: middle;
-    height: 1.25rem;
-    line-height: 1.25rem;
-    padding: 0 0.5rem ;
-    border-radius: 2em;
-    white-space: nowrap; 
-    text-overflow: ellipsis; 
+	vertical-align: middle;
+	height: 1.25rem;
+	line-height: 1.25rem;
+	padding: 0 0.5rem ;
+	border-radius: 2em;
+	white-space: nowrap; 
+	text-overflow: ellipsis; 
     overflow: hidden;
 }
 div.bx-badges-list div.bx-badge{
     margin:0 0.25rem;
 }
 
-img.bx-badge-icon {
-    width: 14px;
-    height: 14px;
-}
-div.bx-badge img{
-
-    margin-right: 0.5rem;
+img.bx-badge-icon,
+svg.bx-badge-icon{
+    width: 16px !important;
+    height: 16px !important;
+    margin-right: 0.5rem !important;
 }
 div.bx-badge span{
-    text-overflow: ellipsis; 
+	text-overflow: ellipsis; 
     overflow: hidden;
 }
+div.bx-badge:not(.bx-badge-compact-to) .sys-icon{
+    margin-right: 0.5rem;
+}
 div.bx-badge:not(.bx-badge-compact-to) .sys-icon,
 div.bx-badge:not(.bx-badge-compact-to) span{
-    color: inherit !important;
-    margin-right: 0.5rem;
+	color: inherit !important;
 }
 div.bx-badge.bx-badge-compact{
-    width: 1.25rem;
-    text-align: center;
+	width: 1.25rem;
+	text-align: center;
+    padding: 0px;
 }
 div.bx-badge.bx-badge-compact-to{
-    padding: 0;
-    width: auto;
+	padding: 0;
+	width: auto;
 }
 div.bx-badge.bx-badge-compact .sys-icon{
-    width: 1.25rem;
+	width: 1.25rem;
 }
 div.bx-badge.bx-badge-compact .sys-icon,
 div.bx-badge.bx-badge-compact img{

+ 90 - 25
modules/boonex/forum/classes/BxForumGrid.php

@@ -19,6 +19,9 @@ define('BX_FORUM_FILTER_ORDER_NEW', 'new');
 define('BX_FORUM_FILTER_ORDER_TOP', 'top');
 define('BX_FORUM_FILTER_ORDER_UPDATED', 'updated');
 define('BX_FORUM_FILTER_ORDER_POPULAR', 'popular');
+define('BX_FORUM_FILTER_ORDER_FEATURED', 'featured');
+define('BX_FORUM_FILTER_ORDER_FAVORITE', 'favorite');
+define('BX_FORUM_FILTER_ORDER_PARTAKEN', 'partaken');
 
 class BxForumGrid extends BxTemplGrid
 {
@@ -81,6 +84,9 @@ class BxForumGrid extends BxTemplGrid
             BX_FORUM_FILTER_ORDER_TOP => _t('_bx_forum_grid_filter_order_top'),
             BX_FORUM_FILTER_ORDER_UPDATED => _t('_bx_forum_grid_filter_order_updated'),
             BX_FORUM_FILTER_ORDER_POPULAR => _t('_bx_forum_grid_filter_order_popular'),
+            BX_FORUM_FILTER_ORDER_FEATURED => _t('_bx_forum_grid_filter_order_featured'),
+            BX_FORUM_FILTER_ORDER_FAVORITE => _t('_bx_forum_grid_filter_order_favorite'),
+            BX_FORUM_FILTER_ORDER_PARTAKEN => _t('_bx_forum_grid_filter_order_partaken'),
         );
         
         $sFilter3 = bx_get($this->_sFilter3Name);
@@ -223,27 +229,6 @@ class BxForumGrid extends BxTemplGrid
 
         return self::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
     }
-    
-     protected function _getCellStatus($mixedValue, $sKey, $aField, $aRow)
-    {
-    	$CNF = &$this->_oModule->_oConfig->CNF;
-
-        $oObject = isset($CNF['OBJECT_COMMENTS']) ? BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], $aRow[$CNF['FIELD_ID']]) : null;
-        $sIcon = '';
-        if ($aRow['resolvable']){
-            if ($aRow['resolved']){
-                $sIcon .= 'completed';
-            }
-            else{
-                $sIcon .= 'uncompleted';
-            }   
-        }
-        else{
-            $sIcon .= 'idea'; 
-        }
-        $mixedValue = $this->_oModule->_oTemplate->parseHtmlByName('status.html', ['icon' => BX_DOL_URL_MODULES . $this->_oModule->_aModule['path'] .'template/images/'. $sIcon . '.svg', 'counter' => (int)$oObject->getCommentsCountAll()]); 
-        return self::_getCellDefault($mixedValue, $sKey, $aField, $aRow);
-    }
 
     protected function _getCellText($mixedValue, $sKey, $aField, $aRow)
     {
@@ -262,6 +247,90 @@ class BxForumGrid extends BxTemplGrid
 
     protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage)
     {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        
+        if(strpos($sFilter, $this->_sParamsDivider) !== false)
+            list($this->_sFilter1Value, $this->_sFilter2Value, $this->_sFilter3Value, $sFilter) = explode($this->_sParamsDivider, $sFilter);
+        
+
+        // featured
+        if ($this->_sFilter3Value == BX_FORUM_FILTER_ORDER_FEATURED){
+            $this->_aBrowseParams['where'] = ['fld' => 'featured', 'val' => 0, 'opr' => '<>'];
+        }
+        
+        // partaken
+        if ($this->_sFilter3Value == BX_FORUM_FILTER_ORDER_PARTAKEN){
+            $this->_aBrowseParams['select'] = array(
+                'tbla' => 'tco', 
+                'fld' => 'cmt_author_id',
+            );
+
+            $this->_aBrowseParams['join'] = array(
+                'tp' => 'INNER',
+                'tbl1' => 'bx_forum_cmts',
+                'tbl1a' => 'tco',
+                'fld1' => 'cmt_object_id',
+                'tbl2' => 'bx_forum_discussions',
+                'fld2' => 'id'
+            );
+
+            $this->_aBrowseParams['where'] = array(
+                'tbl' => 'tco', 
+                'fld' => 'cmt_author_id', 
+                'val' => bx_get_logged_profile_id(), 
+                'opr' => '='
+            );
+
+            $this->_aBrowseParams['group_by'] = array(
+                'tbl' => 'bx_forum_discussions', 
+                'fld' => 'id',
+            );
+        }
+        
+        //FAVORITE
+        if ($this->_sFilter3Value == BX_FORUM_FILTER_ORDER_FAVORITE){
+            $oProfile = BxDolProfile:: getInstance(bx_process_input(bx_get('profile_id'), BX_DATA_INT));
+            if(!$oProfile)
+                $oProfile = BxDolProfile::getInstance();
+            if(!$oProfile)
+                return '';
+            
+            $iProfileId = $oProfile->id();
+            $iProfileAuthor = $oProfile->id();
+            $oFavorite = $this->_oModule->getObjectFavorite();
+            if(!$oFavorite->isPublic() && $iProfileAuthor != bx_get_logged_profile_id())
+                return '';
+            
+            $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor);
+            if(empty($aConditions) || !is_array($aConditions)) 
+                return '';
+
+            $aJoinGroup = array('grp' => true, 'cnds' => array());
+            if(!empty($aConditions['join']))
+                foreach($aConditions['join'] as $aCondition)
+                    $aJoinGroup['cnds'][] = array(
+                        'tp' => $aCondition['type'],
+                        'tbl1' => $aCondition['table'],
+                        'fld1' => $aCondition['onField'],
+                        'tbl2' => $aCondition['mainTable'],
+                        'fld2' => $aCondition['mainField']
+                    );
+
+            $aWhereGroup = array('grp' => true, 'opr' => 'AND', 'cnds' => array());
+            if(!empty($aConditions['restriction']))
+                foreach($aConditions['restriction'] as $aCondition)
+                    $aWhereGroup['cnds'][] = array(
+                        'tbl' => (!empty($aCondition['table']) ? $aCondition['table'] : ''), 
+                        'fld' => $aCondition['field'], 
+                        'val' => $aCondition['value'], 
+                        'opr' => $aCondition['operator']
+                    );
+            
+            $this->_aBrowseParams['author'] = $iProfileId; 
+            $this->_aBrowseParams['join'] = $aJoinGroup;
+            $this->_aBrowseParams['where'] = $aWhereGroup; 
+        }
+        
         $CNF = $this->_oModule->_oConfig->CNF;
         
     	$sSelectClause = $sJoinClause = $sWhereClause = $sGroupByClause = '';
@@ -311,9 +380,6 @@ class BxForumGrid extends BxTemplGrid
                 $sGroupByClause .= " GROUP BY " . $sGroupByClauseBrowse;
         }
         
-        if(strpos($sFilter, $this->_sParamsDivider) !== false)
-            list($this->_sFilter1Value, $this->_sFilter2Value, $this->_sFilter3Value, $sFilter) = explode($this->_sParamsDivider, $sFilter);
-        
         $sFilterSql = "";
 
         // filter by resolved status
@@ -326,7 +392,6 @@ class BxForumGrid extends BxTemplGrid
             $aObjects = BxDolBadges::getInstance()->getData(['type' => 'by_module&badge', 'badge_id' => $this->_sFilter2Value, 'module' => $this->_oModule->_aModule['name']]);
             $sWhereClause .= " AND `" . $CNF['TABLE_ENTRIES'] . "`.`" . $CNF['FIELD_ID'] . "` IN (" . implode(',', $aObjects ) . ")";
         }
-        
         $this->_aOptions['source'] = sprintf($this->_sDefaultSource, $sSelectClause, $sJoinClause, $sWhereClause, $sGroupByClause);
         return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage);
     }

+ 26 - 0
modules/boonex/forum/classes/BxForumMenuSnippetMeta.php

@@ -95,6 +95,32 @@ class BxForumMenuSnippetMeta extends BxBaseModTextMenuSnippetMeta
 
         return $this->getUnitMetaItemText(strmaxtextlen($aComment['cmt_text'], 100), array('class' => $this->_sModule . '-gpm-reply-text'));
     }
+    
+    protected function _getMenuItemStatus($aItem)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+
+        $oObject = isset($CNF['OBJECT_COMMENTS']) ? BxDolCmts::getObjectInstance($CNF['OBJECT_COMMENTS'], $this->_aContentInfo[$CNF['FIELD_ID']]) : null;
+        $sIcon = '';
+        if ($this->_aContentInfo['resolvable']){
+            if ($this->_aContentInfo['resolved']){
+                $sIcon .= 'checked-circle';
+            }
+            else{
+                $sIcon .= 'question-circle';
+            }   
+        }
+        else{
+            $sIcon .= 'comment-alt'; 
+        }
+        return $this->getUnitMetaItemCustom($this->_oModule->_oTemplate->parseHtmlByName('status.html', ['icon' => $sIcon , 'counter' => (int)$oObject->getCommentsCountAll()])); 
+    }
+    
+    protected function _getMenuItemBadges($aItem)
+    {
+        $CNF = &$this->_oModule->_oConfig->CNF;
+        return $this->getUnitMetaItemCustom($this->_oModule->serviceGetBadges($this->_aContentInfo[$CNF['FIELD_ID']], false, true)); 
+    }
 }
 
 /** @} */

+ 4 - 78
modules/boonex/forum/classes/BxForumModule.php

@@ -305,9 +305,7 @@ class BxForumModule extends BxBaseModTextModule
             return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
 
         return $this->_serviceBrowseTable(array(
-            'grid' => $CNF['OBJECT_GRID_FEATURE'],
             'type' => $sType, 
-            'where' => array('fld' => 'featured', 'val' => 0, 'opr' => '<>'),
             'empty_message' => $bEmptyMessage,
             'ajax_paginate' => $bAjaxPaginate
         ), $bShowHeader);
@@ -435,45 +433,15 @@ class BxForumModule extends BxBaseModTextModule
     /** 
      * @ref bx_forum-browse_partaken "browse_partaken"
      */
-    public function serviceBrowsePartaken ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true, $bShowHeader = false)
+    public function serviceBrowsePartaken ($sUnitView = false, $bEmptyMessage = true, $bAjaxPaginate = true, $bShowHeader = true)
     {
         $sType = 'partaken';
 
         if($sUnitView != 'table')
             return $this->_serviceBrowse($sType, $sUnitView ? array('unit_view' => $sUnitView) : false, BX_DB_PADDING_DEF, $bEmptyMessage, $bAjaxPaginate);
 
-        $aSelect = array(
-            'tbla' => 'tco', 
-            'fld' => 'cmt_author_id',
-        );
-
-        $aJoin = array(
-            'tp' => 'INNER',
-            'tbl1' => 'bx_forum_cmts',
-            'tbl1a' => 'tco',
-            'fld1' => 'cmt_object_id',
-            'tbl2' => 'bx_forum_discussions',
-            'fld2' => 'id'
-        );
-
-        $aWhere = array(
-            'tbl' => 'tco', 
-            'fld' => 'cmt_author_id', 
-            'val' => bx_get_logged_profile_id(), 
-            'opr' => '='
-        );
-
-        $aGroupBy = array(
-            'tbl' => 'bx_forum_discussions', 
-            'fld' => 'id',
-        );
-
         return $this->_serviceBrowseTable(array(
             'type' => $sType,
-            'select' => $aSelect,
-            'join' => $aJoin,
-            'where' => $aWhere,
-            'group_by' => $aGroupBy,
             'empty_message' => $bEmptyMessage,
             'ajax_paginate' => $bAjaxPaginate
         ), $bShowHeader);
@@ -590,21 +558,6 @@ class BxForumModule extends BxBaseModTextModule
     {
         $CNF = &$this->_oConfig->CNF;
 
-        $oProfile = null;
-        if((int)$iProfileId)
-            $oProfile = BxDolProfile::getInstance($iProfileId);
-        if(!$oProfile && bx_get('profile_id') !== false)
-            $oProfile = BxDolProfile:: getInstance(bx_process_input(bx_get('profile_id'), BX_DATA_INT));
-        if(!$oProfile)
-            $oProfile = BxDolProfile::getInstance();
-        if(!$oProfile)
-            return '';
-
-        $iProfileAuthor = $oProfile->id();
-        $oFavorite = $this->getObjectFavorite();
-        if(!$oFavorite->isPublic() && $iProfileAuthor != bx_get_logged_profile_id())
-            return '';
-
         $bEmptyMessage = false;
         if(isset($aParams['empty_message'])) {
             $bEmptyMessage = (bool)$aParams['empty_message'];
@@ -617,37 +570,8 @@ class BxForumModule extends BxBaseModTextModule
             unset($aParams['ajax_paginate']);
         }
 
-        $aConditions = $oFavorite->getConditionsTrack($CNF['TABLE_ENTRIES'], 'id', $iProfileAuthor);
-        if(empty($aConditions) || !is_array($aConditions)) 
-            return '';
-
-        $aJoinGroup = array('grp' => true, 'cnds' => array());
-        if(!empty($aConditions['join']))
-            foreach($aConditions['join'] as $aCondition)
-                $aJoinGroup['cnds'][] = array(
-                    'tp' => $aCondition['type'],
-                    'tbl1' => $aCondition['table'],
-                    'fld1' => $aCondition['onField'],
-                    'tbl2' => $aCondition['mainTable'],
-                    'fld2' => $aCondition['mainField']
-                );
-
-        $aWhereGroup = array('grp' => true, 'opr' => 'AND', 'cnds' => array());
-        if(!empty($aConditions['restriction']))
-            foreach($aConditions['restriction'] as $aCondition)
-                $aWhereGroup['cnds'][] = array(
-                    'tbl' => (!empty($aCondition['table']) ? $aCondition['table'] : ''), 
-                    'fld' => $aCondition['field'], 
-                    'val' => $aCondition['value'], 
-                    'opr' => $aCondition['operator']
-                );
-
         return $this->_serviceBrowseTable(array(
-            'grid' => $CNF['OBJECT_GRID_FAVORITE'],
             'type' => 'favorite', 
-            'author' => $iProfileId, 
-            'join' => $aJoinGroup,
-            'where' => $aWhereGroup, 
             'per_page' => (int)$this->_oDb->getParam('bx_forum_per_page_profile'),
             'empty_message' => $bEmptyMessage,
             'ajax_paginate' => $bAjaxPaginate
@@ -1103,10 +1027,12 @@ class BxForumModule extends BxBaseModTextModule
         $oGrid = BxDolGrid::getObjectInstance($sGrid);
         if(!$oGrid)
             return false;
-
+        
         $oGrid->setBrowseParams($aParams);
+        
         $this->_oTemplate->addJsTranslation(array('_sys_grid_search'));
         $this->_oTemplate->addCss(array('grid_tools.css'));
+       
         return $oGrid->getCode($isDisplayHeader);
     }
 

+ 1 - 4
modules/boonex/forum/classes/BxForumTemplate.php

@@ -140,8 +140,7 @@ class BxForumTemplate extends BxBaseModTextTemplate
 
         $oProfileLast = BxDolProfile::getInstanceMagic($aRow['lr_profile_id']);
 
-        $sTitle = strmaxtextlen($aRow[$CNF['FIELD_TITLE']], 100);
-        $sText = strmaxtextlen($aRow[$CNF['FIELD_TEXT']], 100);
+        $sTitle = strmaxtextlen($aRow[$CNF['FIELD_TITLE']], 120);
 
         $aMetas = array('main' => false, 'counters' => false, 'reply' => false);
         foreach(array_keys($aMetas) as $sMeta) {
@@ -174,8 +173,6 @@ class BxForumTemplate extends BxBaseModTextTemplate
             ),
             'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $aRow[$CNF['FIELD_ID']]),
             'title' => $sTitle ? $sTitle : _t('_Empty'),
-            'badges' => $oModule->serviceGetBadges($aRow[$CNF['FIELD_ID']], false, true),
-            'text' => $sText,
             'bx_if:meta_main' => array(
                 'condition' => $aMetas['main'] !== false && (!isset($aParams['show_meta_main']) || $aParams['show_meta_main']),
                 'content' => $aMetas['main']

+ 6 - 2
modules/boonex/forum/install/langs/en.xml

@@ -154,6 +154,7 @@
     <string name="_bx_forum_page_block_title_new_entries_view_extended"><![CDATA[New Discussions (Extended View)]]></string>
     <string name="_bx_forum_page_block_title_new_entries_view_full"><![CDATA[New Discussions (Full View)]]></string>
     <string name="_bx_forum_page_block_title_latest_entries"><![CDATA[Discussions With Recent Posts]]></string>
+    <string name="_bx_forum_page_block_title_home"><![CDATA[Discussions List]]></string>
     <string name="_bx_forum_page_block_title_latest_entries_view_extended"><![CDATA[Discussions With Recent Posts (Extended View)]]></string>
     <string name="_bx_forum_page_block_title_latest_entries_view_full"><![CDATA[Discussions With Recent Posts (Full View)]]></string>
     <string name="_bx_forum_page_block_title_top_entries"><![CDATA[Top Discussions]]></string>
@@ -274,8 +275,8 @@
     <string name="_bx_forum_menu_item_title_entries_home"><![CDATA[Discussions]]></string>
     <string name="_bx_forum_menu_item_title_system_entries_partaken"><![CDATA[Partaken]]></string>
     <string name="_bx_forum_menu_item_title_entries_partaken"><![CDATA[Partaken]]></string>
-    <string name="_bx_forum_menu_item_title_system_entries_public"><![CDATA[Latest]]></string>
-    <string name="_bx_forum_menu_item_title_entries_public"><![CDATA[Latest]]></string>
+    <string name="_bx_forum_menu_item_title_system_entries_public"><![CDATA[Home]]></string>
+    <string name="_bx_forum_menu_item_title_entries_public"><![CDATA[Home]]></string>
     <string name="_bx_forum_menu_item_title_system_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_forum_menu_item_title_entries_manage"><![CDATA[Manage]]></string>
     <string name="_bx_forum_menu_item_title_system_entries_new"><![CDATA[New]]></string>
@@ -369,6 +370,9 @@
     <string name="_bx_forum_grid_filter_order_top"><![CDATA[Top]]></string>
     <string name="_bx_forum_grid_filter_order_updated"><![CDATA[Updated]]></string>
     <string name="_bx_forum_grid_filter_order_popular"><![CDATA[Popular]]></string>
+    <string name="_bx_forum_grid_filter_order_featured"><![CDATA[Featured]]></string>
+    <string name="_bx_forum_grid_filter_order_favorite"><![CDATA[Favorite]]></string>
+    <string name="_bx_forum_grid_filter_order_partaken"><![CDATA[Partaken]]></string>
     
     <string name="_bx_forum_grid_btn_save"><![CDATA[Save]]></string>
     <string name="_bx_forum_grid_btn_cancel"><![CDATA[Cancel]]></string>

+ 6 - 9
modules/boonex/forum/install/sql/enable.sql

@@ -161,7 +161,7 @@ INSERT INTO `sys_pages_blocks`(`object`, `cell_id`, `module`, `title_system`, `t
 ('bx_forum_home', 1, @sName, '_bx_forum_page_block_title_sys_featured_entries_view_showcase', '_bx_forum_page_block_title_featured_entries_view_showcase', 11, 0, NULL, '', 0, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:15:\"browse_featured\";s:6:\"params\";a:3:{s:9:\"unit_view\";s:8:\"showcase\";s:13:\"empty_message\";b:0;s:13:\"ajax_paginate\";b:0;}}', NULL, 0, 1, 1, 0),
 ('bx_forum_home', 2, @sName, '', '_bx_forum_page_block_title_cats', 11, 0, NULL, '', 0, 0, 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:15:\"categories_list\";}', NULL, 0, 1, 1, 0),
 ('bx_forum_home', 2, @sName, '_bx_forum_page_block_title_sys_multicats', '_bx_forum_page_block_title_multicats', 11, 0, NULL, '', 0, '', 2147483647, 'service', 'a:2:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:21:\"categories_multi_list\";}', NULL, 0, 1, 0, 1),
-('bx_forum_home', 3, @sName, '', '_bx_forum_page_block_title_latest_entries', 11, 0, NULL, '', 0, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:13:\"browse_latest\";s:6:\"params\";a:3:{i:0;s:5:\"table\";i:1;b:1;i:2;b:0;}}', NULL, 0, 1, 1, 1),
+('bx_forum_home', 3, @sName, '', '_bx_forum_page_block_title_home', 11, 0, NULL, '', 0, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:8:\"bx_forum\";s:6:\"method\";s:13:\"browse_latest\";s:6:\"params\";a:3:{i:0;s:5:\"table\";i:1;b:1;i:2;b:0;}}', NULL, 0, 1, 1, 1),
 ('bx_forum_home', 2, @sName, '', '_bx_forum_page_block_title_browse_labels', 11, 0, NULL, '', 0, '', 2147483647, 'service', 'a:3:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:13:\"browse_labels\";s:5:\"class\";s:20:\"TemplServiceMetatags\";}', NULL, 0, 1, 0, 2),
 ('bx_forum_home', 2, @sName, '', '_bx_forum_page_block_title_popular_keywords', 11, 0, NULL, '', 0, '', 2147483647, 'service', 'a:4:{s:6:\"module\";s:6:\"system\";s:6:\"method\";s:14:\"keywords_cloud\";s:6:\"params\";a:2:{i:0;s:8:\"bx_forum\";i:1;s:8:\"bx_forum\";}s:5:\"class\";s:20:\"TemplServiceMetatags\";}', NULL, 0, 1, 1, 3);
 
@@ -336,11 +336,7 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `order`) VALUES 
 ('bx_forum_submenu', @sName, 'discussions-home', '_bx_forum_menu_item_title_system_entries_public', '_bx_forum_menu_item_title_entries_public', 'page.php?i=discussions-home', '', '', '', '', 2147483647, 1, 1, 1),
-('bx_forum_submenu', @sName, 'discussions-new', '_bx_forum_menu_item_title_system_entries_new', '_bx_forum_menu_item_title_entries_new', 'page.php?i=discussions-new', '', '', '', '', 2147483647, 1, 1, 2),
-('bx_forum_submenu', @sName, 'discussions-top', '_bx_forum_menu_item_title_system_entries_top', '_bx_forum_menu_item_title_entries_top', 'page.php?i=discussions-top', '', '', '', '', 2147483647, 1, 1, 3),
-('bx_forum_submenu', @sName, 'discussions-categories', '_bx_forum_menu_item_title_system_entries_categories', '_bx_forum_menu_item_title_entries_categories', 'page.php?i=discussions-categories', '', '', '', '', 2147483647, 1, 1, 4),
 ('bx_forum_submenu', @sName, 'discussions-search', '_bx_forum_menu_item_title_system_entries_search', '_bx_forum_menu_item_title_entries_search', 'page.php?i=discussions-search', '', '', '', '', 2147483647, 1, 1, 5),
-('bx_forum_submenu', @sName, 'discussions-partaken', '_bx_forum_menu_item_title_system_entries_partaken', '_bx_forum_menu_item_title_entries_partaken', 'page.php?i=discussions-partaken', '', '', '', '', 2147483646, 1, 1, 6),
 ('bx_forum_submenu', @sName, 'discussions-manage', '_bx_forum_menu_item_title_system_entries_manage', '_bx_forum_menu_item_title_entries_manage', 'page.php?i=discussions-manage', '', '', '', '', 2147483646, 1, 1, 7);
 
 -- MENU: custom menu for 'main' snippet meta info
@@ -353,7 +349,9 @@ INSERT INTO `sys_menu_sets`(`set_name`, `module`, `title`, `deletable`) VALUES
 INSERT INTO `sys_menu_items`(`set_name`, `module`, `name`, `title_system`, `title`, `link`, `onclick`, `target`, `icon`, `submenu_object`, `visible_for_levels`, `active`, `copyable`, `editable`, `order`) VALUES 
 ('bx_forum_snippet_meta_main', 'bx_forum', 'author', '_sys_menu_item_title_system_sm_author', '_sys_menu_item_title_sm_author', '', '', '', '', '', 2147483647, 1, 0, 1, 1),
 ('bx_forum_snippet_meta_main', 'bx_forum', 'date', '_sys_menu_item_title_system_sm_date', '_sys_menu_item_title_sm_date', '', '', '', '', '', 2147483647, 1, 0, 1, 2),
-('bx_forum_snippet_meta_main', 'bx_forum', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 1, 0, 1, 3);
+('bx_forum_snippet_meta_main', 'bx_forum', 'category', '_sys_menu_item_title_system_sm_category', '_sys_menu_item_title_sm_category', '', '', '', '', '', 2147483647, 1, 0, 1, 3),
+('bx_forum_snippet_meta_main', 'bx_forum', 'status', '_sys_menu_item_title_system_sm_status', '_sys_menu_item_title_sm_status', '', '', '', '', '', 2147483647, 1, 0, 1, 4),
+('bx_forum_snippet_meta_main', 'bx_forum', 'badges', '_sys_menu_item_title_system_sm_badges', '_sys_menu_item_title_sm_badges', '', '', '', '', '', 2147483647, 1, 0, 1, 5);
 
 -- MENU: custom menu for 'counters' snippet meta info
 INSERT INTO `sys_objects_menu`(`object`, `title`, `set_name`, `module`, `template_id`, `deletable`, `active`, `override_class_name`, `override_class_file`) VALUES 
@@ -411,11 +409,10 @@ INSERT INTO `sys_objects_grid` (`object`, `source_type`, `source`, `table`, `fie
 ('bx_forum_feature', 'Sql', 'SELECT `bx_forum_discussions`.*, `bx_forum_cmts`.`cmt_text` AS `cmt_text` %s FROM `bx_forum_discussions` LEFT JOIN `bx_forum_cmts` ON (`bx_forum_cmts`.`cmt_id` = `bx_forum_discussions`.`lr_comment_id`) %s WHERE 1 %s %s', 'bx_forum_discussions', 'id', 'lr_timestamp', '', 10, NULL, 'start', '', 'title,text,text_comments', 'auto', '', 2147483647, 'BxForumGrid', 'modules/boonex/forum/classes/BxForumGrid.php');
 
 INSERT INTO `sys_grid_fields` (`object`, `name`, `title`, `width`, `params`, `order`) VALUES
-(@sName, 'rating', '', '10%', '', 1),
+(@sName, 'rating', '', '5%', '', 1),
 (@sName, 'category', '', '10%', '', 2),
-(@sName, 'text', '', '60%', '', 3),
+(@sName, 'text', '', '75%', '', 3),
 (@sName, 'participants', '', '10%', '', 4),
-(@sName, 'status', '', '10%', '', 5),
 
 ('bx_forum_favorite', 'author', '', '10%', '', 1),
 ('bx_forum_favorite', 'text', '', '90%', '', 2),

+ 10 - 2
modules/boonex/forum/js/main.js

@@ -42,9 +42,17 @@ BxForumMain.prototype.init = function() {
 	        var iInnerWidth = oTable.parent().innerWidth();
 	        oTable.find('.bx-forum-grid-preview').each(function () {
 	            var eWrapper = $(this).parent();
-	            var w = iInnerWidth - iCalcWidth - parseInt(eWrapper.css('padding-left')) - parseInt(eWrapper.css('padding-right'));
-	            $(this).width(w + 'px');
+	           // var w = iInnerWidth - iCalcWidth - parseInt(eWrapper.css('padding-left')) - parseInt(eWrapper.css('padding-right'));
+	           // $(this).width(w + 'px');
 	        }); 
+            
+            oTable.find('tr').each(function () {
+	            $(this).click(function() {
+                    location = $(this).find('.bx-forum-gp-title A').attr('href');
+                })
+	        }); 
+            
+            
     	});
     };
 

+ 115 - 19
modules/boonex/forum/template/css/main.css

@@ -88,16 +88,6 @@
     background-color: transparent;
 }
 
-.bx-forum-grid .bx-grid-table tr th:first-child,
-.bx-forum-grid .bx-grid-table tr td:first-child {
-    padding-left: 0;
-}
-
-.bx-forum-grid .bx-grid-table tr th:last-child,
-.bx-forum-grid .bx-grid-table tr td:last-child {
-    padding-right: 0;
-}
-
 .bx-forum-grid-field-replies .bx-def-unit-alert-middle {
     position:static;
     display:inline-block;
@@ -121,6 +111,10 @@
     right: 0;
     top: 0;
 }
+.bx-forum-gpm-main .bx-base-general-unit-meta-item{
+    font-size: 0.875rem !important; 
+    color:rgb(107,114,128) !important;
+}
 
 .bx-forum-preview .bx-def-unit-info {
     line-height:1.15em;
@@ -139,8 +133,6 @@
     display: flex;
     -webkit-align-items: center;
     align-items: center;
-
-    white-space: nowrap;
 }
 
 .bx-forum-grid-preview .bx-forum-gp-title a {
@@ -149,9 +141,10 @@
 
 .bx-forum-grid-preview .bx-forum-gp-title a,
 .bx-forum-grid-preview .bx-forum-gp-text {
-    white-space: nowrap;
-    text-overflow: ellipsis;
-    overflow: hidden;
+    font-size: 1rem; 
+    line-height: 1.5; 
+    font-weight: 500; 
+    color:rgb(17,24,29)
 }
 
 .bx-forum-grid-preview .bx-forum-gp-title .sys-icon,
@@ -322,19 +315,122 @@
     height: 3rem;
     text-align: center;
     font-size: 2rem;
-    line-height: 2.7rem;
+    line-height: 2.9rem;
+    background: rgb(107,114,120);
+    border-radius: 3rem;
+    display: flex;
+    align-items: center;
+    justify-content: center;
+    margin-top: 11px;
 }
 .bx-forum-thumb img{
     border-radius: 500px;
 }
-.bx-forum-thumb svg,
 .bx-forum-thumb .sys-icon{
     width: 3rem;
     height: 3rem;
 }
+.bx-forum-thumb .sys-icon-svg{
+    width: 2.4rem;
+    height: 2.4rem;
+}
+
 .bx-forum-grid-status{
     display: flex;
 }
-.bx-grid-table-cell-rating{
-    vertical-align: middle;
+.bx-grid-table-cell-rating .sys-action-cnt{
+    flex-direction: column;
+    justify-content: center;
+    border: 1px solid rgb(209,213,219) !important;
+    border-radius: 0.75rem;
+}
+.bx-grid-table-cell-rating .sys-action-cnt > SPAN{
+    margin-left: 0px !important;
+    text-align: center;
+    border-collapse: collapse;
 }
+.bx-grid-table-cell-rating .bx-score{
+    display: block;
+    margin: 0px !important;
+}
+.bx-grid-table-cell-participants .cmt-counter{
+    float: right;
+}
+.bx-forum-grid td{
+    vertical-align: top;
+}
+.bx-forum-grid tr:hover{
+    background: rgb(243,244,246) !important;
+    cursor: pointer;
+}
+.bx-forum-grid tr td:first-child{
+    padding-left: 0.5rem;
+}
+.bx-forum-grid tr td:last-child{
+    padding-right: 0.5rem;
+}
+.bx-forum-grid tr:hover td:first-child{
+    border-radius: 0.375rem 0 0 0.375rem;
+}
+.bx-forum-grid tr:hover td:last-child{
+    border-radius: 0 0.375rem 0.375rem 0;
+}
+.bx-media-phone .bx-forum-grid {
+    width: 100%;
+    min-width:inherit !important;
+}
+.bx-media-phone .bx-forum-grid tr{
+    display: grid;
+	grid-template-areas:
+    "rating text"
+	"rating participants";
+	
+    grid-template-rows: auto auto;
+	grid-template-columns: 34px 1fr;
+    margin-bottom: 1rem;
+}
+
+.bx-media-phone .bx-forum-grid table{
+    width: 100% !important;
+    min-width: inherit !important;
+}
+.bx-media-phone .bx-forum-grid td{
+    width: auto !important;
+}
+.bx-media-phone .bx-forum-grid .bx-grid-table-cell-rating{
+    grid-area: rating;
+    padding-left: 0px;
+}
+.bx-media-phone .bx-forum-grid .bx-grid-table-cell-category{
+    grid-area: category;
+    display: none;
+}
+.bx-media-phone .bx-forum-grid .bx-grid-table-cell-text{
+    grid-area: text;
+    padding-bottom: 0px;
+}
+.bx-media-phone .bx-forum-grid .bx-grid-table-cell-participants{
+    grid-area: participants;
+    padding-top: 0px;
+}
+.bx-media-phone .bx-grid-table-cell-participants .cmt-counter{
+    float:none
+}
+/* unit */
+.bx-forum-unit .bx-base-text-unit-title h2{
+    font-size: 1rem;
+    line-height: 1.5;
+    font-weight: 500;
+    color: rgb(17,24,29);
+}
+.bx-forum-unit .bx-base-general-unit-meta-item{
+    font-size: 0.875rem !important; 
+    color:rgb(107,114,128) !important;
+}
+.bx-forum-unit .bx-base-text-unit-no-thumb{
+    background: linear-gradient(to bottom, #356699 0%,#b1cee2 100%);
+    text-align: left;
+    color:#fff;
+    border-radius: 7px 7px 0 0;
+}
+

+ 1 - 2
modules/boonex/forum/template/entry-preview.html

@@ -2,9 +2,8 @@
     <div class="bx-forum-gp-title bx-def-font">
     	<bx_if:show_stick><i class="sys-icon thumbtack" title="<bx_text_attribute:_bx_forum_txt_entry_sticked />"></i></bx_if:show_stick>
     	<bx_if:show_lock><i class="sys-icon lock" title="<bx_text_attribute:_bx_forum_txt_entry_locked />"></i></bx_if:show_lock>
-    	<a class="bx-def-font-h3" href="__url__">__title__</a> __badges__
+    	<a class="bx-def-font-h3" href="__url__">__title__</a>
     </div>
-    <div class="bx-forum-gp-text bx-def-font-middle bx-def-padding-thd-top">__text__</div>
     <div class="bx-forum-gp-meta bx-forum-gpm-bottom bx-def-font-small">
         <bx_if:meta_reply><div class="bx-base-general-unit-meta bx-forum-gpm-reply">__content__</div></bx_if:meta_reply>
     </div>

+ 1 - 4
modules/boonex/forum/template/status.html

@@ -1,4 +1 @@
-<div class="bx-forum-grid-status">
-    <img src='__icon__' class="bx-def-margin-sec-right">
-    <span>__counter__</span>
-</div>
+<span class="bx-def-font-grayed "><i class="sys-icon far __icon__"></i>  __counter__</span>

+ 27 - 0
modules/boonex/forum/template/unit_gallery.html

@@ -0,0 +1,27 @@
+<div class="__class__ bx-base-text-unit bx-forum-unit bx-base-text-unit-gallery bx-def-gal-unit-size bx-def-padding-sec">
+    <div class="bx-base-text-unit-cnt bx-def-box bx-def-round-corners bx-def-color-bg-box bx-def-box-sizing">
+        <bx_if:thumb>
+            <a href="__content_url__" title="__summary_attr__">
+                <div class="bx-base-text-unit-thumb bx-def-gal-div-size bx-def-round-corners bx-def-font-middle" style="background-image:url(__gallery_url__)">
+                    <div class="bx-base-text-unit-strecher"></div>
+                </div>
+            </a>
+        </bx_if:thumb>
+        <bx_if:no_thumb>
+            <div class="bx-def-gal-img-column">
+                <div class="bx-base-text-unit-no-thumb bx-def-gal-div-size bx-def-font-middle bx-def-font-grayed bx-def-padding bx-def-box-sizing">
+                    __summary_plain__
+                    <div class="bx-base-text-unit-strecher"></div>
+                </div>
+            </div>
+        </bx_if:no_thumb>
+        <div class="bx-base-text-unit-text bx-def-padding-leftright bx-def-padding-sec-topbottom bx-def-box-sizing">
+            <div class="bx-base-text-unit-title">
+                <h2><a href="__content_url__">__title__</a></h2>
+            </div>
+            <div class="bx-base-text-unit-info">
+                <bx_if:meta><div class="bx-base-general-unit-meta">__meta__</div></bx_if:meta>
+            </div>
+        </div>
+    </div>
+</div>

+ 10 - 4
template/css/grid.css

@@ -72,15 +72,21 @@
 .bx-media-phone .bx-grid-header-cnt {
     -webkit-flex-wrap: wrap;
     flex-wrap: wrap;
+    flex-direction: column;
+    align-items: flex-start;
 }
-.bx-media-phone div.bx-grid-header div.bx-form-element-wrapper {
-    float: none;
-    margin-right: 0;
+.bx-media-phone .bx-grid-header-controls-filter{
+    margin: 0px !important;
+}
+.bx-media-phone .bx-grid-header-controls-filter .bx-form-element-wrapper{
+    width: calc(50% - 0.5rem);
 }
 .bx-media-phone div.bx-grid-header div.bx-form-element-wrapper:last-child {
     margin-bottom: 0; 
 }
-
+.bx-media-phone .bx-grid-header-controls-counter{
+    text-align: left;
+}
 .bx-grid-table .bx-grid-table-row-hr td:first-child,
 .bx-grid-table .bx-grid-table-row-hr td {
     padding:0;

+ 1 - 1
template/scripts/BxBaseServices.php

@@ -1017,7 +1017,7 @@ class BxBaseServices extends BxDol implements iBxDolProfileService
         if ($aBadge['fontcolor'] == '')
 			$aBadge['fontcolor'] = '#ffffff';
 		
-        if ($bIsCompact){
+        if ($bIsCompact && $aBadge['icon'] != ''){
             $aBadge['is_icon_only'] = 1;
 			$sClass .= ' bx-badge-compact-to';
 			$sStyleFont = 'color: ' . $aBadge['color'];