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 2015-02-10 08:41:16 +07:00
parent 33074894f0
commit cf273dbd47
40 changed files with 345 additions and 535 deletions

View file

@ -486,7 +486,7 @@ $config['block']['rule_blog'] = array(
$config['components'] = array( $config['components'] = array(
// Базовые компоненты // Базовые компоненты
'css-reset', 'css-helpers', 'typography', 'forms', 'grid', 'ls-vendor', 'ls-core', 'ls-component', 'accordion', 'alert', 'dropdown', 'button', 'block', 'css-reset', 'css-helpers', 'typography', 'forms', 'grid', 'ls-vendor', 'ls-core', 'ls-component', 'accordion', 'alert', 'dropdown', 'button', 'block',
'nav', 'tooltip', 'tabs', 'modal', 'table', 'text', 'uploader', 'field', 'comment', 'pagination', 'editor', 'more', 'crop', 'nav', 'tooltip', 'tabs', 'modal', 'table', 'text', 'uploader', 'email', 'field', 'comment', 'pagination', 'editor', 'more', 'crop',
'perfomance', 'toolbar', 'media', 'actionbar', 'progressbar', 'badge', 'property', 'autocomplete', 'icon', 'item', 'highlighter', 'jumbotron', 'perfomance', 'toolbar', 'media', 'actionbar', 'progressbar', 'badge', 'property', 'autocomplete', 'icon', 'item', 'highlighter', 'jumbotron',
// Компоненты LS CMS // Компоненты LS CMS

View file

@ -2,30 +2,21 @@
* Последняя активность * Последняя активность
*} *}
{extends 'Component@block.block'}
{block 'block_title'}
<a href="{router page='stream'}">{lang 'activity.block_recent.title'}</a>
{/block}
{block 'block_options' append}
{$mods = "{$mods} stream nopadding"}
{$classes = "{$classes} js-block-default"}
{/block}
{* Навигация *}
{block 'block_content'}
{**
* TODO: Выпадающее меню
* Показывается если в меню что выше пунктов больше установленного значения (по умолчанию - 2)
*}
{component 'tabs' classes='js-tabs-block js-activity-block-recent-tabs' tabs=[
[ 'text' => {lang 'activity.block_recent.comments'}, 'url' => "{router page='ajax'}stream/comment", 'content' => $smarty.local.content ],
[ 'text' => {lang 'activity.block_recent.topics'}, 'url' => "{router page='ajax'}stream/topic" ]
]}
{/block}
{* Подвал *} {* Подвал *}
{block '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>
{/block} {/capture}
{component 'block'
mods = 'primary activity-recent'
classes = 'js-block-default'
title = {lang 'activity.block_recent.title'}
titleUrl = {router 'stream'}
footer = $smarty.capture.block_footer
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.topics'}, 'url' => "{router page='ajax'}stream/topic" ]
]
]}

View file

@ -2,16 +2,7 @@
* Блок настройки ленты активности * Блок настройки ленты активности
*} *}
{extends 'Component@block.block'} {component 'block'
mods = 'activity-settings'
{block 'block_title'} title = {lang 'activity.settings.title'}
{$aLang.activity.settings.title} content = {include '../settings.tpl' typesActive=$typesActive types=$types}}
{/block}
{block 'block_options' append}
{$mods = "{$mods} activity-settings"}
{/block}
{block 'block_content'}
{include '../settings.tpl' typesActive=$typesActive types=$types}
{/block}

View file

@ -2,16 +2,7 @@
* Выбор пользователей для чтения в ленте активности * Выбор пользователей для чтения в ленте активности
*} *}
{extends 'Component@block.block'} {component 'block'
mods = 'activity-users'
{block 'block_title'} title = {lang 'activity.users.title'}
{$aLang.activity.users.title} content = {include '../users.tpl' users=$users}}
{/block}
{block 'block_options' append}
{$mods = "{$mods} activity-users"}
{/block}
{block 'block_content'}
{include '../users.tpl' users=$users}
{/block}

View file

