diff --git a/application/config/config.php b/application/config/config.php
index b29a7a97..2cf56e16 100644
--- a/application/config/config.php
+++ b/application/config/config.php
@@ -486,7 +486,7 @@ $config['block']['rule_blog'] = array(
$config['components'] = array(
// Базовые компоненты
'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',
// Компоненты LS CMS
diff --git a/application/frontend/components/activity/blocks/block.activity-recent.tpl b/application/frontend/components/activity/blocks/block.activity-recent.tpl
index a17a148e..9ecbc4ee 100644
--- a/application/frontend/components/activity/blocks/block.activity-recent.tpl
+++ b/application/frontend/components/activity/blocks/block.activity-recent.tpl
@@ -2,30 +2,21 @@
* Последняя активность
*}
-{extends 'Component@block.block'}
-
-{block 'block_title'}
- {lang 'activity.block_recent.title'}
-{/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'}
{lang 'activity.block_recent.feed'}
-{/block}
\ No newline at end of file
+{/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" ]
+ ]
+ ]}
\ No newline at end of file
diff --git a/application/frontend/components/activity/blocks/block.activity-settings.tpl b/application/frontend/components/activity/blocks/block.activity-settings.tpl
index 0b7fd080..8a9b83ae 100644
--- a/application/frontend/components/activity/blocks/block.activity-settings.tpl
+++ b/application/frontend/components/activity/blocks/block.activity-settings.tpl
@@ -2,16 +2,7 @@
* Блок настройки ленты активности
*}
-{extends 'Component@block.block'}
-
-{block 'block_title'}
- {$aLang.activity.settings.title}
-{/block}
-
-{block 'block_options' append}
- {$mods = "{$mods} activity-settings"}
-{/block}
-
-{block 'block_content'}
- {include '../settings.tpl' typesActive=$typesActive types=$types}
-{/block}
\ No newline at end of file
+{component 'block'
+ mods = 'activity-settings'
+ title = {lang 'activity.settings.title'}
+ content = {include '../settings.tpl' typesActive=$typesActive types=$types}}
\ No newline at end of file
diff --git a/application/frontend/components/activity/blocks/block.activity-users.tpl b/application/frontend/components/activity/blocks/block.activity-users.tpl
index 7fb84a26..61d17c40 100644
--- a/application/frontend/components/activity/blocks/block.activity-users.tpl
+++ b/application/frontend/components/activity/blocks/block.activity-users.tpl
@@ -2,16 +2,7 @@
* Выбор пользователей для чтения в ленте активности
*}
-{extends 'Component@block.block'}
-
-{block 'block_title'}
- {$aLang.activity.users.title}
-{/block}
-
-{block 'block_options' append}
- {$mods = "{$mods} activity-users"}
-{/block}
-
-{block 'block_content'}
- {include '../users.tpl' users=$users}
-{/block}
\ No newline at end of file
+{component 'block'
+ mods = 'activity-users'
+ title = {lang 'activity.users.title'}
+ content = {include '../users.tpl' users=$users}}
\ No newline at end of file
diff --git a/application/frontend/components/activity/blocks/recent-comments.tpl b/application/frontend/components/activity/blocks/recent-comments.tpl
index b62cf802..e8759a5a 100644
--- a/application/frontend/components/activity/blocks/recent-comments.tpl
+++ b/application/frontend/components/activity/blocks/recent-comments.tpl
@@ -3,30 +3,17 @@
* Топики отсортированные по времени последнего комментария
*}
-
-
- {foreach $smarty.local.comments as $comment}
- {$user = $comment->getUser()}
- {$topic = $comment->getTarget()}
- {$blog = $topic->getBlog()}
+{capture 'items'}
+ {foreach $smarty.local.comments as $comment}
+ {$topic = $comment->getTarget()}
-
- {/foreach}
-
-
\ No newline at end of file
+{component 'item' template='group' items=$smarty.capture.items}
\ No newline at end of file
diff --git a/application/frontend/components/activity/blocks/recent-item.tpl b/application/frontend/components/activity/blocks/recent-item.tpl
new file mode 100644
index 00000000..79510ec5
--- /dev/null
+++ b/application/frontend/components/activity/blocks/recent-item.tpl
@@ -0,0 +1,22 @@
+{capture 'item_content'}
+ {$user->getDisplayName()} →
+ {$blog->getTitle()|escape} →
+ {$topic->getTitle()|escape}
+
+
+
+ {date_format date=$smarty.local.date hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y"}
+ |
+
+ {lang 'comments.comments_declension' count=$topic->getCountComment() plural=true}
+
+{/capture}
+
+{component 'item'
+ element = 'li'
+ mods = 'image-rounded'
+ desc = $smarty.capture.item_content
+ image=[
+ 'path' => $user->getProfileAvatarPath(48),
+ 'url' => $user->getUserWebPath()
+ ]}
\ No newline at end of file
diff --git a/application/frontend/components/activity/blocks/recent-topics.tpl b/application/frontend/components/activity/blocks/recent-topics.tpl
index acf96de0..bad88b41 100644
--- a/application/frontend/components/activity/blocks/recent-topics.tpl
+++ b/application/frontend/components/activity/blocks/recent-topics.tpl
@@ -3,27 +3,15 @@
* Последние топики
*}
-
\ No newline at end of file
+{component 'item' template='group' items=$smarty.capture.items}
\ No newline at end of file
diff --git a/application/frontend/components/activity/css/activity.css b/application/frontend/components/activity/css/activity.css
index 5d5c9aa5..d45f308c 100644
--- a/application/frontend/components/activity/css/activity.css
+++ b/application/frontend/components/activity/css/activity.css
@@ -13,28 +13,25 @@
.activity-event-list {
margin: 0 0 20px;
}
+
+/* Дата-заголовок */
.activity-date {
- font-family: 'Open Sans', sans-serif;
- font-size: 20px;
- margin-top: 45px;
- padding-bottom: 10px;
- border-bottom: 1px solid #eee;
+ font: 400 18px/1.3em 'Open Sans', sans-serif;
+ padding: 10px 0;
+ border-bottom: 1px solid #E7E7E7;
+}
+.activity-event + .activity-date {
+ margin-top: 30px;
}
/**
* Событие
*/
.activity-event {
- margin-bottom: 5px;
- min-height: 48px;
- background: #fafafa;
- padding: 15px 15px 15px 75px;
- position: relative;
+ padding: 15px;
}
-.activity-event-avatar {
- position: absolute;
- top: 15px;
- left: 15px;
+.activity-event + .activity-event {
+ border-top: 1px solid #f2f2f2;
}
.activity-event-date {
display: block;
@@ -43,9 +40,8 @@
}
.activity-event-text {
padding: 10px 15px;
- background: #fff;
- border: 1px solid #eee;
- border-bottom-color: #ddd;
margin-top: 10px;
+ color: #777;
+ background: #fafafa;
font-size: 13px;
}
\ No newline at end of file
diff --git a/application/frontend/components/activity/css/blocks.css b/application/frontend/components/activity/css/blocks.css
index 4b945af5..7ccd39a4 100644
--- a/application/frontend/components/activity/css/blocks.css
+++ b/application/frontend/components/activity/css/blocks.css
@@ -4,40 +4,4 @@
* @license GNU General Public License, version 2
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
* @author Denis Shakhov
- *
- * 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;
-}
\ No newline at end of file
diff --git a/application/frontend/components/activity/event.tpl b/application/frontend/components/activity/event.tpl
index 2a03c0dc..54634ca4 100644
--- a/application/frontend/components/activity/event.tpl
+++ b/application/frontend/components/activity/event.tpl
@@ -25,12 +25,7 @@
{* Событие *}
-
- {* Аватар *}
-
-
-
-
+{capture 'event_content'}
{* Дата *}
\ No newline at end of file
+{/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()
+ ]}
\ No newline at end of file
diff --git a/application/frontend/components/blog/admin.tpl b/application/frontend/components/blog/admin.tpl
index 221a3468..ce428d55 100644
--- a/application/frontend/components/blog/admin.tpl
+++ b/application/frontend/components/blog/admin.tpl
@@ -47,7 +47,7 @@
{component 'button' name='submit_blog_admin' text=$aLang.common.save mods='primary'}
- {component 'pagination' paging=$smarty.local.pagination}
+ {component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}
{else}
{component 'alert' text=$aLang.blog.admin.alerts.empty mods='empty'}
{/if}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blog-actions.tpl b/application/frontend/components/blog/blocks/block.blog-actions.tpl
index 2a4680e9..de9a9fec 100644
--- a/application/frontend/components/blog/blocks/block.blog-actions.tpl
+++ b/application/frontend/components/blog/blocks/block.blog-actions.tpl
@@ -4,14 +4,7 @@
* TODO: Уни-ать список экшенов
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {* TODO: Fix styles *}
- {$mods = "{$mods} nopadding transparent user-actions"}
-{/block}
-
-{block 'block_content'}
+{capture 'block_content'}
{* Список экшенов *}
{$actions = []}
@@ -75,4 +68,8 @@
{/foreach}
-{/block}
\ No newline at end of file
+{/capture}
+
+{component 'block'
+ mods = 'nopadding transparent user-actions'
+ content = $smarty.capture.block_content}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blog-add.tpl b/application/frontend/components/blog/blocks/block.blog-add.tpl
index 9e024bac..02c34610 100644
--- a/application/frontend/components/blog/blocks/block.blog-add.tpl
+++ b/application/frontend/components/blog/blocks/block.blog-add.tpl
@@ -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())}
+ {$aLang.blog.can_add}
-{block 'block_options' append}
- {$mods = "{$mods} blog-add"}
+ {component 'button' url="{router page='blog'}add/" mods='primary large' text=$aLang.blog.create_blog}
+ {else}
+ {lang name='blog.cant_add' rating=Config::Get('acl.create.blog.rating')}
- {if ! $oUserCurrent}
- {$show = false}
- {/if}
-{/block}
+ {component 'button' mods='primary large' text=$aLang.blog.create_blog isDisabled=true}
+ {/if}
+ {/capture}
-{block 'block_content'}
- {if $oUserCurrent && ($oUserCurrent->getRating() > Config::Get('acl.create.blog.rating') or $oUserCurrent->isAdministrator())}
- {$aLang.blog.can_add}
-
- {component 'button' url="{router page='blog'}add/" mods='primary large' text=$aLang.blog.create_blog}
- {else}
- {lang name='blog.cant_add' rating=Config::Get('acl.create.blog.rating')}
-
- {component 'button' mods='primary large' text=$aLang.blog.create_blog isDisabled=true}
- {/if}
-{/block}
\ No newline at end of file
+ {component 'block' mods='blog-add' content=$smarty.capture.block_content}
+{/if}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blog-admins.tpl b/application/frontend/components/blog/blocks/block.blog-admins.tpl
index e6f185f2..7f2f8ea0 100644
--- a/application/frontend/components/blog/blocks/block.blog-admins.tpl
+++ b/application/frontend/components/blog/blocks/block.blog-admins.tpl
@@ -2,17 +2,7 @@
* Список управляющих блога
*}
-{extends 'Component@block.block'}
-
-{block 'block_title'}
- {$aLang.blog.administrators}
-{/block}
-
-{block 'block_options' append}
- {$mods = "{$mods} blog-admins"}
-{/block}
-
-{block 'block_content'}
+{capture 'block_content'}
{* Создатель *}
{component 'user' template='list-small' users=[ $blog->getOwner() ] title=$aLang.blog.owner}
@@ -25,4 +15,9 @@
{if count($blogModerators)}
{component 'user' template='list-small' users=$blogModerators title="{$aLang.blog.moderators} ({count($blogModerators)})"}
{/if}
-{/block}
\ No newline at end of file
+{/capture}
+
+{component 'block'
+ mods = 'blog-admins'
+ title = {lang 'blog.administrators'}
+ content = $smarty.capture.block_content}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blog-info-note.tpl b/application/frontend/components/blog/blocks/block.blog-info-note.tpl
index f1c5308d..29a15504 100644
--- a/application/frontend/components/blog/blocks/block.blog-info-note.tpl
+++ b/application/frontend/components/blog/blocks/block.blog-info-note.tpl
@@ -2,16 +2,7 @@
* Подсказка отображаемая при создании топика
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} blog-info-note"}
-{/block}
-
-{block 'block_title'}
- {lang 'topic.blocks.tip.title'}
-{/block}
-
-{block 'block_content'}
- {lang 'topic.blocks.tip.text'}
-{/block}
\ No newline at end of file
+{component 'block'
+ mods = 'info'
+ title = {lang 'topic.blocks.tip.title'}
+ content = {lang 'topic.blocks.tip.text'}}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blog-invite.tpl b/application/frontend/components/blog/blocks/block.blog-invite.tpl
index 80ed73b8..2af5c85e 100644
--- a/application/frontend/components/blog/blocks/block.blog-invite.tpl
+++ b/application/frontend/components/blog/blocks/block.blog-invite.tpl
@@ -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'}
- {$aLang.blog.invite.invite_users}
-{/block}
-
-{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}
\ No newline at end of file
+{component 'block'
+ mods = 'blog-invite'
+ title = {lang 'blog.invite.invite_users'}
+ content = $blockContent}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blog-photo.tpl b/application/frontend/components/blog/blocks/block.blog-photo.tpl
index 334a9d45..dba147ed 100644
--- a/application/frontend/components/blog/blocks/block.blog-photo.tpl
+++ b/application/frontend/components/blog/blocks/block.blog-photo.tpl
@@ -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}
-
-{block 'block_options' append}
- {$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}
\ No newline at end of file
+{component 'block'
+ mods = 'nopadding transparent blog-actions'
+ content = $blockContent}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blog-users.tpl b/application/frontend/components/blog/blocks/block.blog-users.tpl
index dfd83242..55a3a0f0 100644
--- a/application/frontend/components/blog/blocks/block.blog-users.tpl
+++ b/application/frontend/components/blog/blocks/block.blog-users.tpl
@@ -2,24 +2,18 @@
* Список пользователей блога
*}
-{extends 'Component@block.block'}
-
-{block 'block_title'}
+{capture 'block_title'}
{$usersCount = count($blogUsers)}
-
- {if $usersCount}
- {$usersCount} {$usersCount|declension:$aLang.blog.readers_declension:'russian'}
- {else}
- {$aLang.blog.users.empty}
- {/if}
-
-{/block}
+ {if $usersCount}
+ {$usersCount} {lang "{$smarty.local.titleLang|default:'blog.readers_declension'}" count=$usersCount plural=true}
+ {else}
+ {$aLang.blog.users.empty}
+ {/if}
+{/capture}
-{block 'block_options' append}
- {$mods = "{$mods} blog-users"}
-{/block}
-
-{block 'block_content'}
- {component 'user' template='list-avatar' users=$blogUsers}
-{/block}
\ No newline at end of file
+{component 'block'
+ mods = 'blog-users'
+ title = $smarty.capture.block_title
+ titleUrl = "{$blog->getUrlFull()}users/"
+ content = {component 'user' template='list-avatar' users=$blogUsers}}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blogs-search.tpl b/application/frontend/components/blog/blocks/block.blogs-search.tpl
index a01acd4f..5e497071 100644
--- a/application/frontend/components/blog/blocks/block.blogs-search.tpl
+++ b/application/frontend/components/blog/blocks/block.blogs-search.tpl
@@ -2,17 +2,7 @@
* Фильтр блогов
*}
-{extends 'Component@block.block'}
-
-{block 'block_title'}
- {lang 'blog.blocks.search.title'}
-{/block}
-
-{block 'block_options' append}
- {$mods = "{$mods} blogs-search"}
-{/block}
-
-{block 'block_content'}
+{capture 'block_content'}
{lang 'blog.blocks.search.categories.title'}
{* Категории *}
@@ -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='join' label='Читаю'}
-{/block}
\ No newline at end of file
+{/capture}
+
+{component 'block'
+ mods = 'blogs-search'
+ title = {lang 'blog.blocks.search.title'}
+ content = $smarty.capture.block_content}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/block.blogs.tpl b/application/frontend/components/blog/blocks/block.blogs.tpl
index 7847a210..4024c0ae 100644
--- a/application/frontend/components/blog/blocks/block.blogs.tpl
+++ b/application/frontend/components/blog/blocks/block.blogs.tpl
@@ -2,21 +2,16 @@
* Блок со списком блогов
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} blogs nopadding"}
- {$classes = "{$classes} js-block-default"}
-{/block}
-
-{block 'block_title'}
- {lang 'blog.blocks.blogs.title'}
-{/block}
-
-{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}
\ No newline at end of file
+{component 'block'
+ mods = 'blogs'
+ classes = 'blog-block-blogs js-block-default'
+ title = {lang 'blog.blocks.blogs.title'}
+ titleUrl = {router page='blogs'}
+ tabs = [
+ 'classes' => 'js-tabs-block',
+ 'tabs' => [
+ [ 'text' => {lang 'blog.blocks.blogs.nav.top'}, 'url' => "{router page='ajax'}blogs/top", 'list' => $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 ]
+ ]
+ ]}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blocks/blogs-top.tpl b/application/frontend/components/blog/blocks/blogs-top.tpl
index 123495af..59359ef7 100644
--- a/application/frontend/components/blog/blocks/blogs-top.tpl
+++ b/application/frontend/components/blog/blocks/blogs-top.tpl
@@ -1,25 +1,27 @@
{**
* Блок со списоком блогов
* Список блогов
- *
- * TODO: Component item
*}
-
\ No newline at end of file
+{component 'item' template='group' items=$items}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blog-list-item.tpl b/application/frontend/components/blog/blog-list-item.tpl
index bc0747fb..eccae60f 100644
--- a/application/frontend/components/blog/blog-list-item.tpl
+++ b/application/frontend/components/blog/blog-list-item.tpl
@@ -4,56 +4,50 @@
* @param object $blog
*}
-{extends 'Component@item.item'}
-{block 'options' append}
- {$blog = $smarty.local.blog}
+{$blog = $smarty.local.blog}
- {* Заголовок *}
- {capture 'blog_list_item_title'}
- {if $blog->getType() == 'close'}
-
- {/if}
+{* Заголовок *}
+{capture 'title'}
+ {if $blog->getType() == 'close'}
+
+ {/if}
- {$blog->getTitle()|escape}
- {/capture}
+ {$blog->getTitle()|escape}
+{/capture}
- {$title = $smarty.capture.blog_list_item_title}
+{* Описание *}
+{capture 'desc'}
+ {$blog->getDescription()|strip_tags|truncate:120}
+{/capture}
- {* Описание *}
- {capture 'blog_list_item_desc'}
- {$blog->getDescription()|strip_tags|truncate:120}
- {/capture}
+{* Описание *}
+{capture 'content'}
+ {* Действия *}
+
+ {* Вступить/покинуть блог *}
+ {include './join.tpl' blog=$blog}
+
- {$desc = $smarty.capture.blog_list_item_desc}
+ {* Информация *}
+ {$info = [
+ [ 'label' => "{$aLang.blog.users.readers_total}:", 'content' => "getId()}\">{$blog->getCountUser()} " ],
+ [ 'label' => "{$aLang.blog.topics_total}:", 'content' => $blog->getCountTopic() ]
+ ]}
- {* Описание *}
- {capture 'blog_list_item_content'}
- {* Информация *}
- {$info = [
- [ 'label' => "{$aLang.blog.users.readers_total}:", 'content' => "getId()}\">{$blog->getCountUser()} " ],
- [ 'label' => "{$aLang.blog.topics_total}:", 'content' => $blog->getCountTopic() ]
- ]}
+ {if $blog->category->getCategory()}
+ {$info[] = [ 'label' => "{$aLang.blog.categories.category}:", 'content' => $blog->category->getCategory()->getTitle() ]}
+ {/if}
- {if $blog->category->getCategory()}
- {$info[] = [ 'label' => "{$aLang.blog.categories.category}:", 'content' => $blog->category->getCategory()->getTitle() ]}
- {/if}
+ {component 'info-list' list=$info classes='object-list-item-info'}
+{/capture}
- {component 'info-list' list=$info classes='object-list-item-info'}
-
- {* Действия *}
-
- {* Вступить/покинуть блог *}
- {include './join.tpl' blog=$blog}
-
- {/capture}
-
- {$content = $smarty.capture.blog_list_item_content}
-
- {* Изображение *}
- {$image = [
+{component 'item'
+ title=$smarty.capture.title
+ desc=$smarty.capture.desc
+ content=$smarty.capture.content
+ image=[
'url' => $blog->getUrlFull(),
'path' => $blog->getAvatarPath( 100 ),
'alt' => $blog->getTitle()|escape
- ]}
-{/block}
\ No newline at end of file
+ ]}
\ No newline at end of file
diff --git a/application/frontend/components/blog/blog-list.tpl b/application/frontend/components/blog/blog-list.tpl
index dcc7cb35..56474ff8 100644
--- a/application/frontend/components/blog/blog-list.tpl
+++ b/application/frontend/components/blog/blog-list.tpl
@@ -10,17 +10,21 @@
*}
{if $smarty.local.blogs}
+ {$paging = $smarty.local.pagination}
+
{* Заголовок *}
{if $smarty.local.searchCount}
{lang name='blog.search.result_title' count=$smarty.local.searchCount plural=true}
{/if}
{* Список блогов *}
-
+ {capture 'blog_list'}
{foreach $smarty.local.blogs as $blog}
{include './blog-list-item.tpl' blog=$blog}
{/foreach}
-
+ {/capture}
+
+ {component 'item' template='group' classes='js-more-blogs-container' items=$smarty.capture.blog_list}
{* Кнопка подгрузки *}
{if $smarty.local.useMore}
@@ -31,7 +35,7 @@
ajaxParams = [ 'next_page' => 2 ]}
{/if}
{else}
- {component 'pagination' paging=$smarty.local.pagination}
+ {component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}
{/if}
{else}
{component 'alert' text=(($smarty.local.textEmpty) ? $smarty.local.textEmpty : $aLang.blog.alerts.empty) mods='empty'}
diff --git a/application/frontend/components/blog/css/blog-blocks.css b/application/frontend/components/blog/css/blog-blocks.css
index 915e9dbb..7ecaff8e 100644
--- a/application/frontend/components/blog/css/blog-blocks.css
+++ b/application/frontend/components/blog/css/blog-blocks.css
@@ -4,26 +4,20 @@
* @modifier blog-add
* @template blocks/block.blog-add.tpl
*/
-.block--blog-add .block-content { padding: 30px; text-align: center; }
-.block--blog-add p { margin-bottom: 25px; }
-
+.block--blog-add .block-content {
+ padding: 30px;
+ text-align: center;
+}
/**
- * Навигация по блогам
+ * Список блогов
*
- * @modifier blog-navigation
- * @template blocks/block.blog-nav.tpl
+ * @template blocks/block.blogs.tpl
*/
-.block--blog-navigation p { margin-bottom: 15px; }
-.block--blog-navigation .blog-navigator-categories option:first-child { color: #aaa; }
-
-
-/**
- * Информация о блоге
- *
- * @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; }
\ No newline at end of file
+.block.blog-block-blogs .item-title {
+ font-size: 16px;
+ margin-bottom: 7px;
+}
+.block.blog-block-blogs .item-image {
+ border-radius: 3px;
+}
\ No newline at end of file
diff --git a/application/frontend/components/feed/blocks/block.userfeed-blogs.tpl b/application/frontend/components/feed/blocks/block.userfeed-blogs.tpl
index b4128c53..086f1425 100644
--- a/application/frontend/components/feed/blocks/block.userfeed-blogs.tpl
+++ b/application/frontend/components/feed/blocks/block.userfeed-blogs.tpl
@@ -2,16 +2,7 @@
* Выбор блогов для чтения в ленте
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} feed-blogs"}
-{/block}
-
-{block 'block_title'}
- {$aLang.feed.blogs.title}
-{/block}
-
-{block 'block_content'}
- {include '../blogs.tpl' blogsJoined=$blogsJoined blogsSubscribed=$blogsSubscribed}
-{/block}
\ No newline at end of file
+{component 'block'
+ mods = 'feed-blogs'
+ title = {lang 'feed.blogs.title'}
+ content = {include '../blogs.tpl' blogsJoined=$blogsJoined blogsSubscribed=$blogsSubscribed}}
\ No newline at end of file
diff --git a/application/frontend/components/feed/blocks/block.userfeed-users.tpl b/application/frontend/components/feed/blocks/block.userfeed-users.tpl
index 657eab76..90791991 100644
--- a/application/frontend/components/feed/blocks/block.userfeed-users.tpl
+++ b/application/frontend/components/feed/blocks/block.userfeed-users.tpl
@@ -2,16 +2,7 @@
* Выбор пользователей для чтения в ленте
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} feed-users"}
-{/block}
-
-{block 'block_title'}
- {$aLang.feed.users.title}
-{/block}
-
-{block 'block_content'}
- {include '../users.tpl' users=$users}
-{/block}
\ No newline at end of file
+{component 'block'
+ mods = 'feed-users'
+ title = {lang 'feed.users.title'}
+ content = {include '../users.tpl' users=$users}}
\ No newline at end of file
diff --git a/application/frontend/components/talk/talk-list.tpl b/application/frontend/components/talk/talk-list.tpl
index dddafab2..67569a89 100644
--- a/application/frontend/components/talk/talk-list.tpl
+++ b/application/frontend/components/talk/talk-list.tpl
@@ -128,4 +128,4 @@
{component 'alert' text=$aLang.talk.notices.empty mods='empty'}
{/if}
-{component 'pagination' paging=$smarty.local.paging}
\ No newline at end of file
+{component 'pagination' total=+$paging.iCountPage current=+$paging.iCurrentPage url="{$paging.sBaseUrl}/page__page__/{$paging.sGetParams}"}
\ No newline at end of file
diff --git a/application/frontend/components/topic/topic-list.tpl b/application/frontend/components/topic/topic-list.tpl
index 26e9f81b..33465cfd 100644
--- a/application/frontend/components/topic/topic-list.tpl
+++ b/application/frontend/components/topic/topic-list.tpl
@@ -6,6 +6,7 @@
*}
{$topics = $smarty.local.topics}
+{$paging = $smarty.local.paging}
{if $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}
{/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}
{component 'alert' text=$aLang.common.empty mods='empty'}
{/if}
\ No newline at end of file
diff --git a/application/frontend/components/user/blocks/block.user-actions.tpl b/application/frontend/components/user/blocks/block.user-actions.tpl
index b890a5fa..fe1837ce 100644
--- a/application/frontend/components/user/blocks/block.user-actions.tpl
+++ b/application/frontend/components/user/blocks/block.user-actions.tpl
@@ -1,19 +1,9 @@
{**
* Меню пользователя ("Добавить в друзья", "Написать письмо" и т.д.)
- *
- * @styles css/blocks.css
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} nopadding transparent user-actions"}
-
- {if ! $oUserCurrent or ( $oUserCurrent && $oUserCurrent->getId() == $oUserProfile->getId() )}
- {$show = false}
- {/if}
-{/block}
-
-{block 'block_content'}
- {component 'user' template='actions' user=$oUserProfile}
-{/block}
\ No newline at end of file
+{if $oUserCurrent && $oUserCurrent->getId() != $oUserProfile->getId() }
+ {component 'block'
+ mods = 'nopadding transparent user-actions'
+ content = {component 'user' template='actions' user=$oUserProfile}}
+{/if}
\ No newline at end of file
diff --git a/application/frontend/components/user/blocks/block.user-nav.tpl b/application/frontend/components/user/blocks/block.user-nav.tpl
index 3a6eaaf2..41eefb17 100644
--- a/application/frontend/components/user/blocks/block.user-nav.tpl
+++ b/application/frontend/components/user/blocks/block.user-nav.tpl
@@ -1,15 +1,5 @@
{**
* Блок с навигацией по профилю пользователя
- *
- * @styles css/blocks.css
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} nopadding transparent user-nav"}
-{/block}
-
-{block 'block_content_after'}
- {include 'navs/nav.user.tpl'}
-{/block}
\ No newline at end of file
+{component 'block' mods='nopadding transparent user-nav' content={include 'navs/nav.user.tpl'}}
\ No newline at end of file
diff --git a/application/frontend/components/user/blocks/block.user-note.tpl b/application/frontend/components/user/blocks/block.user-note.tpl
index be95c556..c27c74af 100644
--- a/application/frontend/components/user/blocks/block.user-note.tpl
+++ b/application/frontend/components/user/blocks/block.user-note.tpl
@@ -1,19 +1,9 @@
{**
* Блок с заметкой о пользователе
- *
- * @styles css/blocks.css
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} user-note nopadding transparent"}
-
- {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}
\ No newline at end of file
+{if $oUserCurrent && $oUserCurrent->getId() != $oUserProfile->getId() }
+ {component 'block'
+ mods = 'nopadding transparent user-note'
+ content = {component 'note' classes='js-user-note' note=$oUserProfile->getUserNote() targetId=$oUserProfile->getId()}}
+{/if}
\ No newline at end of file
diff --git a/application/frontend/components/user/blocks/block.user-photo.tpl b/application/frontend/components/user/blocks/block.user-photo.tpl
index 284a7367..6f7c9f42 100644
--- a/application/frontend/components/user/blocks/block.user-photo.tpl
+++ b/application/frontend/components/user/blocks/block.user-photo.tpl
@@ -2,14 +2,7 @@
* Блок с фотографией пользователя в профиле
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} user-photo"}
- {$classes = "{$classes} js-ajax-photo-upload"}
-{/block}
-
-{block 'block_content'}
+{capture 'block_content'}
{$session = $oUserProfile->getSession()}
{* Статус онлайн\оффлайн *}
@@ -37,4 +30,8 @@
url = $oUserProfile->getUserWebPath()
photoPath = $oUserProfile->getProfileFotoPath()
photoAltText = $oUserProfile->getDisplayName()}
-{/block}
\ No newline at end of file
+{/capture}
+
+{component 'block'
+ mods = 'user-photo'
+ content = $smarty.capture.block_content}
\ No newline at end of file
diff --git a/application/frontend/components/user/blocks/block.users-search.tpl b/application/frontend/components/user/blocks/block.users-search.tpl
index c71134a0..f643f87a 100644
--- a/application/frontend/components/user/blocks/block.users-search.tpl
+++ b/application/frontend/components/user/blocks/block.users-search.tpl
@@ -2,17 +2,7 @@
* Статистика по пользователям
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} users-search"}
-{/block}
-
-{block 'block_title'}
- Поиск по пользователям
-{/block}
-
-{block 'block_content'}
+{capture 'block_content'}
{* Сейчас на сайте *}
{component 'field' template='checkbox'
name = 'is_online'
@@ -35,4 +25,9 @@
countries = $countriesUsed
name = 'geo'
label = {lang name='user.settings.profile.fields.place.label'} }
-{/block}
\ No newline at end of file
+{/capture}
+
+{component 'block'
+ mods = 'users-search'
+ title = {lang 'user.search.title'}
+ content = $smarty.capture.block_content}
\ No newline at end of file
diff --git a/application/frontend/components/user/blocks/block.users-statistics.tpl b/application/frontend/components/user/blocks/block.users-statistics.tpl
index e8087677..6a171030 100644
--- a/application/frontend/components/user/blocks/block.users-statistics.tpl
+++ b/application/frontend/components/user/blocks/block.users-statistics.tpl
@@ -2,16 +2,7 @@
* Статистика по пользователям
*}
-{extends 'Component@block.block'}
-
-{block 'block_options' append}
- {$mods = "{$mods} users-stats"}
-{/block}
-
-{block 'block_title'}
- {$aLang.user.stats.title}
-{/block}
-
-{block 'block_content'}
- {component 'user' template='stat' stat=$usersStat}
-{/block}
\ No newline at end of file
+{component 'block'
+ mods = 'info users-stats'
+ title = {lang 'user.stats.title'}
+ content = {component 'user' template='stat' stat=$usersStat}}
\ No newline at end of file
diff --git a/application/frontend/components/user/css/user.css b/application/frontend/components/user/css/user.css
index 983e4e3c..c6e954b4 100644
--- a/application/frontend/components/user/css/user.css
+++ b/application/frontend/components/user/css/user.css
@@ -14,11 +14,6 @@
color: #555;
}
-/* О себе */
-.profile-info-about {
- margin-bottom: 30px;
-}
-
/* Блок с информацией */
.user-info-group {
margin-bottom: 50px;
diff --git a/application/frontend/components/user/user-list-avatar.tpl b/application/frontend/components/user/user-list-avatar.tpl
index 8fc0de4b..6dfc2304 100644
--- a/application/frontend/components/user/user-list-avatar.tpl
+++ b/application/frontend/components/user/user-list-avatar.tpl
@@ -2,28 +2,27 @@
* Список пользователей (аватары)
*
* @param array $users Список пользователей
- * @param array $showPagination Показывать или нет пагинацию (false)
+ * @param array $pagination Массив с параметрами пагинации
+ * @param array $emptyText
*}
{$users = $smarty.local.users}
+{$pagination = $smarty.local.pagination}
+{$emptyText = $smarty.local.emptyText}
+
+{$emptyText = $emptyText|default:$aLang.common.empty}
{if $users}
- {foreach $users as $oUser}
+ {foreach $users as $user}
{* TODO: Костыль для блогов *}
- {if $oUser->getUser()}{$oUser = $oUser->getUser()}{/if}
+ {if $user->getUser()}{$user = $user->getUser()}{/if}
- {component 'user' template='item' user=$oUser avatarSize=64}
+ {component 'user' template='item' user=$user avatarSize=64}
{/foreach}
{else}
- {if $sUserListEmpty}
- {component 'alert' text=$sUserListEmpty mods='empty'}
- {else}
- {component 'alert' text=$aLang.common.empty mods='empty'}
- {/if}
+ {component 'alert' text=$emptyText mods='empty'}
{/if}
-{if $showPagination}
- {component 'pagination' paging=$aPaging}
-{/if}
\ No newline at end of file
+{component 'pagination' total=+$pagination.iCountPage current=+$pagination.iCurrentPage url="{$pagination.sBaseUrl}/page__page__/"}
\ No newline at end of file
diff --git a/application/frontend/components/user/user-list-item.tpl b/application/frontend/components/user/user-list-item.tpl
index 73e264d0..cd5bcefa 100644
--- a/application/frontend/components/user/user-list-item.tpl
+++ b/application/frontend/components/user/user-list-item.tpl
@@ -1,45 +1,40 @@
-{extends 'Component@item.item'}
+{if $user->getUser()}
+ {$user = $user->getUser()}
+{/if}
-{block 'options' append}
- {if $user->getUser()}
- {$user = $user->getUser()}
+{* Заголовок *}
+{capture 'title'}
+ {$user->getDisplayName()}
+{/capture}
+
+{* Описание *}
+{capture 'content'}
+ {$session = $user->getSession()}
+ {$usernote = $user->getUserNote()}
+
+ {* Заметка *}
+ {if $usernote}
+ {component 'note' classes='js-user-note' note=$usernote targetId=$user->getId()}
{/if}
- {* Заголовок *}
- {capture 'user_list_item_title'}
- {$user->getDisplayName()}
- {/capture}
+ {* Информация *}
+ {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}
- {$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 : '—' ],
+ [ '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()}
- {* Заметка *}
- {if $usernote}
- {component 'note' classes='js-user-note' note=$usernote targetId=$user->getId()}
- {/if}
-
- {* Информация *}
- {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 : '—' ],
- [ '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 = [
+{component 'item'
+ title=$smarty.capture.title
+ content=$smarty.capture.content
+ image=[
'url' => $user->getUserWebPath(),
'path' => $user->getProfileAvatarPath( 100 ),
'alt' => $user->getLogin()
- ]}
-{/block}
\ No newline at end of file
+ ]}
\ No newline at end of file
diff --git a/application/frontend/components/user/user-list.tpl b/application/frontend/components/user/user-list.tpl
index 0a7cb9fc..9c7cb213 100644
--- a/application/frontend/components/user/user-list.tpl
+++ b/application/frontend/components/user/user-list.tpl
@@ -10,15 +10,19 @@
*}
{if $smarty.local.users}
+ {$pagination = $smarty.local.pagination}
+
{* Заголовок *}
{if $smarty.local.searchCount}
{lang name='user.search.result_title' count=$smarty.local.searchCount plural=true}
{/if}
{* Список пользователей *}
-
+ {capture 'user_list'}
{include './user-list-loop.tpl' users=$smarty.local.users}
-
+ {/capture}
+
+ {component 'item' template='group' classes='js-more-users-container' items=$smarty.capture.user_list}
{* Кнопка подгрузки *}
{if $smarty.local.useMore}
@@ -29,7 +33,7 @@
ajaxParams = [ 'next_page' => 2 ]}
{/if}
{else}
- {component 'pagination' paging=$smarty.local.pagination}
+ {component 'pagination' total=+$pagination.iCountPage current=+$pagination.iCurrentPage url="{$pagination.sBaseUrl}/page__page__/"}
{/if}
{else}
{component 'alert' text=$smarty.local.textEmpty|default:{lang name='user.notices.empty'} mods='empty'}
diff --git a/application/frontend/i18n/ru.php b/application/frontend/i18n/ru.php
index 92754bca..9a2121d8 100644
--- a/application/frontend/i18n/ru.php
+++ b/application/frontend/i18n/ru.php
@@ -1242,6 +1242,7 @@ return array(
),
// Поиск
'search' => array(
+ 'title' => 'Поиск по пользователям',
'placeholder' => 'Поиск по логину',
'result_title' => 'Найден %%count%% пользователь;Найдено %%count%% пользователя;Найдено %%count%% пользователей'
),
diff --git a/application/frontend/skin/developer/assets/js/init.js b/application/frontend/skin/developer/assets/js/init.js
index 6107bb9a..bdaf5636 100644
--- a/application/frontend/skin/developer/assets/js/init.js
+++ b/application/frontend/skin/developer/assets/js/init.js
@@ -68,7 +68,7 @@ jQuery(document).ready(function($){
/**
* Tabs
*/
- $( '.js-tabs-auth, .js-tabs-block' ).lsTabs();
+ $( '.js-tabs-auth' ).lsTabs();
/**