1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-26 03:30:48 +03:00

Мелкие доработки

This commit is contained in:
Denis Shakhov 2016-01-19 09:34:44 +07:00
parent 70006480b3
commit b38c2e12f3
51 changed files with 177 additions and 176 deletions

View file

@ -524,7 +524,7 @@ class ActionBlog extends Action
*/
$aPaging = $this->Viewer_MakePaging($aResult['count'], $iPage, Config::Get('module.blog.users_per_page'),
Config::Get('pagination.pages.count'), Router::GetPath('blog') . "admin/{$oBlog->getId()}");
$this->Viewer_Assign('paging', $aPaging);
$this->Viewer_Assign('pagination', $aPaging);
/**
* Устанавливаем title страницы
*/

View file

@ -11,27 +11,28 @@
*}
{$component = 'activity'}
{$jsprefix = 'js-activity'}
{component_define_params params=[ 'events' 'count', 'targetId', 'mods', 'classes', 'attributes' ]}
{$events = $smarty.local.events}
{$moreCount = $smarty.local.count - count($events)}
{$moreCount = $count - count($events)}
<div class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}" {cattr list=$smarty.local.attributes}>
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
{if $events}
{* Список *}
<ul class="activity-event-list js-activity-event-list">
<ul class="activity-event-list {$jsprefix}-event-list">
{component 'activity' template='event-list' events=$events}
</ul>
{* Кнопка подгрузки *}
{if $smarty.local.count > Config::Get('module.stream.count_default')}
{if $count > Config::Get('module.stream.count_default')}
{$last = end($events)}
{component 'more'
count = $moreCount
classes = 'js-activity-more'
classes = "{$jsprefix}-more"
ajaxParams = [
'last_id' => $last->getId(),
'target_id' => $smarty.local.targetId
'target_id' => $targetId
]}
{/if}
{else}

View file

@ -2,6 +2,8 @@
* Последняя активность
*}
{component_define_params params=[ 'content' ]}
{* Подвал *}
{capture 'block_footer'}
<a href="{router page='rss'}allcomments/">{lang 'activity.block_recent.feed'}</a>
@ -16,7 +18,7 @@
tabs = [
'classes' => 'js-tabs-block js-activity-block-recent-tabs',
'tabs' => [
[ 'text' => {lang 'activity.block_recent.comments'}, 'url' => "{router page='ajax'}stream/comment", 'list' => $smarty.local.content ],
[ 'text' => {lang 'activity.block_recent.comments'}, 'url' => "{router page='ajax'}stream/comment", 'list' => $content ],
[ 'text' => {lang 'activity.block_recent.topics'}, 'url' => "{router page='ajax'}stream/topic" ]
]
]}

View file

@ -3,14 +3,15 @@
* Топики отсортированные по времени последнего комментария
*}
{component_define_params params=[ 'comments' ]}
{capture 'items'}
{foreach $smarty.local.comments as $comment}
{foreach $comments as $comment}
{$topic = $comment->getTarget()}
{component 'activity' template='recent-item'
user = $comment->getUser()
topic = $topic
blog = $topic->getBlog()
date = $comment->getDate()}
{foreachelse}
{component 'blankslate' text={lang 'common.empty'} mods='no-background'}

View file

@ -1,10 +1,12 @@
{component_define_params params=[ 'user', 'topic', 'date' ]}
{capture 'item_content'}
<a href="{$user->getUserWebPath()}" class="ls-activity-block-recent-user">{$user->getDisplayName()}</a> &rarr;
<a href="{$topic->getUrl()}">{$topic->getTitle()|escape}</a>
<p class="ls-activity-block-recent-info">
<time datetime="{date_format date=$smarty.local.date format='c'}" class="ls-activity-block-recent-time">
{date_format date=$smarty.local.date hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y"}
<time datetime="{date_format date=$date format='c'}" class="ls-activity-block-recent-time">
{date_format date=$date hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y"}
</time>
<a href="{$topic->getUrl()}#comments" class="ls-activity-block-recent-comments">

View file

@ -3,12 +3,13 @@
* Последние топики
*}
{component_define_params params=[ 'topics' ]}
{capture 'items'}
{foreach $smarty.local.topics as $topic}
{foreach $topics as $topic}
{component 'activity' template='recent-item'
user = $topic->getUser()
topic = $topic
blog = $topic->getBlog()
date = $topic->getDatePublish()}
{foreachelse}
{component 'blankslate' text={lang 'common.empty'} mods='no-background'}

View file

@ -5,11 +5,13 @@
* @param string $dateLast Дата предыдущего сообщения
*}
{component_define_params params=[ 'dateLast', 'events' ]}
{* Дата последнего события *}
{$dateLast = ( $smarty.local.dateLast ) ? {date_format date=$smarty.local.dateLast format="Y-m-d" notz=1} : false}
{$dateLast = ( $dateLast ) ? {date_format date=$dateLast format="Y-m-d" notz=1} : false}
{$dateNow = {date_format date=$smarty.now format="Y-m-d" notz=1}}
{foreach $smarty.local.events as $event}
{foreach $events as $event}
{$dateAdded = {date_format date=$event->getDateAdded() format="Y-m-d" notz=1}}
{* Дата группы событий *}