@ -3,30 +3,17 @@
* Топики отсортированные по времени последнего комментария * Топики отсортированные по времени последнего комментария
*} *}
<div class="block-content"> {capture 'items'}
<ul class="block-item-list"> {foreach $smarty.local.comments as $comment}
{foreach $smarty.local.comments as $comment} {$topic = $comment->getTarget()}
{$user = $comment->getUser()}
{$topic = $comment->getTarget()}
{$blog = $topic->getBlog()}
<li class="js-title-comment" title="{$comment->getText()|strip_tags|trim|truncate:100:'...'|escape}"> {include './recent-item.tpl'
<a href="{$user->getUserWebPath()}"><img src="{$user->getProfileAvatarPath(48)}" alt="avatar" class="avatar" /></a> user = $comment->getUser()
topic = $topic
blog = $topic->getBlog()
date = $comment->getDate()
topicUrl = ( Config::Get('module.comment.use_nested') ) ? {router 'comments'} : "{$topic->getUrl()}#comment{$comment->getId()}"}
{/foreach}
{/capture}
<a href="{$user->getUserWebPath()}" class="author">{$user->getDisplayName()}</a> &rarr; {component 'item' template='group' items=$smarty.capture.items}
<a href="{$blog->getUrlFull()}" class="blog-name">{$blog->getTitle()|escape}</a> &rarr;
<a href="{if Config::Get('module.comment.nested_per_page')}{router page='comments'}{else}{$topic->getUrl()}#comment{/if}{$comment->getId()}">
{$topic->getTitle()|escape}
</a>
<p>
<time datetime="{date_format date=$comment->getDate() format='c'}">
{date_format date=$comment->getDate() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y"}
</time> |
{lang name='comments.comments_declension' count=$topic->getCountComment() plural=true}
</p>
</li>
{/foreach}
</ul>
</div>

View file

@ -0,0 +1,22 @@
{capture 'item_content'}
<a href="{$user->getUserWebPath()}" class="author">{$user->getDisplayName()}</a> &rarr;
<a href="{$blog->getUrlFull()}" class="blog-name">{$blog->getTitle()|escape}</a> &rarr;
<a href="{$smarty.local.topicUrl}">{$topic->getTitle()|escape}</a>
<p>
<time datetime="{date_format date=$smarty.local.date format='c'}">
{date_format date=$smarty.local.date hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y"}
</time> |
{lang 'comments.comments_declension' count=$topic->getCountComment() plural=true}
</p>
{/capture}
{component 'item'
element = 'li'
mods = 'image-rounded'
desc = $smarty.capture.item_content
image=[
'path' => $user->getProfileAvatarPath(48),
'url' => $user->getUserWebPath()
]}

View file

@ -3,27 +3,15 @@
* Последние топики * Последние топики
*} *}
<div class="block-content"> {capture 'items'}
<ul class="block-item-list"> {foreach $smarty.local.topics as $topic}
{foreach $smarty.local.topics as $topic} {include './recent-item.tpl'
{$user = $topic->getUser()} user = $topic->getUser()
{$blog = $topic->getBlog()} topic = $topic
blog = $topic->getBlog()
date = $topic->getDateAdd()
topicUrl = $topic->getUrl()}
{/foreach}
{/capture}
<li class="js-title-topic" title="{$topic->getText()|strip_tags|trim|truncate:150:'...'|escape}"> {component 'item' template='group' items=$smarty.capture.items}
<a href="{$user->getUserWebPath()}"><img src="{$user->getProfileAvatarPath(48)}" alt="avatar" class="avatar" /></a>
<a href="{$user->getUserWebPath()}" class="author">{$user->getDisplayName()}</a> &rarr;
<a href="{$blog->getUrlFull()}" class="blog-name">{$blog->getTitle()|escape}</a> &rarr;
<a href="{$topic->getUrl()}">{$topic->getTitle()|escape}</a>
<p>
<time datetime="{date_format date=$topic->getDate() format='c'}">
{date_format date=$topic->getDateAdd() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y"}
</time> |
{lang name='comments.comments_declension' count=$topic->getCountComment() plural=true}
</p>
</li>
{/foreach}
</ul>
</div>

View file

@ -13,28 +13,25 @@
.activity-event-list { .activity-event-list {
margin: 0 0 20px; margin: 0 0 20px;
} }
/* Дата-заголовок */
.activity-date { .activity-date {
font-family: 'Open Sans', sans-serif; font: 400 18px/1.3em 'Open Sans', sans-serif;
font-size: 20px; padding: 10px 0;
margin-top: 45px; border-bottom: 1px solid #E7E7E7;
padding-bottom: 10px; }
border-bottom: 1px solid #eee; .activity-event + .activity-date {
margin-top: 30px;
} }
/** /**
* Событие * Событие
*/ */
.activity-event { .activity-event {
margin-bottom: 5px; padding: 15px;
min-height: 48px;
background: #fafafa;
padding: 15px 15px 15px 75px;
position: relative;
} }
.activity-event-avatar { .activity-event + .activity-event {
position: absolute; border-top: 1px solid #f2f2f2;
top: 15px;
left: 15px;
} }
.activity-event-date { .activity-event-date {
display: block; display: block;
@ -43,9 +40,8 @@
} }
.activity-event-text { .activity-event-text {
padding: 10px 15px; padding: 10px 15px;
background: #fff;
border: 1px solid #eee;
border-bottom-color: #ddd;
margin-top: 10px; margin-top: 10px;
color: #777;
background: #fafafa;
font-size: 13px; font-size: 13px;
} }

View file

@ -4,40 +4,4 @@
* @license GNU General Public License, version 2 * @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com} * @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov <denis.shakhov@gmail.com> * @author Denis Shakhov <denis.shakhov@gmail.com>
*
* TODO: Component item
*/ */
.block-item-list li {
min-height: 51px;
padding: 17px 15px 20px 80px;
border-top: 1px solid #eee;
position: relative;
zoom: 1;
background: #fff;
}
.block-item-list li:first-child {
border: none;
}
.block-item-list li p {
margin: 0;
padding-top: 2px;
font-size: 11px;
line-height: 1.3em;
}
.block-item-list li a {
text-decoration: none;
}
.block-item-list li .avatar {
position: absolute;
top: 20px;
left: 20px;
margin-right: 10px;
}
.block-item-list li .author {
font-weight: bold;
color: #333;
}
.block-item-list li .blog-name {
font-weight: bold;
}

View file

@ -25,12 +25,7 @@
{* Событие *} {* Событие *}
<li class="{$component} {$component}--{$type} js-{$component}"> {capture 'event_content'}
{* Аватар *}
<a href="{$user->getUserWebPath()}">
<img src="{$user->getProfileAvatarPath(48)}" alt="{$user->getDisplayName()}" class="activity-event-avatar" />
</a>
{* Дата *} {* Дата *}
<time datetime="{date_format date=$event->getDateAdded() format='c' notz=1}" <time datetime="{date_format date=$event->getDateAdded() format='c' notz=1}"
class="{$component}-date" class="{$component}-date"
@ -85,4 +80,15 @@
{else} {else}
{hook run="activity_event_`$type`" event=$event} {hook run="activity_event_`$type`" event=$event}
{/if} {/if}
</li> {/capture}
{component 'item'
element='li'
classes="{$component} {cmods name=$component mods=$type}"
mods='image-rounded'
desc=$smarty.capture.event_content
image=[
'url' => $user->getUserWebPath(),
'path' => $user->getProfileAvatarPath(48),
'alt' => $user->getDisplayName()
]}

