1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-06-28 20:45:00 +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'), $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()}"); Config::Get('pagination.pages.count'), Router::GetPath('blog') . "admin/{$oBlog->getId()}");
$this->Viewer_Assign('paging', $aPaging); $this->Viewer_Assign('pagination', $aPaging);
/** /**
* Устанавливаем title страницы * Устанавливаем title страницы
*/ */

View file

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

View file

@ -2,6 +2,8 @@
* Последняя активность * Последняя активность
*} *}
{component_define_params params=[ 'content' ]}
{* Подвал *} {* Подвал *}
{capture 'block_footer'} {capture 'block_footer'}
<a href="{router page='rss'}allcomments/">{lang 'activity.block_recent.feed'}</a> <a href="{router page='rss'}allcomments/">{lang 'activity.block_recent.feed'}</a>
@ -16,7 +18,7 @@
tabs = [ tabs = [
'classes' => 'js-tabs-block js-activity-block-recent-tabs', 'classes' => 'js-tabs-block js-activity-block-recent-tabs',
'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" ] [ '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'} {capture 'items'}
{foreach $smarty.local.comments as $comment} {foreach $comments as $comment}
{$topic = $comment->getTarget()} {$topic = $comment->getTarget()}
{component 'activity' template='recent-item' {component 'activity' template='recent-item'
user = $comment->getUser() user = $comment->getUser()
topic = $topic topic = $topic
blog = $topic->getBlog()
date = $comment->getDate()} date = $comment->getDate()}
{foreachelse} {foreachelse}
{component 'blankslate' text={lang 'common.empty'} mods='no-background'} {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'} {capture 'item_content'}
<a href="{$user->getUserWebPath()}" class="ls-activity-block-recent-user">{$user->getDisplayName()}</a> &rarr; <a href="{$user->getUserWebPath()}" class="ls-activity-block-recent-user">{$user->getDisplayName()}</a> &rarr;
<a href="{$topic->getUrl()}">{$topic->getTitle()|escape}</a> <a href="{$topic->getUrl()}">{$topic->getTitle()|escape}</a>
<p class="ls-activity-block-recent-info"> <p class="ls-activity-block-recent-info">
<time datetime="{date_format date=$smarty.local.date format='c'}" class="ls-activity-block-recent-time"> <time datetime="{date_format date=$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"} {date_format date=$date hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y"}
</time> </time>
<a href="{$topic->getUrl()}#comments" class="ls-activity-block-recent-comments"> <a href="{$topic->getUrl()}#comments" class="ls-activity-block-recent-comments">

View file

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

View file

@ -5,11 +5,13 @@
* @param string $dateLast Дата предыдущего сообщения * @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}} {$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}} {$dateAdded = {date_format date=$event->getDateAdded() format="Y-m-d" notz=1}}
{* Дата группы событий *} {* Дата группы событий *}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,7 +4,9 @@
* @param string $redirectUrl * @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'} {hook run='registration_begin'}

View file

@ -4,7 +4,7 @@
* @param object $blog * @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"> <form method="post" enctype="multipart/form-data" class="js-blog-add js-form-validate">
{hook run='form_add_blog_begin'} {hook run='form_add_blog_begin'}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,6 +4,8 @@
* @param array $blogs * @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} {component 'blog' template='list-item' blog=$blog}
{/foreach} {/foreach}

View file