View file

@ -5,8 +5,8 @@
*}
{$component = 'activity-event'}
{component_define_params params=[ 'event' ]}
{$event = $smarty.local.event}
{$type = $event->getEventType()}
{$target = $event->getTarget()}
{$user = $event->getUser()}

View file

@ -5,6 +5,8 @@
* @param array $typesActive
*}
{component_define_params params=[ 'types', 'typesActive' ]}
{if $oUserCurrent}
<div class="activity-settings js-activity-settings">
<p class="text-help">
@ -12,12 +14,12 @@
</p>
<div class="ls-field-checkbox-group">
{foreach $smarty.local.types as $type => $data}
{foreach $types as $type => $data}
{if ! (Config::Get('module.stream.disable_vote_events') && substr($type, 0, 4) == 'vote')}
{component 'field' template='checkbox'
inputClasses = 'js-activity-settings-type-checkbox'
inputAttributes = [ 'data-type' => $type ]
checked = in_array( $type, $smarty.local.typesActive )
checked = in_array( $type, $typesActive )
label = $aLang.activity.settings.options[ $type ]}
{/if}
{/foreach}

View file

@ -4,7 +4,9 @@
* @param array $users
*}
{component_define_params params=[ 'users' ]}
{component 'user-list-add'
users = $smarty.local.users
users = $users
classes = 'js-activity-users'
note = $aLang.activity.users.note}

View file

@ -4,9 +4,11 @@
* @param array $plugins Список плагинов
*}
{component_define_params params=[ 'plugins' ]}
<table class="ls-table admin-plugins">
<tbody>
{foreach $smarty.local.plugins as $plugin}
{foreach $plugins as $plugin}
<tr {if $plugin.is_active}class="active"{/if}>
{* Название и описание плагина *}
<td>

View file

@ -2,9 +2,12 @@
* Форма входа
*
* @param string $redirectUrl
* @param boolean $showExtra
*}
{$redirectUrl = $smarty.local.redirectUrl|default:$PATH_WEB_CURRENT}
{component_define_params params=[ 'redirectUrl', 'showExtra' ]}
{$redirectUrl = $redirectUrl|default:$PATH_WEB_CURRENT}
{hook run='login_begin'}
@ -48,7 +51,7 @@
{component 'button' name='submit_login' mods='primary' text=$aLang.auth.login.form.fields.submit.text}
</form>
{if $smarty.local.showExtra}
{if $showExtra}
<div class="ls-pt-20">
<a href="{router page='auth/register'}">{$aLang.auth.registration.title}</a><br />
<a href="{router page='auth/password-reset'}">{$aLang.auth.reset.title}</a>

View file

@ -4,7 +4,9 @@
* @param string $redirectUrl
*}
{$redirectUrl = $smarty.local.redirectUrl|default:$PATH_WEB_CURRENT}
{component_define_params params=[ 'redirectUrl' ]}
{$redirectUrl = $redirectUrl|default:$PATH_WEB_CURRENT}
{hook run='registration_begin'}

View file

@ -4,7 +4,7 @@
* @param object $blog
*}
{$blog = $smarty.local.blog}
{component_define_params params=[ 'blog' ]}
<form method="post" enctype="multipart/form-data" class="js-blog-add js-form-validate">
{hook run='form_add_blog_begin'}

View file

@ -5,7 +5,9 @@
* @param array $pagination
*}
{if $smarty.local.users}
{component_define_params params=[ 'users', 'pagination' ]}
{if $users}
<form method="post" enctype="multipart/form-data">
<table class="ls-table">
<thead>
@ -19,7 +21,7 @@
</thead>
<tbody>
{foreach $smarty.local.users as $blogUser}
{foreach $users as $blogUser}
{$user = $blogUser->getUser()}
<tr>
@ -47,7 +49,7 @@
{component 'button' name='submit_blog_admin' text=$aLang.common.save mods='primary'}
</form>
{component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}
{component 'pagination' total=+$pagination.iCountPage current=+$pagination.iCurrentPage url="{$pagination.sBaseUrl}/page__page__/{$pagination.sGetParams}"}
{else}
{component 'blankslate' text=$aLang.blog.admin.alerts.empty}
{/if}