View file

@ -47,7 +47,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' paging=$smarty.local.pagination} {component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}
{else} {else}
{component 'alert' text=$aLang.blog.admin.alerts.empty mods='empty'} {component 'alert' text=$aLang.blog.admin.alerts.empty mods='empty'}
{/if} {/if}

View file

@ -4,14 +4,7 @@
* TODO: Уни-ать список экшенов * TODO: Уни-ать список экшенов
*} *}
{extends 'Component@block.block'} {capture 'block_content'}
{block 'block_options' append}
{* TODO: Fix styles *}
{$mods = "{$mods} nopadding transparent user-actions"}
{/block}
{block 'block_content'}
<ul class="profile-actions" id="profile_actions"> <ul class="profile-actions" id="profile_actions">
{* Список экшенов *} {* Список экшенов *}
{$actions = []} {$actions = []}
@ -75,4 +68,8 @@
</li> </li>
{/foreach} {/foreach}
</ul> </ul>
{/block} {/capture}
{component 'block'
mods = 'nopadding transparent user-actions'
content = $smarty.capture.block_content}

View file

@ -2,24 +2,18 @@
* Блок с кнопкой добавления блога * Блок с кнопкой добавления блога
*} *}
{extends 'Component@block.block'} {if $oUserCurrent}
{capture 'block_content'}
{if $oUserCurrent && ($oUserCurrent->getRating() > Config::Get('acl.create.blog.rating') or $oUserCurrent->isAdministrator())}
<p>{$aLang.blog.can_add}</p>
{block 'block_options' append} {component 'button' url="{router page='blog'}add/" mods='primary large' text=$aLang.blog.create_blog}
{$mods = "{$mods} blog-add"} {else}
<p>{lang name='blog.cant_add' rating=Config::Get('acl.create.blog.rating')}</p>
{if ! $oUserCurrent} {component 'button' mods='primary large' text=$aLang.blog.create_blog isDisabled=true}
{$show = false} {/if}
{/if} {/capture}
{/block}
{block 'block_content'} {component 'block' mods='blog-add' content=$smarty.capture.block_content}
{if $oUserCurrent && ($oUserCurrent->getRating() > Config::Get('acl.create.blog.rating') or $oUserCurrent->isAdministrator())} {/if}
<p>{$aLang.blog.can_add}</p>
{component 'button' url="{router page='blog'}add/" mods='primary large' text=$aLang.blog.create_blog}
{else}
<p>{lang name='blog.cant_add' rating=Config::Get('acl.create.blog.rating')}</p>
{component 'button' mods='primary large' text=$aLang.blog.create_blog isDisabled=true}
{/if}
{/block}

View file

@ -2,17 +2,7 @@
* Список управляющих блога * Список управляющих блога
*} *}
{extends 'Component@block.block'} {capture 'block_content'}
{block 'block_title'}
{$aLang.blog.administrators}
{/block}
{block 'block_options' append}
{$mods = "{$mods} blog-admins"}
{/block}
{block 'block_content'}
{* Создатель *} {* Создатель *}
{component 'user' template='list-small' users=[ $blog->getOwner() ] title=$aLang.blog.owner} {component 'user' template='list-small' users=[ $blog->getOwner() ] title=$aLang.blog.owner}
@ -25,4 +15,9 @@
{if count($blogModerators)} {if count($blogModerators)}
{component 'user' template='list-small' users=$blogModerators title="{$aLang.blog.moderators} ({count($blogModerators)})"} {component 'user' template='list-small' users=$blogModerators title="{$aLang.blog.moderators} ({count($blogModerators)})"}
{/if} {/if}
{/block} {/capture}
{component 'block'
mods = 'blog-admins'
title = {lang 'blog.administrators'}
content = $smarty.capture.block_content}

View file

@ -2,16 +2,7 @@
* Подсказка отображаемая при создании топика * Подсказка отображаемая при создании топика
*} *}
{extends 'Component@block.block'} {component 'block'
mods = 'info'
{block 'block_options' append} title = {lang 'topic.blocks.tip.title'}
{$mods = "{$mods} blog-info-note"} content = {lang 'topic.blocks.tip.text'}}
{/block}
{block 'block_title'}
{lang 'topic.blocks.tip.title'}
{/block}
{block 'block_content'}
{lang 'topic.blocks.tip.text'}
{/block}

View file

@ -3,19 +3,13 @@
* Выводится на странице администрирования пользователей закрытого блога. * Выводится на странице администрирования пользователей закрытого блога.
*} *}
{extends 'Component@block.block'} {component 'blog' template='invite'
users = $blogUsersInvited
classes = 'js-user-list-add-blog-invite'
attributes = [ 'data-param-target_id' => $blogEdit->getId() ]
assign = blockContent}
{block 'block_title'} {component 'block'
{$aLang.blog.invite.invite_users} mods = 'blog-invite'
{/block} title = {lang 'blog.invite.invite_users'}
content = $blockContent}
{block 'block_options' append}
{$mods = "{$mods} blog-invite"}
{/block}
{block 'block_content'}
{component 'blog' template='invite'
users = $blogUsersInvited
classes = 'js-user-list-add-blog-invite'
attributes = [ 'data-param-target_id' => $blogEdit->getId() ]}
{/block}

