2016-09-18 19:37:14 +03:00
{ * *
* Базовый шаблон топика
* Используется также для отображения превью топика
*
* @param object $topic
* @param boolean $isList
* @param boolean $isPreview
*}
{ $component = 'ls-topic' }
{ component_define_params params = [ 'type' , 'topic' , 'isPreview' , 'isList' , 'mods' , 'classes' , 'attributes' ] }
{ $user = $topic - > getUser ( ) }
{ $type = ( $topic - > getType ( ) ) ? $topic - > getType ( ) : $type }
{ 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 } >
{ * *
* Хидер
*}
<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
2016-09-18 19:37:14 +03:00
{ * Заголовок * }
2016-10-04 07:56:16 +03:00
< { $_headingTag } class=" { $component } -title ls-word-wrap">
2016-09-18 19:37:14 +03:00
{ block 'topic_title' }
{ if $topic - > getPublish ( ) = = 0 }
2016-10-04 07:40:49 +03:00
{ component 'syn-icon' icon = 'draft' attributes = [ title = > { lang 'topic.is_draft' } ] }
2016-09-18 19:37:14 +03:00
{ /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 } >
2016-09-18 19:37:14 +03:00
{ * Блоги * }
{ $_blogs = [ ] }
{ if ! $isPreview }
{ foreach $topic - > getBlogs ( ) as $blog }
{ if $blog - > getType ( ) ! = 'personal' }
{ $_blogs [ ] = [ title = > $blog - > getTitle ( ) | escape , url = > $blog - > getUrlFull ( ) ] }
{ /if }
{ /foreach }
{ /if }
{ if $_blogs }
2017-02-14 15:25:29 +02:00
<ul class=" { $component } -blogs ls-clearfix">
2016-09-18 19:37:14 +03:00
{ foreach $_blogs as $blog }
2017-02-14 15:25:29 +02:00
<li class=" { $component } -blogs-item"><a href=" { $blog.url } "> { $blog.title } </a> { if ! $blog @ last } , { /if } </li>
2016-09-18 19:37:14 +03:00
{ /foreach }
</ul>
{ /if }
</header>
{ * Управление * }
{ if $topic - > getIsAllowAction ( ) & & ! $isPreview }
{ block 'topic_header_actions' }
{ $items = [
[ 'icon' => 'edit', 'url' => $topic->getUrlEdit(), 'text' => $aLang.common.edit, 'show' => $topic->getIsAllowEdit() ],
[ 'icon' => 'trash', 'url' => " { $topic - > getUrlDelete ( ) } ?security_ls_key= { $LIVESTREET_SECURITY_KEY } ", 'text' => $aLang.common.remove, 'show' => $topic->getIsAllowDelete(), 'classes' => 'js-confirm-remove-default' ]
]}
{ /block }
{ component 'actionbar' items = [ [ 'buttons' = > $items ] ] }
{ /if }
{ * *
* Текст
*}
{ block 'topic_body' }
{ * Превью * }
{ $previewImage = $topic - > getPreviewImageWebPath ( Config : : Get ( 'module.topic.default_preview_size' ) ) }
{ if $previewImage }
<div class="ls-topic-preview-image">
<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>
{ * Дополнительные поля * }
{ block 'topic_content_properties' }
{ if ! $isList }
{ component 'property' template = 'output.list' properties = $topic - > property - > getPropertyList ( ) }
{ /if }
{ /block }
{ * Опросы * }
{ block 'topic_content_polls' }
{ if ! $isList }
{ component 'poll' template = 'list' polls = $topic - > getPolls ( ) }
{ /if }
{ /block }
{ /block }
{ * *
* Футер
*}
{ block 'topic_footer' }
{ if $topic - > getTypeObject ( ) - > getParam ( 'allow_tags' ) }
{ $favourite = $topic - > getFavourite ( ) }
{ if ! $isPreview }
{ component 'tags-personal'
classes = 'js-tags-favourite'
tags = $topic->getTagsObjects()
tagsPersonal = ( $favourite ) ? $favourite->getTagsObjects() : []
isEditable = ! $favourite
targetType = 'topic'
targetId = $topic->getId()}
{ /if }
{ /if }
<footer class=" { $component } -footer">
{ * Информация * }
{ block 'topic_footer_info' }
<ul class=" { $component } -info ls-clearfix">
{ 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'
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 = 'text' mods = 'inline' }
</li>
{ * Дата * }
2017-07-24 10:10:24 +03:00
{ $isDeferred = ( strtotime ( $topic - > getDatePublish ( ) ) > time ( ) ) ? true : false }
<li class=" { $component } -info-item { $component } -info-item--date { if $isDeferred } --deferred { /if } ">
<time datetime=" { date_format date = $topic - > getDatePublish ( ) format = 'c' } " title=" { if $isDeferred } { lang 'topic.is_deferred' } { else } { date_format date = $topic - > getDatePublish ( ) format = 'j F Y, H:i' } { /if } ">
2016-09-18 19:37:14 +03:00
{ date_format date = $topic - > getDatePublish ( ) format = "j F Y, H:i" }
</time>
</li>
{ if ! $isPreview }
{ * Поделиться * }
<li class=" { $component } -info-item { $component } -info-item--share">
2016-09-25 19:03:59 +03:00
<i class=" { $component } -share js-popover-default" title=" { lang 'topic.share' } " data-tooltip-target="#topic_share_ { $topic - > getId ( ) } "></i>
</li>
{ * Избранное * }
<li class=" { $component } -info-item { $component } -info-item--favourite">
{ component 'favourite' classes = "js-favourite-topic {$component}-favourite" target = $topic attributes = [ 'data-param-target_type' = > $type ] }
2016-09-18 19:37:14 +03:00
</li>
{ /if }
{ * Ссылка на комментарии * }
{ * Н е показываем если комментирование запрещено и кол-во комментариев равно нулю * }
{ $_countCommentNew = $topic - > getCountCommentNew ( ) }
{ if $isList & & ( ! $topic - > getForbidComment ( ) | | ( $topic - > getForbidComment ( ) & & $topic - > getCountComment ( ) ) ) }
<li class=" { $component } -info-item { $component } -info-item--comments { if $_countCommentNew } { $component } -info-item--comments--has-new { /if } ">
<a href=" { $topic - > getUrl ( ) } #comments">
<span class=" { $component } -info-item--comments-count"> { $topic - > getCountComment ( ) } </span>
{ if $_countCommentNew }
<span class=" { $component } -info-item--comments-new">+ { $_countCommentNew } </span>
{ /if }
</a>
</li>
{ /if }
{ /block } { * /topic_footer_info_items * }
</ul>
{ /block } { * /topic_footer_info * }
</footer>
{ * Всплывающий блок появляющийся при нажатии на кнопку Поделиться * }
2016-09-25 19:03:59 +03:00
{ if ! $isPreview }
2016-09-18 19:37:14 +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 }
<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>
{ /hookb }
</div>
</div>
{ /if }
{ /block } { * /topic_footer * }
</article>