7 changed files with 80 additions and 442 deletions
@ -1,67 +0,0 @@
|
||||
{** |
||||
* Навигация |
||||
* |
||||
* @param string $hook |
||||
* @param array $hookParams |
||||
* @param array $items |
||||
* @param string $activeItem |
||||
* @param boolean $showSingle |
||||
* @param boolean $isSubnav |
||||
* @param string $mods |
||||
* @param string $classes |
||||
* @param array $attributes |
||||
*} |
||||
|
||||
{* Название компонента *} |
||||
{$component = 'ls-nav'} |
||||
{component_define_params params=[ 'hook', 'hookParams', 'items', 'activeItem', 'showSingle', 'isSubnav', 'items', 'mods', 'classes', 'attributes' ]} |
||||
|
||||
{* Получаем пункты установленные плагинами *} |
||||
{if $hook} |
||||
{hook run="nav_{$hook}" assign='hookItems' params=$hookParams items=$items array=true} |
||||
{$items = ( $hookItems ) ? $hookItems : $items} |
||||
{/if} |
||||
|
||||
{* Считаем кол-во неактивных пунктов *} |
||||
{$disabledItemsCounter = 0} |
||||
|
||||
{foreach $items as $item} |
||||
{$disabledItemsCounter = $disabledItemsCounter + ( ! $item['is_enabled']|default:true && $item['name'] != '-' )} |
||||
{/foreach} |
||||
|
||||
{$classes = "{$classes}"} |
||||
|
||||
{if $isSubnav} |
||||
{$mods = "$mods sub"} |
||||
{else} |
||||
{$mods = "$mods root"} |
||||
{/if} |
||||
|
||||
{* Smarty-блок для изменения опций *} |
||||
{block 'nav_options'}{/block} |
||||
|
||||
{* Отображем меню только если есть активные пункты *} |
||||
{if count( $items ) - $disabledItemsCounter - ( ( $showSingle|default:true ) ? 0 : 1 )} |
||||
<ul class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}> |
||||
{foreach $items as $item} |
||||
{$isEnabled = $item[ 'is_enabled' ]} |
||||
|
||||
{if $item['html']} |
||||
{$item['html']} |
||||
{else} |
||||
{if $isEnabled|default:true} |
||||
{if $item['name'] != '-'} |
||||
{component 'nav' template='item' |
||||
isRoot = !$isSubnav |
||||
activeItem = $activeItem |
||||
isActive = ($activeItem && $activeItem == $item['name']) |
||||
params = $item} |
||||
{else} |
||||
{* Разделитель *} |
||||
<li class="{$component}-separator"></li> |
||||
{/if} |
||||
{/if} |
||||
{/if} |
||||
{/foreach} |
||||
</ul> |
||||
{/if} |
@ -1,22 +0,0 @@
|
||||
{** |
||||
* Список топиков |
||||
* |
||||
* @param array $topics |
||||
* @param array $paging |
||||
*} |
||||
|
||||
{component_define_params params=[ 'topics', 'paging' ]} |
||||
|
||||
{if $topics} |
||||
{add_block group='toolbar' name='component@toolbar-scrollnav.toolbar.scrollnav' show=count( $topics )} |
||||
|
||||
<div class="ifhub-content"> |
||||
{foreach $topics as $topic} |
||||
{component 'topic' template='type' topic=$topic isList=true} |
||||
{/foreach} |
||||
</div> |
||||
|
||||
{component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}" classes='js-pagination-topics'} |
||||
{else} |
||||
{component 'blankslate' text=$aLang.common.empty} |
||||
{/if} |
@ -1,221 +0,0 @@
|
||||
{** |
||||
* Базовый шаблон топика |
||||
* Используется также для отображения превью топика |
||||
* |
||||
* @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}> |
||||
{** |
||||
* Хидер |
||||
*} |
||||
{block 'topic_header'} |
||||
<header class="{$component}-header"> |
||||
{$_headingTag = ($isList) ? Config::Get('view.seo.topic_heading_list') : Config::Get('view.seo.topic_heading')} |
||||
|
||||
{* Заголовок *} |
||||
<{$_headingTag} class="{$component}-title ls-word-wrap"> |
||||
{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} |
||||
</{$_headingTag}> |
||||
|
||||
{* Информация *} |
||||
<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} |
||||
|
||||
{$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}"> |
||||
{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() ], |
||||
[ '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} |
||||
</header> |
||||
{/block} |
||||
|
||||
|
||||
{** |
||||
* Текст |
||||
*} |
||||
{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 ! $isList && $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' |
||||
mods = 'small white topic' |
||||
useAbstain = true |
||||
isLocked = ( $oUserCurrent && $topic->getUserId() == $oUserCurrent->getId() ) || $isExpired |
||||
showRating = $topic->getVote() || ($oUserCurrent && $topic->getUserId() == $oUserCurrent->getId()) || $isExpired} |
||||
</li> |
||||
{/if} |
||||
|
||||
{* Не показываем если комментирование запрещено и кол-во комментариев равно нулю *} |
||||
{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} |
||||
|
||||
{* Автор топика *} |
||||
<li class="{$component}-info-item {$component}-info-item--author"> |
||||
{component 'user' template='avatar' user=$user size='xsmall' mods='inline'} |
||||
</li> |
||||
|
||||
{* Ссылка на комментарии *} |
||||
|
||||
{if ! $isList && ! $isPreview} |
||||
{* Избранное *} |
||||
<li class="{$component}-info-item {$component}-info-item--favourite"> |
||||
{component 'favourite' classes="js-favourite-topic" target=$topic attributes=[ 'data-param-target_type' => $type ]} |
||||
</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> |
||||
|
||||
{* Всплывающий блок появляющийся при нажатии на кнопку Поделиться *} |
||||
{if ! $isList && ! $isPreview} |
||||
<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> |
Loading…
Reference in new issue