View file

@ -1,23 +1,18 @@
{** {**
* * Аватара блога
*} *}
{extends 'Component@block.block'} {component 'photo'
classes = 'js-blog-avatar'
useAvatar = false
hasPhoto = $blog->getAvatar()
editable = $blog->isAllowEdit()
targetId = $blog->getId()
url = $blog->getUrlFull()
photoPath = $blog->getAvatarPath(500)
photoAltText = $blog->getTitle()|escape
assign = blockContent}
{block 'block_type'}blog-actions{/block} {component 'block'
mods = 'nopadding transparent blog-actions'
{block 'block_options' append} content = $blockContent}
{$mods = "{$mods} blog-actions"}
{/block}
{block 'block_content'}
{component 'photo'
classes = 'js-blog-avatar'
useAvatar = false
hasPhoto = $blog->getAvatar()
editable = $blog->isAllowEdit()
targetId = $blog->getId()
url = $blog->getUrlFull()
photoPath = $blog->getAvatarPath(500)
photoAltText = $blog->getTitle()|escape}
{/block}

View file

@ -2,24 +2,18 @@
* Список пользователей блога * Список пользователей блога
*} *}
{extends 'Component@block.block'} {capture 'block_title'}
{block 'block_title'}
{$usersCount = count($blogUsers)} {$usersCount = count($blogUsers)}
<a href="{$blog->getUrlFull()}users/"> {if $usersCount}
{if $usersCount} {$usersCount} {lang "{$smarty.local.titleLang|default:'blog.readers_declension'}" count=$usersCount plural=true}
{$usersCount} {$usersCount|declension:$aLang.blog.readers_declension:'russian'} {else}
{else} {$aLang.blog.users.empty}
{$aLang.blog.users.empty} {/if}
{/if} {/capture}
</a>
{/block}
{block 'block_options' append} {component 'block'
{$mods = "{$mods} blog-users"} mods = 'blog-users'
{/block} title = $smarty.capture.block_title
titleUrl = "{$blog->getUrlFull()}users/"
{block 'block_content'} content = {component 'user' template='list-avatar' users=$blogUsers}}
{component 'user' template='list-avatar' users=$blogUsers}
{/block}

View file

@ -2,17 +2,7 @@
* Фильтр блогов * Фильтр блогов
*} *}
{extends 'Component@block.block'} {capture 'block_content'}
{block 'block_title'}
{lang 'blog.blocks.search.title'}
{/block}
{block 'block_options' append}
{$mods = "{$mods} blogs-search"}
{/block}
{block 'block_content'}
<h3>{lang 'blog.blocks.search.categories.title'}</h3> <h3>{lang 'blog.blocks.search.categories.title'}</h3>
{* Категории *} {* Категории *}
@ -66,4 +56,9 @@
{component 'field' template='radio' inputClasses='js-search-ajax-blog-relation' name='blog_search_relation' value='my' label='Мои'} {component 'field' template='radio' inputClasses='js-search-ajax-blog-relation' name='blog_search_relation' value='my' label='Мои'}
{component 'field' template='radio' inputClasses='js-search-ajax-blog-relation' name='blog_search_relation' value='join' label='Читаю'} {component 'field' template='radio' inputClasses='js-search-ajax-blog-relation' name='blog_search_relation' value='join' label='Читаю'}
</div> </div>
{/block} {/capture}
{component 'block'
mods = 'blogs-search'
title = {lang 'blog.blocks.search.title'}
content = $smarty.capture.block_content}

View file

@ -2,21 +2,16 @@
* Блок со списком блогов * Блок со списком блогов
*} *}
{extends 'Component@block.block'} {component 'block'
mods = 'blogs'
{block 'block_options' append} classes = 'blog-block-blogs js-block-default'
{$mods = "{$mods} blogs nopadding"} title = {lang 'blog.blocks.blogs.title'}
{$classes = "{$classes} js-block-default"} titleUrl = {router page='blogs'}
{/block} tabs = [
'classes' => 'js-tabs-block',
{block 'block_title'} 'tabs' => [
<a href="{router page='blogs'}">{lang 'blog.blocks.blogs.title'}</a> [ 'text' => {lang 'blog.blocks.blogs.nav.top'}, 'url' => "{router page='ajax'}blogs/top", 'list' => $sBlogsTop ],
{/block} [ 'text' => {lang 'blog.blocks.blogs.nav.joined'}, 'url' => "{router page='ajax'}blogs/join", 'is_enabled' => !! $oUserCurrent ],
[ 'text' => {lang 'blog.blocks.blogs.nav.self'}, 'url' => "{router page='ajax'}blogs/self", 'is_enabled' => !! $oUserCurrent ]
{block 'block_content'} ]
{component 'tabs' classes='js-tabs-block' tabs=[ ]}
[ 'text' => {lang 'blog.blocks.blogs.nav.top'}, 'url' => "{router page='ajax'}blogs/top", 'content' => $sBlogsTop ],
[ 'text' => {lang 'blog.blocks.blogs.nav.joined'}, 'url' => "{router page='ajax'}blogs/join", 'is_enabled' => !! $oUserCurrent ],
[ 'text' => {lang 'blog.blocks.blogs.nav.self'}, 'url' => "{router page='ajax'}blogs/self", 'is_enabled' => !! $oUserCurrent ]
]}
{/block}

View file

