1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-19 09:18:18 +03:00
ifhub.club/application/frontend/skin/synio/components/blog/blog.tpl
2016-09-03 09:39:46 +07:00

56 lines
2.5 KiB
Smarty
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{**
* Блог
*
* @param object $blog Блог
* @param object $blogs Список блогов для переноса топиков (для модальника удаления)
* @param string $mods Модификаторы
* @param string $attributes Дополнительные атрибуты основного блока
* @param string $classes Дополнительные классы
*}
{* Название компонента *}
{$component = 'blog'}
{component_define_params params=[ 'blog', 'blogs', 'mods', 'classes', 'attributes' ]}
{* Подключаем модальное окно удаления блога если пользователь админ *}
{if $oUserCurrent && $oUserCurrent->isAdministrator()}
{component 'blog' template='modal.delete' blog=$blog blogs=$blogs}
{/if}
{* Является ли пользователь администратором или управляющим блога *}
{$isBlogAdmin = $oUserCurrent && ($oUserCurrent->getId() == $blog->getOwnerId() || $oUserCurrent->isAdministrator() || $blog->getUserIsAdministrator())}
{* Блог *}
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes} data-id="{$blog->getId()}">
<header class="{$component}-header">
{* Заголовок *}
<h2 class="page-header blog-title">
{if $blog->getType() == 'close'}
{component 'syn-icon' icon='lock' attributes=[ title => {lang 'blog.private'} ]}
{/if}
{$blog->getTitle()|escape}
</h2>
</header>
{* Информация о блоге *}
<div class="{$component}-content">
{* Описание *}
<div class="{$component}-description ls-text">
{$blog->getDescription()}
</div>
{* Информация *}
{$info = [
[ 'label' => $aLang.blog.date_created, 'content' => "{date_format date=$blog->getDateAdd() hours_back='12' minutes_back='60' now='60' day='day H:i' format='j F Y'}" ],
[ 'label' => $aLang.blog.topics_total, 'content' => $blog->getCountTopic() ],
[ 'label' => $aLang.blog.rating_limit, 'content' => $blog->getLimitRatingTopic() ]
]}
{if $blog->category->getCategory()}
{$info[] = [ 'label' => "{$aLang.blog.categories.category}:", 'content' => $blog->category->getCategory()->getTitle() ]}
{/if}
{component 'info-list' list=$info}
</div>
</div>