View file

@ -2,19 +2,15 @@
* Блог
*
* @param object $blog Блог
* @param object $blogs Список блогов для переноса топиков (для модальника удаления)
* @param string $mods Модификаторы
* @param string $attributes Дополнительные атрибуты основного блока
* @param string $classes Дополнительные классы
*
* TODO: Сделать универсальным
*}
{* Название компонента *}
{$component = 'blog'}
{* Переменные *}
{$blog = $smarty.local.blog}
{$blogs = $smarty.local.blogs}
{component_define_params params=[ 'blog', 'blogs', 'mods', 'classes', 'attributes' ]}
{* Подключаем модальное окно удаления блога если пользователь админ *}
{if $oUserCurrent && $oUserCurrent->isAdministrator()}
@ -24,9 +20,8 @@
{* Является ли пользователь администратором или управляющим блога *}
{$isBlogAdmin = $oUserCurrent && ($oUserCurrent->getId() == $blog->getOwnerId() || $oUserCurrent->isAdministrator() || $blog->getUserIsAdministrator())}
{* Блог *}
<div class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}" data-id="{$blog->getId()}" {cattr list=$smarty.local.attributes}>
<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">
@ -38,7 +33,6 @@
</h2>
</header>
{* Информация о блоге *}
<div class="{$component}-content">
{* Описание *}

View file

@ -2,7 +2,7 @@
* Пользователь
*}
{extends 'Component@user-list-add.item'}
{extends 'component@user-list-add.item'}
{block 'user_list_add_item_actions' prepend}
{* Кнопка "Повторно отправить инвайт" *}

View file

@ -2,7 +2,7 @@
* Список пользователей
*}
{extends 'Component@user-list-add.list'}
{extends 'component@user-list-add.list'}
{block 'user_list_add_item'}
{component 'blog' template='invite-item' user=$user showActions=true}

View file

@ -2,14 +2,14 @@
* Приглашение пользователей в закрытый блог
*}
{extends 'Component@user-list-add.user-list-add'}
{extends 'component@user-list-add.user-list-add'}
{block 'user_list_add_list'}
{component 'blog' template='invite-list'
hideableEmptyAlert = true
users = $smarty.local.users
users = $users
showActions = true
show = !! $smarty.local.users
show = !! $users
classes = "js-$component-users"
itemClasses = "js-$component-user"}
{/block}

View file

