2014-07-28 19:55:18 +03:00
|
|
|
|
{**
|
|
|
|
|
* Базовый шаблон топика
|
2014-07-30 13:21:12 +03:00
|
|
|
|
* Используется также для отображения превью топика
|
2014-07-28 19:55:18 +03:00
|
|
|
|
*
|
2014-07-30 13:21:12 +03:00
|
|
|
|
* @param object $topic
|
|
|
|
|
* @param boolean $isList
|
|
|
|
|
* @param boolean $isPreview
|
2014-07-28 19:55:18 +03:00
|
|
|
|
*}
|
|
|
|
|
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{$component = 'ls-topic'}
|
2016-04-07 12:40:28 +03:00
|
|
|
|
{component_define_params params=[ 'type', 'topic', 'isPreview', 'isList', 'mods', 'classes', 'attributes' ]}
|
2015-06-10 19:02:06 +03:00
|
|
|
|
|
|
|
|
|
{$user = $topic->getUser()}
|
2016-04-07 12:40:28 +03:00
|
|
|
|
{$type = ($topic->getType()) ? $topic->getType() : $type}
|
2015-06-10 19:02:06 +03:00
|
|
|
|
|
|
|
|
|
{if ! $isList}
|
|
|
|
|
{$mods = "{$mods} single"}
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{$classes = "{$classes} topic js-topic"}
|
|
|
|
|
|
|
|
|
|
{block 'topic_options'}{/block}
|
|
|
|
|
|
|
|
|
|
<article class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
|
|
|
|
|
{**
|
|
|
|
|
* Хидер
|
|
|
|
|
*}
|
|
|
|
|
{block 'topic_header'}
|
|
|
|
|
<header class="{$component}-header">
|
2016-10-10 18:51:04 +03:00
|
|
|
|
{$_headingTag = ($isList) ? Config::Get('view.seo.topic_heading_list') : Config::Get('view.seo.topic_heading')}
|
2016-10-04 07:56:16 +03:00
|
|
|
|
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{* Заголовок *}
|
2016-10-04 07:56:16 +03:00
|
|
|
|
<{$_headingTag} class="{$component}-title ls-word-wrap">
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{block 'topic_title'}
|
|
|
|
|
{if $topic->getPublish() == 0}
|
|
|
|
|
{component 'icon' icon='file' attributes=[ title => {lang 'topic.is_draft'} ]}
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{if $isList}
|
|
|
|
|
<a href="{$topic->getUrl()}">{$topic->getTitle()|escape}</a>
|
|
|
|
|
{else}
|
|
|
|
|
{$topic->getTitle()|escape}
|
|
|
|
|
{/if}
|
|
|
|
|
{/block}
|
2016-10-04 07:56:16 +03:00
|
|
|
|
</{$_headingTag}>
|
2015-06-10 19:02:06 +03:00
|
|
|
|
|
|
|
|
|
{* Информация *}
|
|
|
|
|
<ul class="{$component}-info">
|
|
|
|
|
{block 'topic_header_info'}
|
|
|
|
|
{if ! $isPreview}
|
|
|
|
|
{foreach $topic->getBlogs() as $blog}
|
|
|
|
|
{if $blog->getType() != 'personal'}
|
|
|
|
|
<li class="{$component}-info-item {$component}-info-item--blog">
|
|
|
|
|
<a href="{$blog->getUrlFull()}">{$blog->getTitle()|escape}</a>
|
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
|
|
|
|
{/foreach}
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<li class="{$component}-info-item {$component}-info-item--date">
|
|
|
|
|
<time datetime="{date_format date=$topic->getDatePublish() format='c'}" title="{date_format date=$topic->getDatePublish() format='j F Y, H:i'}">
|
|
|
|
|
{date_format date=$topic->getDatePublish() format="j F Y, H:i"}
|
|
|
|
|
</time>
|
|
|
|
|
</li>
|
|
|
|
|
{/block}
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
{* Управление *}
|
|
|
|
|
{if $topic->getIsAllowAction() && ! $isPreview}
|
|
|
|
|
{block 'topic_header_actions'}
|
|
|
|
|
{$items = [
|
|
|
|
|
[ 'icon' => 'edit', 'url' => $topic->getUrlEdit(), 'text' => $aLang.common.edit, 'show' => $topic->getIsAllowEdit() ],
|
2015-10-11 17:47:50 +03:00
|
|
|
|
[ 'icon' => 'trash', 'url' => "{$topic->getUrlDelete()}?security_ls_key={$LIVESTREET_SECURITY_KEY}", 'text' => $aLang.common.remove, 'show' => $topic->getIsAllowDelete(), 'classes' => 'js-confirm-remove-default' ]
|
2015-06-10 19:02:06 +03:00
|
|
|
|
]}
|
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
|
|
{component 'actionbar' items=[[ 'buttons' => $items ]]}
|
|
|
|
|
{/if}
|
|
|
|
|
</header>
|
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{**
|
|
|
|
|
* Текст
|
|
|
|
|
*}
|
|
|
|
|
{block 'topic_body'}
|
|
|
|
|
{* Превью *}
|
2016-06-06 20:26:41 +03:00
|
|
|
|
{$previewImage = $topic->getPreviewImageWebPath(Config::Get('module.topic.default_preview_size'))}
|
2015-06-10 19:02:06 +03:00
|
|
|
|
|
|
|
|
|
{if $previewImage}
|
2016-03-31 10:17:08 +03:00
|
|
|
|
<div class="ls-topic-preview-image">
|
2015-06-10 19:02:06 +03:00
|
|
|
|
<img src="{$previewImage}" />
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<div class="{$component}-content">
|
|
|
|
|
<div class="{$component}-text ls-text">
|
|
|
|
|
{block 'topic_content_text'}
|
|
|
|
|
{if $isList and $topic->getTextShort()}
|
|
|
|
|
{$topic->getTextShort()}
|
|
|
|
|
{else}
|
|
|
|
|
{$topic->getText()}
|
|
|
|
|
{/if}
|
|
|
|
|
{/block}
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{* Кат *}
|
|
|
|
|
{if $isList && $topic->getTextShort()}
|
|
|
|
|
{component 'button'
|
|
|
|
|
classes = "{$component}-cut"
|
|
|
|
|
url = "{$topic->getUrl()}#cut"
|
|
|
|
|
text = "{$topic->getCutText()|default:$aLang.topic.read_more}"}
|
|
|
|
|
{/if}
|
|
|
|
|
</div>
|
2014-07-28 19:55:18 +03:00
|
|
|
|
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{* Дополнительные поля *}
|
|
|
|
|
{block 'topic_content_properties'}
|
|
|
|
|
{if ! $isList}
|
|
|
|
|
{component 'property' template='output.list' properties=$topic->property->getPropertyList()}
|
|
|
|
|
{/if}
|
|
|
|
|
{/block}
|
2014-07-28 19:55:18 +03:00
|
|
|
|
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{* Опросы *}
|
|
|
|
|
{block 'topic_content_polls'}
|
|
|
|
|
{if ! $isList}
|
|
|
|
|
{component 'poll' template='list' polls=$topic->getPolls()}
|
|
|
|
|
{/if}
|
|
|
|
|
{/block}
|
|
|
|
|
{/block}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{**
|
|
|
|
|
* Футер
|
|
|
|
|
*}
|
|
|
|
|
{block 'topic_footer'}
|
|
|
|
|
{if ! $isList && $topic->getTypeObject()->getParam('allow_tags')}
|
|
|
|
|
{$favourite = $topic->getFavourite()}
|
|
|
|
|
|
|
|
|
|
{if ! $isPreview}
|
2015-11-23 12:05:14 +02:00
|
|
|
|
{component 'tags-personal'
|
2015-10-14 18:08:56 +03:00
|
|
|
|
classes = 'js-tags-favourite'
|
2015-11-23 12:05:14 +02:00
|
|
|
|
tags = $topic->getTagsObjects()
|
|
|
|
|
tagsPersonal = ( $favourite ) ? $favourite->getTagsObjects() : []
|
2015-06-10 19:02:06 +03:00
|
|
|
|
isEditable = ! $favourite
|
|
|
|
|
targetType = 'topic'
|
2015-11-23 12:05:14 +02:00
|
|
|
|
targetId = $topic->getId()}
|
2014-12-30 18:38:04 +02:00
|
|
|
|
{/if}
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
<footer class="{$component}-footer">
|
|
|
|
|
{* Информация *}
|
|
|
|
|
{block 'topic_footer_info'}
|
2015-10-28 13:00:45 +02:00
|
|
|
|
<ul class="{$component}-info ls-clearfix">
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{block 'topic_footer_info_items'}
|
|
|
|
|
{* Голосование *}
|
|
|
|
|
{if ! $isPreview}
|
|
|
|
|
<li class="{$component}-info-item {$component}-info-item--vote">
|
|
|
|
|
{$isExpired = strtotime($topic->getDatePublish()) < $smarty.now - Config::Get('acl.vote.topic.limit_time')}
|
|
|
|
|
|
|
|
|
|
{component 'vote'
|
|
|
|
|
target = $topic
|
|
|
|
|
classes = 'js-vote-topic'
|
|
|
|
|
mods = 'small white topic'
|
|
|
|
|
useAbstain = true
|
|
|
|
|
isLocked = ( $oUserCurrent && $topic->getUserId() == $oUserCurrent->getId() ) || $isExpired
|
|
|
|
|
showRating = $topic->getVote() || ($oUserCurrent && $topic->getUserId() == $oUserCurrent->getId()) || $isExpired}
|
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{* Автор топика *}
|
|
|
|
|
<li class="{$component}-info-item {$component}-info-item--author">
|
|
|
|
|
{component 'user' template='avatar' user=$user size='xsmall' mods='inline'}
|
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
{* Ссылка на комментарии *}
|
|
|
|
|
{* Не показываем если комментирование запрещено и кол-во комментариев равно нулю *}
|
|
|
|
|
{if $isList && ( ! $topic->getForbidComment() || ( $topic->getForbidComment() && $topic->getCountComment() ) )}
|
|
|
|
|
<li class="{$component}-info-item {$component}-info-item--comments">
|
|
|
|
|
<a href="{$topic->getUrl()}#comments">
|
|
|
|
|
{lang name='comments.comments_declension' count=$topic->getCountComment() plural=true}
|
|
|
|
|
</a>
|
|
|
|
|
|
|
|
|
|
{if $topic->getCountCommentNew()}<span>+{$topic->getCountCommentNew()}</span>{/if}
|
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
|
|
|
|
|
|
|
|
|
{if ! $isList && ! $isPreview}
|
|
|
|
|
{* Избранное *}
|
|
|
|
|
<li class="{$component}-info-item {$component}-info-item--favourite">
|
2015-11-22 06:56:55 +02:00
|
|
|
|
{component 'favourite' classes="js-favourite-topic" target=$topic attributes=[ 'data-param-target_type' => $type ]}
|
2015-06-10 19:02:06 +03:00
|
|
|
|
</li>
|
|
|
|
|
|
|
|
|
|
{* Поделиться *}
|
|
|
|
|
<li class="{$component}-info-item {$component}-info-item--share">
|
|
|
|
|
{component 'icon' icon='share'
|
|
|
|
|
classes="js-popover-default"
|
|
|
|
|
attributes=[
|
|
|
|
|
'title' => {lang 'topic.share'},
|
|
|
|
|
'data-tooltip-target' => "#topic_share_{$topic->getId()}"
|
|
|
|
|
]}
|
|
|
|
|
</li>
|
|
|
|
|
{/if}
|
|
|
|
|
{/block} {* /topic_footer_info_items *}
|
|
|
|
|
</ul>
|
|
|
|
|
{/block} {* /topic_footer_info *}
|
|
|
|
|
</footer>
|
|
|
|
|
|
|
|
|
|
{* Всплывающий блок появляющийся при нажатии на кнопку Поделиться *}
|
2016-06-11 22:49:35 +03:00
|
|
|
|
{if ! $isList && ! $isPreview}
|
2015-06-10 19:02:06 +03:00
|
|
|
|
<div class="ls-tooltip" id="topic_share_{$topic->getId()}">
|
|
|
|
|
<div class="ls-tooltip-content js-ls-tooltip-content">
|
|
|
|
|
{hookb run="topic_share" topic=$topic isList=$isList}
|
2015-06-16 07:07:32 +03:00
|
|
|
|
<div class="yashare-auto-init" data-yashareTitle="{$topic->getTitle()|escape}" data-yashareLink="{$topic->getUrl()}" data-yashareL10n="ru" data-yashareType="small" data-yashareTheme="counter" data-yashareQuickServices="yaru,vkontakte,facebook,twitter,odnoklassniki,moimir,gplus"></div>
|
2015-06-10 19:02:06 +03:00
|
|
|
|
{/hookb}
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
{/if}
|
|
|
|
|
{/block} {* /topic_footer *}
|
2016-03-31 10:17:08 +03:00
|
|
|
|
</article>
|