2013-06-30 06:02:51 +03:00
{ * *
2014-06-11 11:59:54 +03:00
* Список диалогов
2013-06-30 06:02:51 +03:00
*}
2014-02-06 11:44:27 +02:00
{ if $aTalks }
2014-04-03 13:48:18 +03:00
<form action=" { router page = 'talk' } " method="post" id="talk-form">
{ * Скрытые поля * }
2014-05-10 18:45:14 +03:00
{ include 'components/field/field.hidden.security_key.tpl' }
{ include 'components/field/field.hidden.tpl' sName = 'form_action' sId = 'talk-form-action' }
2014-04-03 13:48:18 +03:00
{ * Экшнбар * }
2014-04-08 14:43:35 +03:00
{ include 'components/actionbar/actionbar.item.select.tpl' sItemSelector = '.js-message-list-item' assign = sMessagesSelect aItems = [
2014-07-22 19:16:27 +03:00
[ 'text' => $aLang.talk.actionbar.read, 'filter' => ":not('.message-unread')" ],
[ 'text' => $aLang.talk.actionbar.unread, 'filter' => ".message-unread" ]
2014-04-03 13:48:18 +03:00
]}
2014-04-08 14:43:35 +03:00
{ include 'components/actionbar/actionbar.tpl' aItems = [
2014-04-03 13:48:18 +03:00
[ 'html' => $sMessagesSelect ],
2014-07-22 19:16:27 +03:00
[ 'icon' => 'icon-ok', 'classes' => 'js-talk-form-action', 'attributes' => 'data-action="mark_as_read"', 'text' => $aLang.talk.actionbar.mark_as_read ],
2014-04-03 13:48:18 +03:00
[ 'icon' => 'icon-remove', 'classes' => 'js-talk-form-action', 'attributes' => 'data-action="remove"', 'text' => $aLang.common.remove ]
]}
{ * Список сообщений * }
<table class="table table-talk message-list">
<tbody>
{ foreach $aTalks as $oTalk }
{ * Создатель диалога * }
{ $oAuthor = $oTalk - > getTalkUser ( ) }
{ * В с е участники диалога * }
{ $aUsers = $oTalk - > getTalkUsers ( ) }
{ * Кол-во участников диалога * }
{ $iUsersCount = count ( $aUsers ) }
<tr class="message-list-item { if $oAuthor - > getCommentCountNew ( ) or ! $oAuthor - > getDateLast ( ) } message-unread { /if } js-message-list-item" data-id=" { $oTalk - > getId ( ) } ">
{ * Выделение * }
<td class="cell-checkbox">
<input type="checkbox" name="talk_select[ { $oTalk - > getId ( ) } ]" data-id=" { $oTalk - > getId ( ) } " />
</td>
{ * Избранное * }
<td class="cell-favourite">
2014-04-28 13:34:54 +03:00
{ include 'components/favourite/favourite.tpl' sClasses = 'js-favourite-talk' oObject = $oTalk }
2014-04-03 13:48:18 +03:00
</td>
{ * Основная информация о диалоге * }
<td class="cell-info">
<div class="message-list-info">
{ * Участники диалога * }
{ if $iUsersCount > 2 }
<a href=" { router page = 'talk' } read/ { $oTalk - > getId ( ) } /" class="message-list-info-avatar">
<img src=" { cfg name = "path.skin.web" } /assets/images/avatars/avatar_male_64x64.png" />
</a>
{ $iUsersCount } участника
{ else }
{ * Если участников двое, то отображаем только собеседника * }
{ foreach $aUsers as $oUser }
{ $oUser = $oUser - > getUser ( ) }
{ if $oUser - > getUserId ( ) ! = $oUserCurrent - > getId ( ) }
<a href=" { $oUser - > getUserWebPath ( ) } " class="message-list-info-avatar">
<img src=" { $oUser - > getProfileAvatarPath ( 6 4 ) } " alt=" { $oUser - > getLogin ( ) } " />
</a>
<a href=" { $oUser - > getUserWebPath ( ) } " class="word-wrap"> { $oUser - > getDisplayName ( ) } </a>
{ /if }
{ /foreach }
{ /if }
{ * Дата * }
<time class="message-list-info-date" datetime=" { date_format date = $oTalk - > getDate ( ) format = 'c' } " title=" { date_format date = $oTalk - > getDate ( ) format = 'j F Y, H:i' } ">
{ date_format date = $oTalk - > getDate ( ) hours_back = "12" minutes_back = "60" now = "60" day = "day H:i" format = "j F Y, H:i" }
</time>
2014-04-03 10:42:13 +03:00
</div>
2014-04-03 13:48:18 +03:00
</td>
{ * Заголовок и текст последнего сообщения * }
<td>
<div class="message-list-item-extra">
{ * Заголовок * }
<h2 class="message-list-item-title">
<a href=" { router page = 'talk' } read/ { $oTalk - > getId ( ) } /">
{ $oTalk - > getTitle ( ) | escape : 'html' }
</a>
</h2>
{ * Текст последнего сообщения * }
<div class="message-list-item-text">
{ ( ( $oTalk - > getCommentLast ( ) ) ? $oTalk - > getCommentLast ( ) - > getText ( ) : $oTalk - > getText ( ) ) | strip_tags | truncate : 1 2 0 : "..." | escape }
</div>
2014-04-03 10:42:13 +03:00
2014-04-03 13:48:18 +03:00
{ * Кол-во сообщений * }
{ if $oTalk - > getCountComment ( ) }
<div class="message-list-item-count">
{ $oTalk - > getCountComment ( ) }
2014-02-06 11:44:27 +02:00
2014-04-03 13:48:18 +03:00
{ if $oAuthor - > getCommentCountNew ( ) }
<strong>+ { $oAuthor - > getCommentCountNew ( ) } </strong>
{ /if }
</div>
{ /if }
</div>
</td>
</tr>
{ /foreach }
</tbody>
</table>
</form>
2014-02-06 11:44:27 +02:00
{ else }
2014-07-22 19:16:27 +03:00
{ include 'components/alert/alert.tpl' mAlerts = $aLang.talk.alerts.empty sMods = 'empty' }
{ /if }
{ include 'components/pagination/pagination.tpl' aPaging = $aPaging }