@ -4,6 +4,8 @@
* @param object $blog Блог
*}
{component_define_params params=[ 'blog' ]}
{if $oUserCurrent && $oUserCurrent->getId() != $blog->getOwnerId() && $blog->getType() == 'open'}
{component 'button'
attributes = [ 'data-blog-id' => $blog->getId() ]

View file

@ -1,5 +1,5 @@
/**
* Join blog
* Кнопка "Вступить в блог"
*
* @module ls/blog/join
*

View file

@ -4,8 +4,8 @@
* @param object $blog
*}
{$blog = $smarty.local.blog}
{$component = 'blog-list-item'}
{component_define_params params=[ 'blog' ]}
{* Заголовок *}
{capture 'title'}
@ -24,7 +24,7 @@
{* Описание *}
{capture 'content'}
{* Действия *}
<div class="blog-list-item-actions">
<div class="{$component}-actions">
{* Вступить/покинуть блог *}
{component 'blog' template='join' blog=$blog}
</div>

View file

@ -4,6 +4,8 @@
* @param array $blogs
*}
{foreach $smarty.local.blogs as $blog}
{component_define_params params=[ 'blogs' ]}
{foreach $blogs as $blog}
{component 'blog' template='list-item' blog=$blog}
{/foreach}

View file

@ -8,25 +8,25 @@
* @param string $textEmpty
*}
{if $smarty.local.blogs}
{$paging = $smarty.local.pagination}
{component_define_params params=[ 'blogs', 'pagination', 'useMore', 'hideMore', 'textEmpty' ]}
{if $blogs}
{* Список блогов *}
{component 'item' template='group'
classes = 'js-more-blogs-container'
items = {component 'blog' template='list-loop' blogs=$smarty.local.blogs}}
items = {component 'blog' template='list-loop' blogs=$blogs}}
{* Кнопка подгрузки *}
{if $smarty.local.useMore}
{if ! $smarty.local.hideMore}
{if $useMore}
{if ! $hideMore}
{component 'more'
classes = 'js-more-search'
target = '.js-more-blogs-container'
ajaxParams = [ 'next_page' => 2 ]}
{/if}
{else}
{component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}
{component 'pagination' total=+$pagination.iCountPage current=+$pagination.iCurrentPage url="{$pagination.sBaseUrl}/page__page__/{$pagination.sGetParams}"}
{/if}
{else}
{component 'blankslate' text=$smarty.local.textEmpty|default:{lang name='blog.alerts.empty'}}
{component 'blankslate' text=$textEmpty|default:{lang name='blog.alerts.empty'}}
{/if}

View file

@ -5,9 +5,9 @@
* @param array $blogs
*}
{capture 'modal_content'}
{$blog = $smarty.local.blog}
{component_define_params params=[ 'blog', 'blogs' ]}
{capture 'modal_content'}
<form action="{router page='blog'}delete/{$blog->getId()}/" method="POST" id="js-blog-remove-form">
{* Скрытые поля *}
{component 'field' template='hidden.security-key'}
@ -17,7 +17,7 @@
[ 'value' => -1, 'text' => "-- {$aLang.blog.remove.remove_topics} --" ]
]}
{foreach $smarty.local.blogs as $blog}
{foreach $blogs as $blog}
{$selectBlogs[] = [
'value' => $blog->getId(),
'text' => $blog->getTitle()|escape

View file

@ -2,7 +2,7 @@
* Кроп фотографии
*}
{extends 'Component@crop.crop'}
{extends 'component@crop.crop'}
{block 'modal_options' append}
{$title = {lang 'user.photo.crop_avatar.title'}}

View file

@ -1,22 +1,13 @@
{**
* Добавление в избранное
*
* @param object $target Объект сущности
* @param string $type Название сущности (blog, topic и т.д.)
* @param string $classes
* @param string $attributes
* @param string $isActive
* @param boolean $hideZeroCounter (true)
*
* TODO: Текстовая версия
* @param object $target Объект который добавляется в избранное
* @param boolean $hideZeroCounter
*}
{* Название компонента *}
{$component = 'ls-favourite'}
{* Переменные *}
{$mods = $smarty.local.mods}
{$target = $smarty.local.target}
{component_define_params params=[ 'target', 'hideZeroCounter', 'mods', 'classes', 'attributes' ]}
{* True если объект находится в избранном *}
{$isActive = $target && $target->getIsFavourite()}
@ -34,17 +25,17 @@
{/if}
<div class="{$component} {cmods name=$component mods=$mods} {if $isActive}active{/if} {$smarty.local.classes}"
<div class="{$component} {cmods name=$component mods=$mods} {if $isActive}active{/if} {$classes}"
data-param-i-target-id="{$target->getId()}"
title="{$aLang.favourite[ ($isActive) ? 'remove' : 'add' ]}"
{cattr list=$smarty.local.attributes}>
{cattr list=$attributes}>
{* Кнопка добавления/удаления из избранного *}
{component 'icon' icon='heart' classes="{$component}-toggle js-favourite-toggle"}
{* Кол-во объектов в избранном *}
{if isset( $count )}
<span class="{$component}-count js-favourite-count" {if ! $count && $smarty.local.hideZeroCounter|default:true}style="display: none;"{/if}>
<span class="{$component}-count js-favourite-count" {if ! $count && $hideZeroCounter|default:true}style="display: none;"{/if}>
{$count}
</span>
{/if}

View file

@ -1,21 +1,21 @@
{**
* Выбор блогов для чтения в ленте
*
* @param array $types
* @param array $typesActive
* @param array $blogsSubscribed
* @param array $blogsJoined
*}
{component_define_params params=[ 'blogsSubscribed', 'blogsJoined' ]}
{if $oUserCurrent}
<div class="ls-feed-blogs js-feed-blogs">
{$blogsSubscribed = $smarty.local.blogsSubscribed}
<p class="text-help">
{$aLang.feed.blogs.note}
</p>
{if $smarty.local.blogsJoined}
{if $blogsJoined}
<div class="ls-field-checkbox-group">
{foreach $smarty.local.blogsJoined as $blog}
{foreach $blogsJoined as $blog}
{component 'field' template='checkbox'
inputClasses = 'js-feed-blogs-subscribe'
inputAttributes = [ 'data-id' => $blog->getId() ]
@ -24,7 +24,7 @@
{/foreach}
</div>
{else}
{component 'alert' text=$aLang.feed.blogs.empty mods='info'}
{component 'blankslate' text=$aLang.feed.blogs.empty}
{/if}
</div>
{/if}

View file

@ -4,8 +4,10 @@
* @param array $users
*}
{component_define_params params=[ 'users' ]}
{component 'user-list-add'
users = $smarty.local.users
users = $users
classes = 'js-feed-users'
attributes = [ 'data-param-type' => 'users' ]
note = $aLang.feed.users.note}

View file

@ -8,12 +8,12 @@
{* Название компонента *}
{$component = 'ls-note'}
{component_define_params params=[ 'note', 'isEditable', 'targetId', 'mods', 'classes', 'attributes' ]}
{* Установка дефолтных значений *}
{$note = $smarty.local.note}
{$isEditable = $smarty.local.isEditable|default:true}
{$isEditable = $isEditable|default:true}
<div class="{$component} {cmods name=$component mods=$mods} {$smarty.local.classes}" data-param-user_id="{$smarty.local.targetId}" {cattr list=$smarty.local.attributes}>
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" data-param-user_id="{$targetId}" {cattr list=$attributes}>
{* Заметка *}
<div class="{$component}-body js-note-body">
{* Текст *}

View file

@ -11,26 +11,25 @@
*}
{$component = 'ls-photo'}
{component_define_params params=[ 'url', 'photoPath', 'photoAltText', 'hasPhoto', 'useAvatar', 'targetId', 'editable', 'mods', 'classes', 'attributes' ]}
{$hasPhoto = $smarty.local.hasPhoto}
{$useAvatar = $smarty.local.useAvatar|default:true}
{$mods = $smarty.local.mods}
{$useAvatar = $useAvatar|default:true}
{if ! $hasPhoto}
{$mods = "$mods nophoto"}
{/if}
<div class="{$component} {cmods name=$component mods=$mods} {$smarty.local.classes}"
data-target-id="{$smarty.local.targetId}"
{cattr list=$smarty.local.attributes}>
<div class="{$component} {cmods name=$component mods=$mods} {$classes}"
data-target-id="{$targetId}"
{cattr list=$attributes}>
{* Фото *}
<a href="{$smarty.local.url}">
<img src="{$smarty.local.photoPath}" alt="{$smarty.local.photoAltText}" class="{$component}-image js-photo-image" />
<a href="{$url}">
<img src="{$photoPath}" alt="{$photoAltText}" class="{$component}-image js-photo-image" />
</a>
{* Действия *}
{if $smarty.local.editable}
{if $editable}
<ul class="{$component}-actions">
{* Загрузить *}
<li class="{$component}-actions-upload js-photo-actions-upload">

View file

@ -4,6 +4,8 @@
* @param array $types
*}
{component_define_params params=[ 'types' ]}
{capture 'modal_content'}
<form action="" method="post" id="form-complaint-user">
{component 'field' template='hidden' name='target_id' value=$_aRequest.target_id}
@ -12,7 +14,7 @@
name = 'type'
label = {lang 'report.form.fields.type.label'}
classes = 'ls-width-full'
items = $smarty.local.types}
items = $types}
{component 'field' template='textarea'
name = 'text'

View file

@ -4,18 +4,19 @@
{* Название компонента *}
{$component = 'ls-search-form'}
{component_define_params params=[ 'action', 'method', 'placeholder', 'placeholder', 'note', 'value', 'inputClasses', 'inputAttributes', 'inputName', 'noSubmitButton', 'mods', 'classes', 'attributes' ]}
<form action="{$smarty.local.action}" method="{$smarty.local.method|default:'get'}" class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}" {cattr list=$smarty.local.attributes}>
<form action="{$action}" method="{$method|default:'get'}" class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
{block 'search_form'}
{component 'field' template='text'
placeholder = ( $smarty.local.placeholder ) ? $smarty.local.placeholder : $aLang.search.search
note = $smarty.local.note
value = $smarty.local.value
inputClasses = "{$component}-input {$smarty.local.inputClasses}"
inputAttributes = $smarty.local.inputAttributes
name = $smarty.local.inputName|default:'q'}
placeholder = ( $placeholder ) ? $placeholder : $aLang.search.search
note = $note
value = $value
inputClasses = "{$component}-input {$inputClasses}"
inputAttributes = $inputAttributes
name = $inputName|default:'q'}
{if ! $smarty.local.noSubmitButton}
{if ! $noSubmitButton}
{component 'button' mods='icon' classes="{$component}-submit" icon='search'}
{/if}
{/block}

View file

@ -2,4 +2,6 @@
* Форма основного поиска (по топикам и комментариям)
*}
{component 'search-form' name='main' action="{router page='search'}{$smarty.local.searchType|default:'topics'}" mods=$smarty.local.mods classes=$smarty.local.classes}
{component_define_params params=[ 'searchType', 'mods', 'classes', 'attributes' ]}
{component 'search-form' name='main' action="{router page='search'}{$searchType|default:'topics'}" params=$params}

View file

@ -7,7 +7,7 @@
"templates": {
"ajax": "sort.ajax.tpl",
"timespan": "sort.timespan.tpl",
"sort": "sort.tpl"
"sort": "sort.ajax.tpl"
},
"styles": {
"sort": "css/sort.css"

View file

@ -2,14 +2,15 @@
* Блок сортировки
*
* @param array $items
* @param array $text
* @param string $label
* @param boolean $showLabel
*}
{$component = 'ls-sort'}
{component_define_params params=[ 'items', 'text', 'label', 'mods', 'classes', 'attributes' ]}
{$items = $smarty.local.items}
{$classes = "{$smarty.local.classes} {$component}"}
{$classes = "{$classes} {$component}"}
{foreach $items as $item}
{$items[ $item@key ][ 'attributes' ] = array_merge( $items[ $item@key ][ 'attributes' ]|default:[], [
@ -19,10 +20,10 @@
])}
{/foreach}
{component 'button' template='group' classes=$classes params=$smarty.local.params buttons=[
[ 'text' => $smarty.local.label|default:$aLang.sort.label, 'isDisabled' => true ],
{component 'button' template='group' classes=$classes params=$params buttons=[
[ 'text' => $label|default:$aLang.sort.label, 'isDisabled' => true ],
{component 'dropdown'
text = $smarty.local.text|default:'...'
text = $text|default:'...'
classes = 'js-dropdown-default'
attributes = [ 'data-lsdropdown-selectable' => 'true' ]
menu = $items}

View file

@ -2,6 +2,8 @@
* Выпадающее меню выбора временного периода (за 24 часа, за месяц и т.д.)
*}
{component_define_params params=[ 'periodSelectCurrent' ]}
{if $periodSelectCurrent}
{component 'dropdown'
classes = 'js-dropdown-default'
@ -13,5 +15,5 @@
[ 'name' => '30', 'url' => "{$periodSelectRoot}?period=30", 'text' => {lang 'blog.menu.top_period_30'} ],
[ 'name' => 'all', 'url' => "{$periodSelectRoot}?period=all", 'text' => {lang 'blog.menu.top_period_all'} ]
]
params = $smarty.local.params}
params = $params}
{/if}

View file

@ -1,24 +0,0 @@
{**
*
*}
<div class="ls-sort {$sSortClasses}">
{if $bSortShowLabel|default:true}
<div class="ls-sort-label">{if $sSortLabel}{$sSortLabel}{else}{$aLang.sort.label}{/if}</div>
{/if}
<div class="dropdown dropdown-toggle js-dropdown-default" data-dropdown-target="js-dropdown-sort-{$sSortName}" data-dropdown-selectable="true">...</div>
<ul class="dropdown-menu" id="js-dropdown-sort-{$sSortName}">
{foreach $aSortList as $aSortItem}
{$bIsActive = $sSortOrder == $aSortItem['name']}
<li {if $bIsActive}class="active" title="{if $sSortOrderWay == 'asc'}asc{else}desc{/if}"{/if}>
<a href="{$sSortUrl}?order={$aSortItem['name']}&order_way={if $bIsActive}{if $sSortOrderWay == 'asc'}desc{else}asc{/if}{else}asc{/if}">
{$aSortItem['text']}
{if $bIsActive}{if $sSortOrderWay == 'asc'}&darr;{else}&uarr;{/if}{/if}
</a>
</li>
{/foreach}
</ul>
</div>

View file

@ -5,9 +5,9 @@
* @param object $activeTag
*}
{$activeTag = $smarty.local.activeTag}
{component_define_params params=[ 'activeTag', 'tags' ]}
{component 'details'
classes = 'js-tags-favourite-cloud'
title = "{lang 'tags_personal.title'} {if $activeTag}({$activeTag}){/if}"
content = {component 'tags' template='cloud' tags=$smarty.local.tags active=$activeTag}}
content = {component 'tags' template='cloud' tags=$tags active=$activeTag}}

View file

@ -5,15 +5,17 @@
{extends 'component@tags.tags'}
{block 'tags_options' append}
{component_define_params params=[ 'targetId', 'tagsPersonal', 'isEditable' ]}
{$attributes = array_merge( $attributes|default:[], [
'data-param-target_id' => $smarty.local.targetId
'data-param-target_id' => $targetId
])}
{/block}
{block 'tags_list' append}
{* Персональные теги *}
{if $oUserCurrent}
{foreach $smarty.local.tagsPersonal as $tag}
{foreach $tagsPersonal as $tag}
{component 'tags' template='item'
text=$tag->getText()
url=$tag->getUrl()
@ -22,7 +24,7 @@
{/foreach}
{* Кнопка "Изменить теги" *}
<li class="ls-tags-item ls-tags-personal-edit js-tags-personal-edit" {if $smarty.local.isEditable}style="display:none;"{/if}>
<li class="ls-tags-item ls-tags-personal-edit js-tags-personal-edit" {if $isEditable}style="display:none;"{/if}>
<a href="#" class="ls-link-dotted">
{component 'icon' icon='edit'}
{lang 'tags_personal.edit'}

View file

@ -1,4 +1,4 @@
{extends 'Component@user.user-list-small-item'}
{extends 'component@user.user-list-small-item'}
{block 'user_list_small_item_options' append}
{block 'user_list_add_item_options'}{/block}

View file

@ -8,7 +8,7 @@
* @param array $exclude
*}
{extends 'Component@user.user-list-small'}
{extends 'component@user.user-list-small'}
{block 'user_list_small_item'}
{block 'user_list_add_item'}

View file

@ -13,23 +13,22 @@
{* Название компонента *}
{$component = 'user-list-add'}
{component_define_params params=[ 'title', 'note', 'editable', 'users', 'mods', 'classes', 'attributes' ]}
{* Форма добавления *}
<div class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}"
{cattr list=$smarty.local.attributes}>
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes}>
{* Заголовок *}
{if $smarty.local.title}
<h3 class="{$component}-title">{$smarty.local.title}</h3>
{if $title}
<h3 class="{$component}-title">{$title}</h3>
{/if}
{* Описание *}
{if $smarty.local.note}
<p class="{$component}-note">{$smarty.local.note}</p>
{if $note}
<p class="{$component}-note">{$note}</p>
{/if}
{* Форма добавления *}
{if $smarty.local.editable|default:true}
{if $editable|default:true}
<form class="{$component}-form js-{$component}-form">
{component 'user' template='choose'
name = 'add'
@ -45,9 +44,9 @@
{block 'user_list_add_list'}
{component 'user-list-add' template='list'
hideableEmptyAlert = true
users = $smarty.local.users
users = $users
showActions = true
show = !! $smarty.local.users
show = !! $users
classes = "js-$component-users"
itemClasses = "js-$component-user"}
{/block}

View file

@ -48,7 +48,7 @@
* Коллбэк вызываемый при клике на кнопку подписки
*/
onClick: function( event ) {
this[ this.element.hasClass( ls.options.classes.states.active ) ? 'unfollow' : 'follow' ]();
this[ this._hasClass( 'active' ) ? 'unfollow' : 'follow' ]();
event.preventDefault();
},

View file

@ -5,8 +5,7 @@
*}
{$component = 'ls-vote-info'}
{$target = $smarty.local.target}
{component_define_params params=[ 'target' ]}
<ul class="{$component}">
<li>{component 'icon' icon='plus' mods='white'} {$target->getCountVoteUp()}</li>