@ -1,25 +1,27 @@
{** {**
* Блок со списоком блогов * Блок со списоком блогов
* Список блогов * Список блогов
*
* TODO: Component item
*} *}
<ul class="block-item-list"> {$items = []}
{foreach $aBlogs as $blog}
<li>
<a href="{$blog->getUrlFull()}">
<img src="{$blog->getAvatarPath(48)}" alt="{$blog->getTitle()|escape}" class="avatar" />
</a>
{if $blog->getType() == 'close'} {foreach $aBlogs as $blog}
<i title="{lang 'blog.blocks.blogs.item.private'}" class="icon icon-lock"></i> {capture 'item_content'}
{/if} {lang 'blog.users.readers_total'}: <strong>{$blog->getCountUser()}</strong><br>
{lang 'blog.topics_total'}: <strong>{$blog->getCountTopic()}</strong>
{/capture}
<a href="{$blog->getUrlFull()}">{$blog->getTitle()|escape}</a> {$items[] = [
'title' => $blog->getTitle()|escape,
'titleUrl' => $blog->getUrlFull(),
'mods' => $blog->getUrlFull(),
'content' => $smarty.capture.item_content,
'image' => [
'path' => $blog->getAvatarPath(48),
'url' => $blog->getUrlFull(),
'alt' => $blog->getTitle()|escape
]
]}
{/foreach}
<p>{lang 'blog.users.readers_total'}: <strong>{$blog->getCountUser()}</strong></p> {component 'item' template='group' items=$items}
<p>{lang 'blog.topics_total'}: <strong>{$blog->getCountTopic()}</strong></p>
</li>
{/foreach}
</ul>

View file

@ -4,56 +4,50 @@
* @param object $blog * @param object $blog
*} *}
{extends 'Component@item.item'}
{block 'options' append} {$blog = $smarty.local.blog}
{$blog = $smarty.local.blog}
{* Заголовок *} {* Заголовок *}
{capture 'blog_list_item_title'} {capture 'title'}
{if $blog->getType() == 'close'} {if $blog->getType() == 'close'}
<i title="{$aLang.blog.private}" class="icon-lock"></i> <i title="{$aLang.blog.private}" class="icon-lock"></i>
{/if} {/if}
<a href="{$blog->getUrlFull()}">{$blog->getTitle()|escape}</a> <a href="{$blog->getUrlFull()}">{$blog->getTitle()|escape}</a>
{/capture} {/capture}
{$title = $smarty.capture.blog_list_item_title} {* Описание *}
{capture 'desc'}
{$blog->getDescription()|strip_tags|truncate:120}
{/capture}
{* Описание *} {* Описание *}
{capture 'blog_list_item_desc'} {capture 'content'}
{$blog->getDescription()|strip_tags|truncate:120} {* Действия *}
{/capture} <div class="blog-list-item-actions">
{* Вступить/покинуть блог *}
{include './join.tpl' blog=$blog}
</div>
{$desc = $smarty.capture.blog_list_item_desc} {* Информация *}
{$info = [
[ 'label' => "{$aLang.blog.users.readers_total}:", 'content' => "<span class=\"js-blog-users-count\" data-blog-id=\"{$blog->getId()}\">{$blog->getCountUser()}</span>" ],
[ 'label' => "{$aLang.blog.topics_total}:", 'content' => $blog->getCountTopic() ]
]}
{* Описание *} {if $blog->category->getCategory()}
{capture 'blog_list_item_content'} {$info[] = [ 'label' => "{$aLang.blog.categories.category}:", 'content' => $blog->category->getCategory()->getTitle() ]}
{* Информация *} {/if}
{$info = [
[ 'label' => "{$aLang.blog.users.readers_total}:", 'content' => "<span class=\"js-blog-users-count\" data-blog-id=\"{$blog->getId()}\">{$blog->getCountUser()}</span>" ],
[ 'label' => "{$aLang.blog.topics_total}:", 'content' => $blog->getCountTopic() ]
]}
{if $blog->category->getCategory()} {component 'info-list' list=$info classes='object-list-item-info'}
{$info[] = [ 'label' => "{$aLang.blog.categories.category}:", 'content' => $blog->category->getCategory()->getTitle() ]} {/capture}
{/if}
{component 'info-list' list=$info classes='object-list-item-info'} {component 'item'
title=$smarty.capture.title
{* Действия *} desc=$smarty.capture.desc
<div class="blog-list-item-actions"> content=$smarty.capture.content
{* Вступить/покинуть блог *} image=[
{include './join.tpl' blog=$blog}
</div>
{/capture}
{$content = $smarty.capture.blog_list_item_content}
{* Изображение *}
{$image = [
'url' => $blog->getUrlFull(), 'url' => $blog->getUrlFull(),
'path' => $blog->getAvatarPath( 100 ), 'path' => $blog->getAvatarPath( 100 ),
'alt' => $blog->getTitle()|escape 'alt' => $blog->getTitle()|escape
]} ]}
{/block}

View file

