ソースを参照

Ticket #1465 - Informers in Timeline.

AntonLV 7 年 前
親
コミット
faa7aeef06

+ 6 - 4
modules/boonex/lucid/data/template/bx_timeline/item_outline.html

@@ -3,10 +3,12 @@
 	    <div class="__style_prefix__-item-cnt bx-def-box bx-def-round-corners __class_content__">
                 <div class="__style_prefix__-blink-plate"></div>
                 <bx_if:show_note>
-                    <div class="__style_prefix__-item-note">
-                        <div class="__style_prefix__-in-text bx-def-padding-sec-topbottom bx-def-padding-leftright bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
-                        <div class="__style_prefix__-in-divider bx-def-hr"></div>
-                    </div>
+                    <bx_repeat:notes>
+                        <div class="__style_prefix__-item-note">
+                            <div class="__style_prefix__-in-text bx-def-padding-sec-topbottom bx-def-padding-leftright bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
+                        </div>
+                    </bx_repeat:notes>
+                    <div class="__style_prefix__-in-divider bx-def-hr"></div>
                 </bx_if:show_note>
 	    	<div class="__style_prefix__-item-owner bx-def-padding-top bx-def-padding-sec-bottom">
                     <div class="__style_prefix__-item-owner-cnt"> 

+ 6 - 4
modules/boonex/lucid/data/template/bx_timeline/item_timeline.html

@@ -8,10 +8,12 @@
     <div class="__style_prefix__-item-cnt bx-def-box bx-def-round-corners __class_content__">
         <div class="__style_prefix__-blink-plate"></div>
         <bx_if:show_note>
-            <div class="__style_prefix__-item-note">
-                <div class="__style_prefix__-in-text bx-def-padding-sec-topbottom bx-def-padding-leftright bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
-                <div class="__style_prefix__-in-divider bx-def-hr"></div>
-            </div>
+            <bx_repeat:notes>
+                <div class="__style_prefix__-item-note">
+                    <div class="__style_prefix__-in-text bx-def-padding-sec-topbottom bx-def-padding-leftright bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
+                </div>
+            </bx_repeat:notes>
+            <div class="__style_prefix__-in-divider bx-def-hr"></div>
         </bx_if:show_note>
         <div class="__style_prefix__-item-owner bx-def-padding-top bx-def-padding-sec-bottom __class_owner__"> 
             <div class="__style_prefix__-item-owner-cnt">

+ 4 - 1
modules/boonex/russian/data/langs/bx_timeline/ru.xml

@@ -226,7 +226,10 @@
 	<string name="_bx_timeline_txt_hot"><![CDATA['Горячее' событие]]></string>
 	<string name="_bx_timeline_txt_pinned"><![CDATA[Приколотое событие]]></string>
         <string name="_bx_timeline_txt_sticked"><![CDATA[Событие приколотое для всех]]></string>
-    <string name="_bx_timeline_txt_promoted"><![CDATA[Рекламируемое]]></string>
+        <string name="_bx_timeline_txt_promoted"><![CDATA[Рекламируемое]]></string>
+        <string name="_bx_timeline_txt_note_scheduled_awaiting"><![CDATA[Дата публикации: {0}]]></string>
+        <string name="_bx_timeline_txt_note_processing_awaiting"><![CDATA[Обновление будет опубликована как только сконвертируется видео.]]></string>
+        <string name="_bx_timeline_txt_note_processing_failed"><![CDATA[Обновление не было опубликовано, тк произошла ошибка при конвертации видео. Обновите видео, чтобы решить проблему.]]></string>
 	<string name="_bx_timeline_txt_rss_caption"><![CDATA[Лента {0}]]></string>
 	<string name="_bx_timeline_txt_added_sample"><![CDATA[добавил {0}]]></string>
 	<string name="_bx_timeline_txt_user_added_sample"><![CDATA[{0} добавил {1}]]></string>

+ 1 - 0
modules/boonex/timeline/classes/BxTimelineModule.php

@@ -34,6 +34,7 @@ define('BX_TIMELINE_PARSE_TYPE_DEFAULT', BX_TIMELINE_PARSE_TYPE_POST);
 
 define('BX_TIMELINE_STATUS_ACTIVE', 'active');
 define('BX_TIMELINE_STATUS_AWAITING', 'awaiting');
+define('BX_TIMELINE_STATUS_FAILED', 'failed');
 define('BX_TIMELINE_STATUS_HIDDEN', 'hidden');
 define('BX_TIMELINE_STATUS_DELETED', 'deleted');
 

+ 39 - 2
modules/boonex/timeline/classes/BxTimelineTemplate.php

@@ -1794,8 +1794,9 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
             $sConnection = $this->_oConfig->getObject('conn_subscriptions');
             $oConnection = BxDolConnection::getObjectInstance($sConnection);
             if(!$oConnection->isConnected($iUser, $iOwner))