View file

@ -2,19 +2,17 @@
* Голосование
*
* @param object $target Объект сущности
* @param string $classes Дополнительные классы
* @param string $attributes Атрибуты
* @param boolean $showRating Показывать рейтинг или нет
* @param boolean $isLocked Блокировка голосования
* @param boolean $useAbstain
*}
{* Название компонента *}
{$component = 'ls-vote'}
{component_define_params params=[ 'showRating', 'target', 'isLocked', 'useAbstain', 'mods', 'classes', 'attributes' ]}
{* Установка дефолтных значений *}
{$showRating = $smarty.local.showRating|default:true}
{$target = $smarty.local.target}
{$mods = $smarty.local.mods}
{$showRating = $showRating|default:true}
{* Рейтинг *}
{$rating = $target->getRating()}
@ -44,7 +42,7 @@
{$mods = "$mods not-voted"}
{/if}
{if ! $oUserCurrent || $smarty.local.isLocked}
{if ! $oUserCurrent || $isLocked}
{$mods = "$mods locked"}
{/if}
@ -57,7 +55,7 @@
{block 'vote_options'}{/block}
<div class="{$component} {cmods name=$component mods=$mods} {$smarty.local.classes}" data-param-i-target-id="{$target->getId()}" {cattr list=$smarty.local.attributes}>
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes} data-param-i-target-id="{$target->getId()}">
{* Основной блок *}
<div class="{$component}-body">
{block 'vote_body'}
@ -71,7 +69,7 @@
</div>
{* Воздержаться *}
{if $smarty.local.useAbstain}
{if $useAbstain}
<div class="{$component}-item {$component}-item-abstain js-vote-item" {if ! $vote}title="{$aLang.$component.abstain}"{/if} data-vote-value="0">
{component 'icon' icon='eye' mods=$iconMod}
</div>

