mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-05-19 17:28:23 +03:00
Доработка more
This commit is contained in:
parent
708a1301a2
commit
8c92c38f23
|
@ -148,17 +148,15 @@ class ActionBlogs extends Action
|
|||
$oViewer = $this->Viewer_GetLocalViewer();
|
||||
$oViewer->Assign('blogs', $aResult['collection'], true);
|
||||
$oViewer->Assign('oUserCurrent', $this->User_GetUserCurrent());
|
||||
$oViewer->Assign('textEmpty', $this->Lang_Get('search.alerts.empty'), true);
|
||||
$oViewer->Assign('useMore', true, true);
|
||||
$oViewer->Assign('hideMore', $bHideMore, true);
|
||||
$oViewer->Assign('searchCount', $aResult['count'], true);
|
||||
$this->Viewer_AssignAjax('html', $oViewer->Fetch("component@blog.list"));
|
||||
$this->Viewer_AssignAjax('html', $oViewer->Fetch("component@blog.list-loop"));
|
||||
/**
|
||||
* Для подгрузки
|
||||
*/
|
||||
$this->Viewer_AssignAjax('count_loaded', count($aResult['collection']));
|
||||
$this->Viewer_AssignAjax('next_page', count($aResult['collection']) > 0 ? $iPage + 1 : $iPage);
|
||||
$this->Viewer_AssignAjax('hide', $bHideMore);
|
||||
$this->Viewer_AssignAjax('searchCount', (int)$aResult['count']);
|
||||
$this->Viewer_AssignAjax('hide', $bHideMore or !$aResult['count'] or !count($aResult['collection']));
|
||||
$this->Viewer_AssignAjax('textEmpty', $this->Lang_Get('search.alerts.empty'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -154,17 +154,15 @@ class ActionPeople extends Action
|
|||
$oViewer = $this->Viewer_GetLocalViewer();
|
||||
$oViewer->Assign('users', $aResult['collection'], true);
|
||||
$oViewer->Assign('oUserCurrent', $this->User_GetUserCurrent());
|
||||
$oViewer->Assign('textEmpty', $this->Lang_Get('search.alerts.empty'), true);
|
||||
$oViewer->Assign('useMore', true, true);
|
||||
$oViewer->Assign('hideMore', $bHideMore, true);
|
||||
$oViewer->Assign('searchCount', $aResult['count'], true);
|
||||
$this->Viewer_AssignAjax('html', $oViewer->Fetch("component@user.list"));
|
||||
$this->Viewer_AssignAjax('html', $oViewer->Fetch("component@user.list-loop"));
|
||||
/**
|
||||
* Для подгрузки
|
||||
*/
|
||||
$this->Viewer_AssignAjax('count_loaded', count($aResult['collection']));
|
||||
$this->Viewer_AssignAjax('next_page', count($aResult['collection']) > 0 ? $iPage + 1 : $iPage);
|
||||
$this->Viewer_AssignAjax('hide', $bHideMore);
|
||||
$this->Viewer_AssignAjax('hide', $bHideMore or !$aResult['count'] or !count($aResult['collection']));
|
||||
$this->Viewer_AssignAjax('searchCount', (int)$aResult['count']);
|
||||
$this->Viewer_AssignAjax('textEmpty', $this->Lang_Get('search.alerts.empty'));
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,6 +13,7 @@
|
|||
{$component = 'activity'}
|
||||
|
||||
{$events = $smarty.local.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}>
|
||||
{if $events}
|
||||
|
@ -26,7 +27,7 @@
|
|||
{$last = end($events)}
|
||||
|
||||
{component 'more'
|
||||
count = $smarty.local.count
|
||||
count = $moreCount
|
||||
classes = 'js-activity-more'
|
||||
ajaxParams = [
|
||||
'last_id' => $last->getId(),
|
||||
|
|
|
@ -47,6 +47,7 @@
|
|||
urls: {
|
||||
load: this.option( 'urls.more' ),
|
||||
},
|
||||
proxy: [ 'last_id' ],
|
||||
target: this.elements.list,
|
||||
beforeload: function (e, context) {
|
||||
context._setParam( 'date_last', this.getDateLast() );
|
||||
|
|
9
application/frontend/components/blog/blog-list-loop.tpl
Normal file
9
application/frontend/components/blog/blog-list-loop.tpl
Normal file
|
@ -0,0 +1,9 @@
|
|||
{**
|
||||
* Список блогов
|
||||
*
|
||||
* @param array $blogs
|
||||
*}
|
||||
|
||||
{foreach $smarty.local.blogs as $blog}
|
||||
{component 'blog' template='list-item' blog=$blog}
|
||||
{/foreach}
|
|
@ -18,13 +18,7 @@
|
|||
{/if}
|
||||
|
||||
{* Список блогов *}
|
||||
{capture 'blog_list'}
|
||||
{foreach $smarty.local.blogs as $blog}
|
||||
{component 'blog' template='list-item' blog=$blog}
|
||||
{/foreach}
|
||||
{/capture}
|
||||
|
||||
{component 'item' template='group' classes='js-more-blogs-container' items=$smarty.capture.blog_list}
|
||||
{component 'item' template='group' classes='js-more-blogs-container' items={component 'blog' template='list-loop' blogs=$smarty.local.blogs}}
|
||||
|
||||
{* Кнопка подгрузки *}
|
||||
{if $smarty.local.useMore}
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
"add": "add.tpl",
|
||||
"admin": "admin.tpl",
|
||||
"list-item": "blog-list-item.tpl",
|
||||
"list-loop": "blog-list-loop.tpl",
|
||||
"list": "blog-list.tpl",
|
||||
"blog": "blog.tpl",
|
||||
"join": "join.tpl",
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit de06013c116bc8a1b84f7f159a82739958fcc91f
|
||||
Subproject commit 7259712cad10c24b86e32579511bdccf8f64f270
|
Loading…
Reference in a new issue