-                $aTmplVars = array(
+                $aTmplVars[] = array(
                     'style_prefix' => $sStylePrefix,
+                    'class' => '',
                     'bx_if:show_note_color' => array(
                         'condition' => false,
                         'content' => array(
@@ -1806,7 +1807,43 @@ class BxTimelineTemplate extends BxBaseModNotificationsTemplate
                 );
         }
 
-        return $aTmplVars;
+        //--- Awaiting status related notes.
+        if($aEvent['status'] == BX_TIMELINE_STATUS_AWAITING) {
+            $sNote = '';
+            if((int)$aEvent['published'] > (int)$aEvent['date'])
+                $sNote = _t('_bx_timeline_txt_note_scheduled_awaiting', bx_time_js($aEvent['published'], BX_FORMAT_DATE, true));
+            else
+                $sNote = _t('_bx_timeline_txt_note_processing_awaiting');
+
+            $aTmplVars[] = array(
+                'style_prefix' => $sStylePrefix,
+                'bx_if:show_note_color' => array(
+                    'condition' => true,
+                    'content' => array(
+                        'item_note_color' => 'red3'
+                    )
+                ),
+                'item_note' => $sNote
+            );
+        }
+
+        //--- Failed status related notes.
+        if($aEvent['status'] == BX_TIMELINE_STATUS_FAILED)
+            $aTmplVars[] = array(
+                'style_prefix' => $sStylePrefix,
+                'bx_if:show_note_color' => array(
+                    'condition' => true,
+                    'content' => array(
+                        'item_note_color' => 'red2'
+                    )
+                ),
+                'item_note' => _t('_bx_timeline_txt_note_processing_failed')
+            );
+
+        return empty($aTmplVars) ? array() : array(
+            'style_prefix' => $sStylePrefix,
+            'bx_repeat:notes' => $aTmplVars
+        );
     }
 
     protected function _getTmplVarsOwnerActions(&$aEvent, $aBrowseParams = array())

+ 3 - 0
modules/boonex/timeline/install/langs/en.xml

@@ -227,6 +227,9 @@
 	<string name="_bx_timeline_txt_pinned"><![CDATA[Pinned post]]></string>
         <string name="_bx_timeline_txt_sticked"><![CDATA[Pinned for all post]]></string>
 	<string name="_bx_timeline_txt_promoted"><![CDATA[Promoted]]></string>
+        <string name="_bx_timeline_txt_note_scheduled_awaiting"><![CDATA[Update publishing date is {0}]]></string>
+        <string name="_bx_timeline_txt_note_processing_awaiting"><![CDATA[Update will be published as soon as video is converted]]></string>
+        <string name="_bx_timeline_txt_note_processing_failed"><![CDATA[Update isn't published because video conversion failed, edit video to fix the issue.]]></string>
 	<string name="_bx_timeline_txt_rss_caption"><![CDATA[{0}'s timeline]]></string>
 	<string name="_bx_timeline_txt_added_sample"><![CDATA[added {0}]]></string>
 	<string name="_bx_timeline_txt_user_added_sample"><![CDATA[{0} added {1}]]></string>

+ 6 - 4
modules/boonex/timeline/template/item_outline.html

@@ -4,10 +4,12 @@
         <div class="__style_prefix__-item-cnt bx-def-box bx-def-padding-topbottom bx-def-round-corners __class_content__">
             <div class="__style_prefix__-blink-plate"></div>
             <bx_if:show_note>
-                <div class="__style_prefix__-item-note bx-def-margin-leftright">
-                    <div class="__style_prefix__-in-text bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
-                    <div class="__style_prefix__-in-divider bx-def-hr bx-def-margin-sec-topbottom"></div>
-                </div>
+                <bx_repeat:notes>
+                    <div class="__style_prefix__-item-note bx-def-margin-leftright">
+                        <div class="__style_prefix__-in-text bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
+                    </div>
+                </bx_repeat:notes>
+                <div class="__style_prefix__-in-divider bx-def-hr bx-def-margin-sec-topbottom"></div>
             </bx_if:show_note>
             <div class="__style_prefix__-item-owner bx-def-margin-leftright __class_owner__"> 
                 <div class="__style_prefix__-owner-avatar bx-def-thumb-size">__item_owner_unit__</div>

+ 6 - 4
modules/boonex/timeline/template/item_timeline.html

@@ -8,10 +8,12 @@
     <div class="__style_prefix__-item-cnt bx-def-box bx-def-padding-topbottom bx-def-round-corners __class_content__">
         <div class="__style_prefix__-blink-plate"></div>
         <bx_if:show_note>
-            <div class="__style_prefix__-item-note">
-                <div class="__style_prefix__-in-text bx-def-margin-leftright bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
-                <div class="__style_prefix__-in-divider bx-def-hr bx-def-margin-topbottom"></div>
-            </div>
+            <bx_repeat:notes>
+                <div class="__style_prefix__-item-note">
+                    <div class="__style_prefix__-in-text bx-def-margin-leftright bx-def-font-grayed<bx_if:show_note_color> col-__item_note_color__</bx_if:show_note_color>">__item_note__</div>
+                </div>
+            </bx_repeat:notes>
+            <div class="__style_prefix__-in-divider bx-def-hr bx-def-margin-topbottom"></div>
         </bx_if:show_note>
         <div class="__style_prefix__-item-owner bx-def-margin-leftright __class_owner__"> 
             <div class="__style_prefix__-owner-avatar bx-def-thumb-size">__item_owner_unit__</div>