View file

@ -4,6 +4,8 @@
* @param array $comments Список комментариев
*}
{foreach $smarty.local.comments as $comment}
{component_define_params params=[ 'comments' ]}
{foreach $comments as $comment}
{component 'wall' template='entry' entry=$comment showReply=false classes='wall-comment js-wall-comment' type='comment'}
{/foreach}

View file

@ -6,11 +6,11 @@
* @param string $classes Классы
*}
{$entry = $smarty.local.entry}
{component_define_params params=[ 'entry', 'type', 'showReply', 'classes' ]}
{component 'comment'
comment = $entry
showReply = $smarty.local.showReply
showReply = $showReply
useScroll = false
attributes = [ 'data-type' => $smarty.local.type, 'data-user-id' => $entry->getUser()->getId() ]
classes = "wall-comment js-wall-entry {$smarty.local.classes}"}
attributes = [ 'data-type' => $type, 'data-user-id' => $entry->getUser()->getId() ]
classes = "wall-comment js-wall-entry {$classes}"}

View file

@ -6,10 +6,12 @@
* @param string $placeholder Плейсхолдер
*}
<form class="wall-form js-wall-form {$smarty.local.classes}" data-id="{$smarty.local.id|default:0}" {if ! $smarty.local.display|default:true}style="display: none"{/if}>
{component_define_params params=[ 'classes', 'id', 'display', 'placeholder' ]}
<form class="wall-form js-wall-form {$classes}" data-id="{$id|default:0}" {if ! $display|default:true}style="display: none"{/if}>
{* Текст *}
{component 'field' template='textarea'
placeholder = "{$smarty.local.placeholder|default:$aLang.wall.form.fields.text.placeholder}"
placeholder = "{$placeholder|default:$aLang.wall.form.fields.text.placeholder}"
inputClasses = 'ls-width-full js-wall-form-text'}
{* Подвал формы *}