@ -8,25 +8,25 @@
* @param string $textEmpty * @param string $textEmpty
*} *}
{if $smarty.local.blogs} {component_define_params params=[ 'blogs', 'pagination', 'useMore', 'hideMore', 'textEmpty' ]}
{$paging = $smarty.local.pagination}
{if $blogs}
{* Список блогов *} {* Список блогов *}
{component 'item' template='group' {component 'item' template='group'
classes = 'js-more-blogs-container' 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 $useMore}
{if ! $smarty.local.hideMore} {if ! $hideMore}
{component 'more' {component 'more'
classes = 'js-more-search' classes = 'js-more-search'
target = '.js-more-blogs-container' target = '.js-more-blogs-container'
ajaxParams = [ 'next_page' => 2 ]} ajaxParams = [ 'next_page' => 2 ]}
{/if} {/if}
{else} {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} {/if}
{else} {else}
{component 'blankslate' text=$smarty.local.textEmpty|default:{lang name='blog.alerts.empty'}} {component 'blankslate' text=$textEmpty|default:{lang name='blog.alerts.empty'}}
{/if} {/if}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,18 +4,19 @@
{* Название компонента *} {* Название компонента *}
{$component = 'ls-search-form'} {$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'} {block 'search_form'}
{component 'field' template='text' {component 'field' template='text'
placeholder = ( $smarty.local.placeholder ) ? $smarty.local.placeholder : $aLang.search.search placeholder = ( $placeholder ) ? $placeholder : $aLang.search.search
note = $smarty.local.note note = $note
value = $smarty.local.value value = $value
inputClasses = "{$component}-input {$smarty.local.inputClasses}" inputClasses = "{$component}-input {$inputClasses}"
inputAttributes = $smarty.local.inputAttributes inputAttributes = $inputAttributes
name = $smarty.local.inputName|default:'q'} name = $inputName|default:'q'}
{if ! $smarty.local.noSubmitButton} {if ! $noSubmitButton}
{component 'button' mods='icon' classes="{$component}-submit" icon='search'} {component 'button' mods='icon' classes="{$component}-submit" icon='search'}
{/if} {/if}
{/block} {/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": { "templates": {
"ajax": "sort.ajax.tpl", "ajax": "sort.ajax.tpl",
"timespan": "sort.timespan.tpl", "timespan": "sort.timespan.tpl",
"sort": "sort.tpl" "sort": "sort.ajax.tpl"
}, },
"styles": { "styles": {
"sort": "css/sort.css" "sort": "css/sort.css"

View file

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

View file

@ -2,6 +2,8 @@
* Выпадающее меню выбора временного периода (за 24 часа, за месяц и т.д.) * Выпадающее меню выбора временного периода (за 24 часа, за месяц и т.д.)
*} *}
{component_define_params params=[ 'periodSelectCurrent' ]}
{if $periodSelectCurrent} {if $periodSelectCurrent}
{component 'dropdown' {component 'dropdown'
classes = 'js-dropdown-default' classes = 'js-dropdown-default'
@ -13,5 +15,5 @@
[ 'name' => '30', 'url' => "{$periodSelectRoot}?period=30", 'text' => {lang 'blog.menu.top_period_30'} ], [ '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'} ] [ 'name' => 'all', 'url' => "{$periodSelectRoot}?period=all", 'text' => {lang 'blog.menu.top_period_all'} ]
] ]
params = $smarty.local.params} params = $params}
{/if} {/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 * @param object $activeTag
*} *}
{$activeTag = $smarty.local.activeTag} {component_define_params params=[ 'activeTag', 'tags' ]}
{component 'details' {component 'details'
classes = 'js-tags-favourite-cloud' classes = 'js-tags-favourite-cloud'
title = "{lang 'tags_personal.title'} {if $activeTag}({$activeTag}){/if}" 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'} {extends 'component@tags.tags'}
{block 'tags_options' append} {block 'tags_options' append}
{component_define_params params=[ 'targetId', 'tagsPersonal', 'isEditable' ]}
{$attributes = array_merge( $attributes|default:[], [ {$attributes = array_merge( $attributes|default:[], [
'data-param-target_id' => $smarty.local.targetId 'data-param-target_id' => $targetId
])} ])}
{/block} {/block}
{block 'tags_list' append} {block 'tags_list' append}
{* Персональные теги *} {* Персональные теги *}
{if $oUserCurrent} {if $oUserCurrent}
{foreach $smarty.local.tagsPersonal as $tag} {foreach $tagsPersonal as $tag}
{component 'tags' template='item' {component 'tags' template='item'
text=$tag->getText() text=$tag->getText()
url=$tag->getUrl() url=$tag->getUrl()
@ -22,7 +24,7 @@
{/foreach} {/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"> <a href="#" class="ls-link-dotted">
{component 'icon' icon='edit'} {component 'icon' icon='edit'}
{lang 'tags_personal.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_small_item_options' append}
{block 'user_list_add_item_options'}{/block} {block 'user_list_add_item_options'}{/block}

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -4,6 +4,8 @@
* @param array $comments Список комментариев * @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'} {component 'wall' template='entry' entry=$comment showReply=false classes='wall-comment js-wall-comment' type='comment'}
{/foreach} {/foreach}

View file

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

View file

@ -6,10 +6,12 @@
* @param string $placeholder Плейсхолдер * @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' {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'} inputClasses = 'ls-width-full js-wall-form-text'}
{* Подвал формы *} {* Подвал формы *}

View file

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

View file

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