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

#42 - convos module: responsive layout

Alex Trofimov 12 лет назад
Родитель
Сommit
57bbd3cfed

+ 1 - 0
modules/boonex/convos/classes/BxCnvGrid.php

@@ -102,6 +102,7 @@ class BxCnvGrid extends BxTemplGrid
         bx_import('BxDolModule');
         $oModule = BxDolModule::getInstance($this->MODULE);
         $oModule->_oTemplate->addJs('main.js');
+        $oModule->_oTemplate->addCss(array('main-media-tablet.css', 'main-media-desktop.css'));
     }
 }
 

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

@@ -82,6 +82,7 @@ class BxCnvTemplate extends BxBaseModTextTemplate
                 'title' => $oProfile->getDisplayName(),
                 'title_attr' =>  bx_html_attribute($sInfo),
                 '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 (
@@ -219,6 +220,8 @@ class BxCnvTemplate extends BxBaseModTextTemplate
 
     function entryMessagePreviewInGrid ($r)
     {
+        $oModule = BxDolModule::getInstance($this->MODULE);
+
         $oProfileLast = BxDolProfile::getInstance($r['last_reply_profile_id']);
         if (!$oProfileLast)
             $oProfileLast = BxDolProfileUndefined::getInstance();
@@ -230,6 +233,7 @@ class BxCnvTemplate extends BxBaseModTextTemplate
             $r['unread_messages'] = $r['comments'] - $r['read_comments'];
 
         $aVars = array (
+            'url' => BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=' . $oModule->_oConfig->CNF['URI_VIEW_ENTRY'] . '&id=' . $r['id']),
             'text' => $sText,
             'cmt_text' => $sTextCmt,
             'last_reply_time_and_replier' => _t('_bx_cnv_x_date_by_x_replier', bx_time_js($r['last_reply_timestamp'], BX_FORMAT_DATE), $oProfileLast->getDisplayName()),

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

@@ -1,7 +1,7 @@
 <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">
+        <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>
             <bx_if:last_replier>
                 <div class="bx-def-unit-alert bg-col-blue2-dark" style="left:0; right:auto;"><i class="sys-icon comments"></i></div>

+ 8 - 0
modules/boonex/convos/template/css/main-media-desktop.css

@@ -0,0 +1,8 @@
+@media (min-width:1024px) {
+
+.bx-cnv-collaborator {
+    display:inline;
+    display:inline-block;
+}
+
+} /* @media end */

+ 8 - 0
modules/boonex/convos/template/css/main-media-tablet.css

@@ -0,0 +1,8 @@
+@media (min-width:720px) and (max-width:1024px) {
+
+.bx-cnv-collaborator {
+    display:inline;
+    display:inline-block;
+}
+
+} /* @media end */

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

@@ -10,9 +10,13 @@
 }
 
 .bx-cnv-collaborator {
+    white-space:nowrap;
+    display:none;
+}
+
+.bx-cnv-collaborator-author {
     display:inline;
     display:inline-block;
-    white-space:nowrap;
 }
 
 .bx-cnv-preview {