View file

@ -4,7 +4,9 @@
* @param array $posts Список постов
*}
{foreach $smarty.local.posts as $post}
{component_define_params params=[ 'posts' ]}
{foreach $posts as $post}
{$comments = $post->getLastReplyWall()}
{$postId = $post->getId()}

View file

@ -11,12 +11,13 @@
{* Название компонента *}
{$component = 'wall'}
{component_define_params params=[ 'count', 'posts', 'lastId', 'mods', 'classes', 'attributes' ]}
{$loadedCount = count($smarty.local.posts)}
{$moreCount = $smarty.local.count - $loadedCount}
{$loadedCount = count($posts)}
{$moreCount = $count - $loadedCount}
{* Стена *}
<div class="{$component} {cmods name=$component mods=$smarty.local.mods} {$smarty.local.classes}" data-user-id="{$oUserProfile->getId()}" {cattr list=$smarty.local.attributes}>
<div class="{$component} {cmods name=$component mods=$mods} {$classes}" {cattr list=$attributes} data-user-id="{$oUserProfile->getId()}">
{* Форма добавления записи *}
{if $oUserCurrent}
{component 'wall' template='form'}
@ -26,7 +27,7 @@
{* Список записей *}
<div class="js-wall-entry-container" data-id="0">
{component 'wall' template='posts' posts=$smarty.local.posts}
{component 'wall' template='posts' posts=$posts}
</div>
{* Уведомление о пустом списке *}
@ -41,7 +42,7 @@
count = $moreCount
target = '.js-wall-entry-container[data-id=0]'
ajaxParams = [
'last_id' => $smarty.local.lastId
'last_id' => $lastId
]}
{/if}
</div>