@ -10,17 +10,21 @@
*} *}
{if $smarty.local.blogs} {if $smarty.local.blogs}
{$paging = $smarty.local.pagination}
{* Заголовок *} {* Заголовок *}
{if $smarty.local.searchCount} {if $smarty.local.searchCount}
<h3 class="h3">{lang name='blog.search.result_title' count=$smarty.local.searchCount plural=true}</h3> <h3 class="h3">{lang name='blog.search.result_title' count=$smarty.local.searchCount plural=true}</h3>
{/if} {/if}
{* Список блогов *} {* Список блогов *}
<ul class="object-list object-list-actions blog-list js-more-blogs-container"> {capture 'blog_list'}
{foreach $smarty.local.blogs as $blog} {foreach $smarty.local.blogs as $blog}
{include './blog-list-item.tpl' blog=$blog} {include './blog-list-item.tpl' blog=$blog}
{/foreach} {/foreach}
</ul> {/capture}
{component 'item' template='group' classes='js-more-blogs-container' items=$smarty.capture.blog_list}
{* Кнопка подгрузки *} {* Кнопка подгрузки *}
{if $smarty.local.useMore} {if $smarty.local.useMore}
@ -31,7 +35,7 @@
ajaxParams = [ 'next_page' => 2 ]} ajaxParams = [ 'next_page' => 2 ]}
{/if} {/if}
{else} {else}
{component 'pagination' paging=$smarty.local.pagination} {component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}
{/if} {/if}
{else} {else}
{component 'alert' text=(($smarty.local.textEmpty) ? $smarty.local.textEmpty : $aLang.blog.alerts.empty) mods='empty'} {component 'alert' text=(($smarty.local.textEmpty) ? $smarty.local.textEmpty : $aLang.blog.alerts.empty) mods='empty'}

View file

@ -4,26 +4,20 @@
* @modifier blog-add * @modifier blog-add
* @template blocks/block.blog-add.tpl * @template blocks/block.blog-add.tpl
*/ */
.block--blog-add .block-content { padding: 30px; text-align: center; } .block--blog-add .block-content {
.block--blog-add p { margin-bottom: 25px; } padding: 30px;
text-align: center;
}
/** /**
* Навигация по блогам * Список блогов
* *
* @modifier blog-navigation * @template blocks/block.blogs.tpl
* @template blocks/block.blog-nav.tpl
*/ */
.block--blog-navigation p { margin-bottom: 15px; } .block.blog-block-blogs .item-title {
.block--blog-navigation .blog-navigator-categories option:first-child { color: #aaa; } font-size: 16px;
margin-bottom: 7px;
}
/** .block.blog-block-blogs .item-image {
* Информация о блоге border-radius: 3px;
* }
* @modifier blog-actions
* @template blocks/block.blog-actions.tpl
*/
.block--blog-actions .block-content { padding: 0; }
.block--blog-actions .avatar { max-width: 100%; vertical-align: top; }
.block--blog-actions .block-footer { text-align: center; }

View file

@ -2,16 +2,7 @@
* Выбор блогов для чтения в ленте * Выбор блогов для чтения в ленте
*} *}
{extends 'Component@block.block'} {component 'block'
mods = 'feed-blogs'
{block 'block_options' append} title = {lang 'feed.blogs.title'}
{$mods = "{$mods} feed-blogs"} content = {include '../blogs.tpl' blogsJoined=$blogsJoined blogsSubscribed=$blogsSubscribed}}
{/block}
{block 'block_title'}
{$aLang.feed.blogs.title}
{/block}
{block 'block_content'}
{include '../blogs.tpl' blogsJoined=$blogsJoined blogsSubscribed=$blogsSubscribed}
{/block}

View file

@ -2,16 +2,7 @@
* Выбор пользователей для чтения в ленте * Выбор пользователей для чтения в ленте
*} *}
{extends 'Component@block.block'} {component 'block'
mods = 'feed-users'
{block 'block_options' append} title = {lang 'feed.users.title'}
{$mods = "{$mods} feed-users"} content = {include '../users.tpl' users=$users}}
{/block}
{block 'block_title'}
{$aLang.feed.users.title}
{/block}
{block 'block_content'}
{include '../users.tpl' users=$users}
{/block}

View file

@ -128,4 +128,4 @@
{component 'alert' text=$aLang.talk.notices.empty mods='empty'} {component 'alert' text=$aLang.talk.notices.empty mods='empty'}
{/if} {/if}
{component 'pagination' paging=$smarty.local.paging} {component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}

View file

@ -6,6 +6,7 @@
*} *}
{$topics = $smarty.local.topics} {$topics = $smarty.local.topics}
{$paging = $smarty.local.paging}
{if $topics} {if $topics}
{add_block group='toolbar' name='component@toolbar-scrollnav.toolbar.scrollnav' show=count( $topics )} {add_block group='toolbar' name='component@toolbar-scrollnav.toolbar.scrollnav' show=count( $topics )}
@ -14,7 +15,7 @@
{include './topic-type.tpl' topic=$topic isList=true} {include './topic-type.tpl' topic=$topic isList=true}
{/foreach} {/foreach}
{component 'pagination' paging=$smarty.local.paging classes='js-pagination-topics'} {component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}" classes='js-pagination-topics'}
{else} {else}
{component 'alert' text=$aLang.common.empty mods='empty'} {component 'alert' text=$aLang.common.empty mods='empty'}
{/if} {/if}

View file

@ -1,19 +1,9 @@
{** {**
* Меню пользователя ("Добавить в друзья", "Написать письмо" и т.д.) * Меню пользователя ("Добавить в друзья", "Написать письмо" и т.д.)
*
* @styles css/blocks.css
*} *}
{extends 'Component@block.block'} {if $oUserCurrent && $oUserCurrent->getId() != $oUserProfile->getId() }
{component 'block'
{block 'block_options' append} mods = 'nopadding transparent user-actions'
{$mods = "{$mods} nopadding transparent user-actions"} content = {component 'user' template='actions' user=$oUserProfile}}
{/if}
{if ! $oUserCurrent or ( $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId() )}
{$show = false}
{/if}
{/block}
{block 'block_content'}
{component 'user' template='actions' user=$oUserProfile}
{/block}

View file

@ -1,15 +1,5 @@
{** {**
* Блок с навигацией по профилю пользователя * Блок с навигацией по профилю пользователя
*
* @styles css/blocks.css
*} *}
{extends 'Component@block.block'} {component 'block' mods='nopadding transparent user-nav' content={include 'navs/nav.user.tpl'}}
{block 'block_options' append}
{$mods = "{$mods} nopadding transparent user-nav"}
{/block}
{block 'block_content_after'}
{include 'navs/nav.user.tpl'}
{/block}

View file

@ -1,19 +1,9 @@
{** {**
* Блок с заметкой о пользователе * Блок с заметкой о пользователе
*
* @styles css/blocks.css
*} *}
{extends 'Component@block.block'} {if $oUserCurrent && $oUserCurrent->getId() != $oUserProfile->getId() }
{component 'block'
{block 'block_options' append} mods = 'nopadding transparent user-note'
{$mods = "{$mods} user-note nopadding transparent"} content = {component 'note' classes='js-user-note' note=$oUserProfile->getUserNote() targetId=$oUserProfile->getId()}}
{/if}
{if ! $oUserCurrent or ( $oUserCurrent->getId() == $oUserProfile->getId() )}
{$show = false}
{/if}
{/block}
{block 'block_content_after'}
{component 'note' classes='js-user-note' note=$oUserProfile->getUserNote() targetId=$oUserProfile->getId()}
{/block}

View file

@ -2,14 +2,7 @@
* Блок с фотографией пользователя в профиле * Блок с фотографией пользователя в профиле
*} *}
{extends 'Component@block.block'} {capture 'block_content'}
{block 'block_options' append}
{$mods = "{$mods} user-photo"}
{$classes = "{$classes} js-ajax-photo-upload"}
{/block}
{block 'block_content'}
{$session = $oUserProfile->getSession()} {$session = $oUserProfile->getSession()}
{* Статус онлайн\оффлайн *} {* Статус онлайн\оффлайн *}
@ -37,4 +30,8 @@
url = $oUserProfile->getUserWebPath() url = $oUserProfile->getUserWebPath()
photoPath = $oUserProfile->getProfileFotoPath() photoPath = $oUserProfile->getProfileFotoPath()
photoAltText = $oUserProfile->getDisplayName()} photoAltText = $oUserProfile->getDisplayName()}
{/block} {/capture}
{component 'block'
mods = 'user-photo'
content = $smarty.capture.block_content}

View file

@ -2,17 +2,7 @@
* Статистика по пользователям * Статистика по пользователям
*} *}
{extends 'Component@block.block'} {capture 'block_content'}
{block 'block_options' append}
{$mods = "{$mods} users-search"}
{/block}
{block 'block_title'}
Поиск по пользователям
{/block}
{block 'block_content'}
{* Сейчас на сайте *} {* Сейчас на сайте *}
{component 'field' template='checkbox' {component 'field' template='checkbox'
name = 'is_online' name = 'is_online'
@ -35,4 +25,9 @@
countries = $countriesUsed countries = $countriesUsed
name = 'geo' name = 'geo'
label = {lang name='user.settings.profile.fields.place.label'} } label = {lang name='user.settings.profile.fields.place.label'} }
{/block} {/capture}
{component 'block'
mods = 'users-search'
title = {lang 'user.search.title'}
content = $smarty.capture.block_content}

View file

@ -2,16 +2,7 @@
* Статистика по пользователям * Статистика по пользователям
*} *}
{extends 'Component@block.block'} {component 'block'
mods = 'info users-stats'
{block 'block_options' append} title = {lang 'user.stats.title'}
{$mods = "{$mods} users-stats"} content = {component 'user' template='stat' stat=$usersStat}}
{/block}
{block 'block_title'}
{$aLang.user.stats.title}
{/block}
{block 'block_content'}
{component 'user' template='stat' stat=$usersStat}
{/block}

View file

@ -14,11 +14,6 @@
color: #555; color: #555;
} }
/* О себе */
.profile-info-about {
margin-bottom: 30px;
}
/* Блок с информацией */ /* Блок с информацией */
.user-info-group { .user-info-group {
margin-bottom: 50px; margin-bottom: 50px;

View file

@ -2,28 +2,27 @@
* Список пользователей (аватары) * Список пользователей (аватары)
* *
* @param array $users Список пользователей * @param array $users Список пользователей
* @param array $showPagination Показывать или нет пагинацию (false) * @param array $pagination Массив с параметрами пагинации
* @param array $emptyText
*} *}
{$users = $smarty.local.users} {$users = $smarty.local.users}
{$pagination = $smarty.local.pagination}
{$emptyText = $smarty.local.emptyText}
{$emptyText = $emptyText|default:$aLang.common.empty}
{if $users} {if $users}
<ul class="user-list-avatar"> <ul class="user-list-avatar">
{foreach $users as $oUser} {foreach $users as $user}
{* TODO: Костыль для блогов *} {* TODO: Костыль для блогов *}
{if $oUser->getUser()}{$oUser = $oUser->getUser()}{/if} {if $user->getUser()}{$user = $user->getUser()}{/if}
<li>{component 'user' template='item' user=$oUser avatarSize=64}</li> <li>{component 'user' template='item' user=$user avatarSize=64}</li>
{/foreach} {/foreach}
</ul> </ul>
{else} {else}
{if $sUserListEmpty} {component 'alert' text=$emptyText mods='empty'}
{component 'alert' text=$sUserListEmpty mods='empty'}
{else}
{component 'alert' text=$aLang.common.empty mods='empty'}
{/if}
{/if} {/if}
{if $showPagination} {component 'pagination' total=+$pagination.iCountPage current=+$pagination.iCurrentPage url="{$pagination.sBaseUrl}/page__page__/"}
{component 'pagination' paging=$aPaging}
{/if}

View file

@ -1,45 +1,40 @@
{extends 'Component@item.item'} {if $user->getUser()}
{$user = $user->getUser()}
{/if}
{block 'options' append} {* Заголовок *}
{if $user->getUser()} {capture 'title'}
{$user = $user->getUser()} <a href="{$user->getUserWebPath()}">{$user->getDisplayName()}</a>
{/capture}
{* Описание *}
{capture 'content'}
{$session = $user->getSession()}
{$usernote = $user->getUserNote()}
{* Заметка *}
{if $usernote}
{component 'note' classes='js-user-note' note=$usernote targetId=$user->getId()}
{/if} {/if}
{* Заголовок *} {* Информация *}
{capture 'user_list_item_title'} {if $session}
<a href="{$user->getUserWebPath()}">{$user->getDisplayName()}</a> {$lastSessionDate = {date_format date=$session->getDateLast() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}}
{/capture} {/if}
{$title = $smarty.capture.user_list_item_title} {component 'info-list' classes='object-list-item-info' list=[
[ 'label' => "{$aLang.user.date_last_session}:", 'content' => ( $session ) ? $lastSessionDate : '&mdash;' ],
[ 'label' => "{$aLang.user.date_registration}:", 'content' => {date_format date=$user->getDateRegister() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"} ],
[ 'label' => "{$aLang.vote.rating}:", 'content' => $user->getRating() ]
]}
{/capture}
{* Описание *}
{capture 'user_list_item_content'}
{$session = $user->getSession()}
{$usernote = $user->getUserNote()}
{* Заметка *} {component 'item'
{if $usernote} title=$smarty.capture.title
{component 'note' classes='js-user-note' note=$usernote targetId=$user->getId()} content=$smarty.capture.content
{/if} image=[
{* Информация *}
{if $session}
{$lastSessionDate = {date_format date=$session->getDateLast() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"}}
{/if}
{component 'info-list' classes='object-list-item-info' list=[
[ 'label' => "{$aLang.user.date_last_session}:", 'content' => ( $session ) ? $lastSessionDate : '&mdash;' ],
[ 'label' => "{$aLang.user.date_registration}:", 'content' => {date_format date=$user->getDateRegister() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"} ],
[ 'label' => "{$aLang.vote.rating}:", 'content' => $user->getRating() ]
]}
{/capture}
{$content = $smarty.capture.user_list_item_content}
{* Изображение *}
{$image = [
'url' => $user->getUserWebPath(), 'url' => $user->getUserWebPath(),
'path' => $user->getProfileAvatarPath( 100 ), 'path' => $user->getProfileAvatarPath( 100 ),
'alt' => $user->getLogin() 'alt' => $user->getLogin()
]} ]}
{/block}

View file

@ -10,15 +10,19 @@
*} *}
{if $smarty.local.users} {if $smarty.local.users}
{$pagination = $smarty.local.pagination}
{* Заголовок *} {* Заголовок *}
{if $smarty.local.searchCount} {if $smarty.local.searchCount}
<h3 class="h3">{lang name='user.search.result_title' count=$smarty.local.searchCount plural=true}</h3> <h3 class="h3">{lang name='user.search.result_title' count=$smarty.local.searchCount plural=true}</h3>
{/if} {/if}
{* Список пользователей *} {* Список пользователей *}
<ul class="object-list user-list js-more-users-container"> {capture 'user_list'}
{include './user-list-loop.tpl' users=$smarty.local.users} {include './user-list-loop.tpl' users=$smarty.local.users}
</ul> {/capture}
{component 'item' template='group' classes='js-more-users-container' items=$smarty.capture.user_list}
{* Кнопка подгрузки *} {* Кнопка подгрузки *}
{if $smarty.local.useMore} {if $smarty.local.useMore}
@ -29,7 +33,7 @@
ajaxParams = [ 'next_page' => 2 ]} ajaxParams = [ 'next_page' => 2 ]}
{/if} {/if}
{else} {else}
{component 'pagination' paging=$smarty.local.pagination} {component 'pagination' total=+$pagination.iCountPage current=+$pagination.iCurrentPage url="{$pagination.sBaseUrl}/page__page__/"}
{/if} {/if}
{else} {else}
{component 'alert' text=$smarty.local.textEmpty|default:{lang name='user.notices.empty'} mods='empty'} {component 'alert' text=$smarty.local.textEmpty|default:{lang name='user.notices.empty'} mods='empty'}

View file

@ -1242,6 +1242,7 @@ return array(
), ),
// Поиск // Поиск
'search' => array( 'search' => array(
'title' => 'Поиск по пользователям',
'placeholder' => 'Поиск по логину', 'placeholder' => 'Поиск по логину',
'result_title' => 'Найден %%count%% пользователь;Найдено %%count%% пользователя;Найдено %%count%% пользователей' 'result_title' => 'Найден %%count%% пользователь;Найдено %%count%% пользователя;Найдено %%count%% пользователей'
), ),

View file

@ -68,7 +68,7 @@ jQuery(document).ready(function($){
/** /**
* Tabs * Tabs
*/ */
$( '.js-tabs-auth, .js-tabs-block' ).lsTabs(); $( '.js-tabs-auth' ).lsTabs();
/** /**