mirror of
https://github.com/Oreolek/ifhub.club.git
synced 2024-06-16 23:00:51 +03:00
Универсальный аякс поиск
This commit is contained in:
parent
9c2a8568db
commit
d4c956b22e
|
@ -76,7 +76,7 @@ class ActionPeople extends Action {
|
|||
/**
|
||||
* Получаем из реквеста первые быквы для поиска пользователей по логину
|
||||
*/
|
||||
$sTitle=getRequest('user_login');
|
||||
$sTitle=getRequest('sText');
|
||||
if (is_string($sTitle) and mb_strlen($sTitle,'utf-8')) {
|
||||
$sTitle=str_replace(array('_','%'),array('\_','\%'),$sTitle);
|
||||
} else {
|
||||
|
@ -103,7 +103,9 @@ class ActionPeople extends Action {
|
|||
$oViewer=$this->Viewer_GetLocalViewer();
|
||||
$oViewer->Assign('aUsersList',$aResult['collection']);
|
||||
$oViewer->Assign('oUserCurrent',$this->User_GetUserCurrent());
|
||||
$oViewer->Assign('sUserListEmpty',$this->Lang_Get('user_search_empty'));
|
||||
$oViewer->Assign('sUserListEmpty',$this->Lang_Get('search.alerts.empty'));
|
||||
$oViewer->Assign('bIsSearch', true);
|
||||
$oViewer->Assign('iSearchCount', count($aResult['collection']));
|
||||
$this->Viewer_AssignAjax('sText',$oViewer->Fetch("user_list.tpl"));
|
||||
}
|
||||
/**
|
||||
|
@ -269,7 +271,7 @@ class ActionPeople extends Action {
|
|||
* Загружаем переменные в шаблон
|
||||
*/
|
||||
$this->Viewer_Assign('aPaging',$aPaging);
|
||||
$this->Viewer_Assign('aUsersRating',$aUsers);
|
||||
$this->Viewer_Assign('aUsers',$aUsers);
|
||||
$this->Viewer_Assign('aPrefixUser',$aPrefixUser);
|
||||
$this->Viewer_Assign("sUsersOrder",htmlspecialchars($sOrder));
|
||||
$this->Viewer_Assign("sUsersOrderWay",htmlspecialchars($sOrderWay));
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
* @package blocks
|
||||
* @since 1.1
|
||||
*/
|
||||
class BlockBlogCategories extends Block {
|
||||
class BlockBlogsSearch extends Block {
|
||||
/**
|
||||
* Запуск обработки
|
||||
*/
|
|
@ -1,8 +1,8 @@
|
|||
/**
|
||||
* Блоги
|
||||
*
|
||||
*
|
||||
* @module ls/blogs
|
||||
*
|
||||
*
|
||||
* @license GNU General Public License, version 2
|
||||
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
|
||||
* @author Denis Shakhov <denis.shakhov@gmail.com>
|
||||
|
@ -15,7 +15,7 @@ ls.blog = (function ($) {
|
|||
|
||||
/**
|
||||
* Дефолтные опции
|
||||
*
|
||||
*
|
||||
* @private
|
||||
*/
|
||||
var _defaults = {
|
||||
|
@ -168,37 +168,9 @@ ls.blog = (function ($) {
|
|||
this.elements.blog_add_type_note.text(ls.lang.get('blog.add.fields.type.note_' + type));
|
||||
};
|
||||
|
||||
/**
|
||||
* Поиск блогов
|
||||
*/
|
||||
this.searchBlogs = function(sFormSelector) {
|
||||
var url = ls.blog.options.routers.search,
|
||||
oInputSearch = $(sFormSelector).find('input'),
|
||||
oOriginalContainer = $('#blogs-list-original'),
|
||||
oSearchContainer = $('#blogs-list-search');
|
||||
|
||||
oInputSearch.addClass(ls.options.classes.states.loading);
|
||||
|
||||
ls.hook.marker('searchBlogsBefore');
|
||||
|
||||
ls.ajax.submit(url, sFormSelector, function(result) {
|
||||
oInputSearch.removeClass(ls.options.classes.states.loading);
|
||||
|
||||
if (result.bStateError) {
|
||||
oSearchContainer.hide();
|
||||
oOriginalContainer.show();
|
||||
} else {
|
||||
oOriginalContainer.hide();
|
||||
oSearchContainer.html(result.sText).show();
|
||||
|
||||
ls.hook.run('ls_blog_search_blogs_after', [sFormSelector, result]);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Подгружает блоги из категории
|
||||
*
|
||||
*
|
||||
* @param {String} id ID категории
|
||||
*/
|
||||
this.loadBlogsByCategory = function(iId) {
|
||||
|
|
|
@ -8,15 +8,9 @@
|
|||
|
||||
{* Список блогов *}
|
||||
{if $aBlogs}
|
||||
{* Сортировка *}
|
||||
{include 'sort.tpl'
|
||||
sSortName = 'sort-blog-list'
|
||||
aSortList = [ [ name => 'blog_title', text => $aLang.sort.by_name ],
|
||||
[ name => 'blog_count_user', text => $aLang.blog.sort.by_users ],
|
||||
[ name => 'blog_rating', text => $aLang.sort.by_rating ] ]
|
||||
sSortUrl = $sBlogsRootPage
|
||||
sSortOrder = $sBlogOrder
|
||||
sSortOrderWay = $sBlogOrderWay}
|
||||
{if $bIsSearch}
|
||||
<h3 class="h3">Найдено {$iSearchCount} блогов</h3>
|
||||
{/if}
|
||||
|
||||
{* Список блогов *}
|
||||
<ul class="object-list object-list-actions blog-list">
|
||||
|
@ -26,7 +20,7 @@
|
|||
<a href="{$oBlog->getUrlFull()}">
|
||||
<img src="{$oBlog->getAvatarPath(100)}" width="100" height="100" alt="{$oBlog->getTitle()|escape}" class="object-list-item-image" />
|
||||
</a>
|
||||
|
||||
|
||||
{* Заголовок *}
|
||||
<h2 class="object-list-item-title">
|
||||
{if $oBlog->getType() == 'close'}
|
||||
|
@ -57,10 +51,5 @@
|
|||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
{* TODO: Fix error message *}
|
||||
{if $sBlogsEmptyList}
|
||||
{$sBlogsEmptyList}
|
||||
{else}
|
||||
{include 'alert.tpl' mAlerts=$aLang.blog.alerts.empty sAlertStyle='empty'}
|
||||
{/if}
|
||||
{include 'alert.tpl' mAlerts=(($sBlogsEmptyList) ? $sBlogsEmptyList : $aLang.blog.alerts.empty) sAlertStyle='empty'}
|
||||
{/if}
|
|
@ -13,14 +13,14 @@
|
|||
{block 'layout_content'}
|
||||
{include 'forms/form.search.blogs.tpl'}
|
||||
|
||||
<div id="blogs-list-search" style="display:none;"></div>
|
||||
{* Сортировка *}
|
||||
{include 'sort.ajax.tpl'
|
||||
sSortName = 'sort-blog-list'
|
||||
aSortList = [ [ name => 'blog_title', text => $aLang.sort.by_name ],
|
||||
[ name => 'blog_count_user', text => $aLang.blog.sort.by_users ],
|
||||
[ name => 'blog_rating', text => $aLang.sort.by_rating ] ]}
|
||||
|
||||
<div id="blogs-list-original">
|
||||
{if ! $sBlogsRootPage}
|
||||
{router page='blogs' assign=sBlogsRootPage}
|
||||
{/if}
|
||||
|
||||
{include 'actions/ActionBlogs/blog_list.tpl' bBlogsUseOrder=true sBlogsRootPage=$sBlogsRootPage}
|
||||
{include 'pagination.tpl' aPaging=$aPaging}
|
||||
<div class="js-search-ajax-container" data-type="blogs">
|
||||
{include 'actions/ActionBlogs/blog_list.tpl'}
|
||||
</div>
|
||||
{/block}
|
|
@ -2,21 +2,22 @@
|
|||
* Список всех пользователей
|
||||
*}
|
||||
|
||||
{extends file='layouts/layout.base.tpl'}
|
||||
|
||||
{block name='layout_options'}
|
||||
{$sNav = 'users'}
|
||||
{/block}
|
||||
{extends 'layouts/layout.base.tpl'}
|
||||
|
||||
{block name='layout_page_title'}{$aLang.user_list}{/block}
|
||||
|
||||
{block name='layout_content'}
|
||||
{include file='forms/form.search.users.tpl'}
|
||||
{include 'forms/form.search.users.tpl'}
|
||||
{include 'alphanumeric.tpl' aAlphaLetters=$aPrefixUser}
|
||||
|
||||
<div id="users-list-search" style="display:none;"></div>
|
||||
{* Сортировка *}
|
||||
{include 'sort.ajax.tpl'
|
||||
sSortName = 'sort-user-list'
|
||||
aSortList = [ [ name => 'user_login', text => $aLang.sort.by_name ],
|
||||
[ name => 'user_date_register', text => $aLang.user_date_registration ],
|
||||
[ name => 'user_rating', text => $aLang.user_rating ] ]}
|
||||
|
||||
<div id="users-list-original">
|
||||
{router page='people' assign=sUsersRootPage}
|
||||
{include file='user_list.tpl' aUsersList=$aUsersRating bUsersUseOrder=true sUsersRootPage=$sUsersRootPage}
|
||||
<div class="js-search-ajax-container" data-type="users">
|
||||
{include file='user_list.tpl' aUsersList=$aUsers}
|
||||
</div>
|
||||
{/block}
|
|
@ -1,15 +0,0 @@
|
|||
{**
|
||||
* Список новых пользователей
|
||||
*}
|
||||
|
||||
{extends file='layouts/layout.base.tpl'}
|
||||
|
||||
{block name='layout_options'}
|
||||
{$sNav = 'users'}
|
||||
{/block}
|
||||
|
||||
{block name='layout_page_title'}{$aLang.user_list}{/block}
|
||||
|
||||
{block name='layout_content'}
|
||||
{include file='user_list.tpl' aUsersList=$aUsersRegister}
|
||||
{/block}
|
|
@ -1,15 +0,0 @@
|
|||
{**
|
||||
* Список пользователей которые недавно были на сайте
|
||||
*}
|
||||
|
||||
{extends file='layouts/layout.base.tpl'}
|
||||
|
||||
{block name='layout_options'}
|
||||
{$sNav = 'users'}
|
||||
{/block}
|
||||
|
||||
{block name='layout_page_title'}{$aLang.user_list}{/block}
|
||||
|
||||
{block name='layout_content'}
|
||||
{include file='user_list.tpl' aUsersList=$aUsersLast}
|
||||
{/block}
|
7
application/frontend/skin/developer/alphanumeric.tpl
Normal file
7
application/frontend/skin/developer/alphanumeric.tpl
Normal file
|
@ -0,0 +1,7 @@
|
|||
<ul class="alphanumeric js-search-alphabet" data-type="users">
|
||||
<li class="alphanumeric-item active js-search-alphabet-item" data-letter=""><a href="#">{$aLang.user_search_filter_all}</a></li>
|
||||
|
||||
{foreach $aAlphaLetters as $sLetter}
|
||||
<li class="alphanumeric-item js-search-alphabet-item" data-letter="{$sLetter}"><a href="#">{$sLetter}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
|
@ -2,22 +2,25 @@
|
|||
* Блок сортировки
|
||||
*
|
||||
* @template sort.tpl
|
||||
*
|
||||
*
|
||||
* @license GNU General Public License, version 2
|
||||
* @copyright 2013 OOO "ЛС-СОФТ" {@link http://livestreetcms.com}
|
||||
* @author Denis Shakhov <denis.shakhov@gmail.com>
|
||||
*/
|
||||
|
||||
.sort { padding: 15px 0; margin-bottom: 20px; overflow: hidden; border-radius: 3px; }
|
||||
.sort .dropdown { float: left; margin: 0; }
|
||||
.sort { margin-bottom: 20px; overflow: hidden; }
|
||||
.sort .dropdown { float: left; margin: 0; background: #333; }
|
||||
|
||||
.sort-label {
|
||||
float: left;
|
||||
background: rgba(40, 145, 211, 0.78);
|
||||
background: #555;
|
||||
color: #FFF;
|
||||
padding: 7px 13px 7px 13px;
|
||||
}
|
||||
|
||||
.sort-item.active[data-order=asc] a:after { content: "↑"; }
|
||||
.sort-item.active[data-order=desc] a:after { content: "↓"; }
|
||||
|
||||
|
||||
/**
|
||||
* Inline
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
{**
|
||||
* Категории блогов
|
||||
*
|
||||
* @styles css/blocks.css
|
||||
*}
|
||||
|
||||
{extends 'blocks/block.aside.base.tpl'}
|
||||
|
||||
{block 'block_title'}{$aLang.block_category_blog}{/block}
|
||||
{block 'block_type'}blog-categories{/block}
|
||||
|
||||
{block 'block_header_end'}
|
||||
{if $oUserCurrent and $oUserCurrent->isAdministrator()}
|
||||
<a href="{router page="admin"}blogcategory/" title="{$aLang.admin_list_blogcategory}" class="icon-cog blog-categories-admin"></a>
|
||||
{/if}
|
||||
{/block}
|
||||
|
||||
{block 'block_content'}
|
||||
{if $aBlogCategories}
|
||||
<ul class="nested-list">
|
||||
<li class="nested-list-item {if ! $oBlogCategoryCurrent}active{/if}">
|
||||
<a href="{router page='blogs'}">{$aLang.block_category_blog_all} ({$iCountBlogsAll})</a>
|
||||
</li>
|
||||
|
||||
{foreach $aBlogCategories as $oCategory}
|
||||
<li class="nested-list-item {if $oBlogCategoryCurrent && $oBlogCategoryCurrent->getId() == $oCategory->getId()}active{/if}">
|
||||
<a style="margin-left: {$oCategory->getLevel() * 20}px;" href="{$oCategory->getUrlWeb()}">{$oCategory->getTitle()|escape} ({$oCategory->getCountBlogs()})</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
{include 'alert.tpl' mAlerts=$aLang.blog.categories.empty sAlertStyle='empty'}
|
||||
{/if}
|
||||
{/block}
|
|
@ -0,0 +1,37 @@
|
|||
{**
|
||||
* Статистика по пользователям
|
||||
*
|
||||
* @styles css/blocks.css
|
||||
*}
|
||||
|
||||
{extends file='blocks/block.aside.base.tpl'}
|
||||
|
||||
{block name='block_title'}Поиск по блогам{/block}
|
||||
|
||||
{block name='block_content'}
|
||||
<h3>{$aLang.block_category_blog}</h3>
|
||||
|
||||
{if $aBlogCategories}
|
||||
<ul class="nested-list">
|
||||
<li class="nested-list-item active js-search-ajax-option" data-search-type="blogs" data-name="category" data-value="0">
|
||||
<a href="{router page='blogs'}">{$aLang.block_category_blog_all} ({$iCountBlogsAll})</a>
|
||||
</li>
|
||||
|
||||
{foreach $aBlogCategories as $oCategory}
|
||||
<li class="nested-list-item js-search-ajax-option" data-search-type="blogs" data-name="category" data-value="{$oCategory->getId()}">
|
||||
<a style="margin-left: {$oCategory->getLevel() * 20}px;" href="{$oCategory->getUrlWeb()}">{$oCategory->getTitle()|escape} ({$oCategory->getCountBlogs()})</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
{include 'alert.tpl' mAlerts=$aLang.blog.categories.empty sAlertStyle='empty'}
|
||||
{/if}
|
||||
|
||||
<br>
|
||||
|
||||
{* Тип блога *}
|
||||
<p class="mb-10">Тип блога</p>
|
||||
{include file='forms/fields/form.field.radio.tpl' sFieldInputClasses='js-search-ajax-option' sFieldInputAttributes='data-search-type="blogs"' sFieldName='type' sFieldValue='null' bFieldChecked=true sFieldLabel='Любой'}
|
||||
{include file='forms/fields/form.field.radio.tpl' sFieldInputClasses='js-search-ajax-option' sFieldInputAttributes='data-search-type="blogs"' sFieldName='type' sFieldValue='public' sFieldLabel='Открытый'}
|
||||
{include file='forms/fields/form.field.radio.tpl' sFieldInputClasses='js-search-ajax-option' sFieldInputAttributes='data-search-type="blogs"' sFieldName='type' sFieldValue='private' sFieldLabel='Закрытый'}
|
||||
{/block}
|
|
@ -0,0 +1,38 @@
|
|||
{**
|
||||
* Статистика по пользователям
|
||||
*
|
||||
* @styles css/blocks.css
|
||||
*}
|
||||
|
||||
{extends file='blocks/block.aside.base.tpl'}
|
||||
|
||||
{block name='block_title'}Поиск по пользователям{/block}
|
||||
|
||||
{block name='block_content'}
|
||||
{$aSex = [
|
||||
[ 'value' => 'man', 'text' => $aLang.settings_profile_sex_man ],
|
||||
[ 'value' => 'woman', 'text' => $aLang.settings_profile_sex_woman ],
|
||||
[ 'value' => 'other', 'text' => $aLang.settings_profile_sex_other ]
|
||||
]}
|
||||
|
||||
{include file='forms/fields/form.field.select.tpl'
|
||||
sFieldName = 'profile_sex'
|
||||
sFieldLabel = $aLang.settings_profile_sex
|
||||
aFieldItems = $aSex
|
||||
sFieldClasses = 'width-full js-search-ajax-option'
|
||||
sFieldInputAttributes = 'data-search-type="users"'}
|
||||
|
||||
{* Сейчас на сайте *}
|
||||
{include file='forms/fields/form.field.checkbox.tpl'
|
||||
sFieldName = 'is_online'
|
||||
sFieldInputClasses = 'js-search-ajax-option'
|
||||
sFieldInputAttributes = 'data-search-type="users"'
|
||||
bFieldChecked = false
|
||||
sFieldLabel = 'Сейчас на сайте'}
|
||||
|
||||
{* Пол *}
|
||||
<p class="mb-10">Пол</p>
|
||||
{include 'forms/fields/form.field.radio.tpl' sFieldInputClasses='js-search-ajax-option' sFieldInputAttributes='data-search-type="users"' sFieldName='sex' sFieldValue='null' bFieldChecked=true sFieldLabel='Любой'}
|
||||
{include 'forms/fields/form.field.radio.tpl' sFieldInputClasses='js-search-ajax-option' sFieldInputAttributes='data-search-type="users"' sFieldName='sex' sFieldValue='male' sFieldLabel='Мужской'}
|
||||
{include 'forms/fields/form.field.radio.tpl' sFieldInputClasses='js-search-ajax-option' sFieldInputAttributes='data-search-type="users"' sFieldName='sex' sFieldValue='female' sFieldLabel='Женский'}
|
||||
{/block}
|
|
@ -15,6 +15,8 @@
|
|||
name="{$sFieldName}"
|
||||
value="{if $sFieldValue}{$sFieldValue}{else}1{/if}"
|
||||
{if $bFieldIsDisabled}disabled{/if}
|
||||
{$sFieldInputAttributes}
|
||||
{if $sFieldInputClasses}class="{$sFieldInputClasses}"{/if}
|
||||
{if $bFieldChecked}checked{else}{if $_aRequest[$sFieldName] == 1}checked{/if}{/if} />
|
||||
{if $sFieldLabel}{$sFieldLabel}</label>{/if}
|
||||
{/block}
|
|
@ -15,6 +15,8 @@
|
|||
name="{$sFieldName}"
|
||||
value="{if $sFieldValue}{$sFieldValue}{else}1{/if}"
|
||||
{if $bFieldIsDisabled}disabled{/if}
|
||||
{$sFieldInputAttributes}
|
||||
{if $sFieldInputClasses}class="{$sFieldInputClasses}"{/if}
|
||||
{if $bFieldChecked}checked{else}{if $_aRequest[$sFieldName] == 1}checked{/if}{/if} />
|
||||
{if $sFieldLabel}{$sFieldLabel}</label>{/if}
|
||||
{/block}
|
|
@ -5,7 +5,7 @@
|
|||
{extends file='forms/fields/form.field.base.tpl'}
|
||||
|
||||
{block name='field_holder' prepend}
|
||||
<select id="{if $sFieldId}{$sFieldId}{else}{$sFieldName}{/if}" name="{$sFieldName}" class="{if $sFieldClasses}{$sFieldClasses}{else}width-full{/if}" {if $bFieldIsDisabled}disabled{/if}>
|
||||
<select id="{if $sFieldId}{$sFieldId}{else}{$sFieldName}{/if}" name="{$sFieldName}" class="{if $sFieldClasses}{$sFieldClasses}{else}width-full{/if}" {$sFieldInputAttributes} {if $bFieldIsDisabled}disabled{/if}>
|
||||
{foreach $aFieldItems as $aItem}
|
||||
<option value="{$aItem.value}" {if $aItem.value == $sFieldSelectedValue}selected{/if}>{$aItem.text}</option>
|
||||
{/foreach}
|
||||
|
|
|
@ -18,6 +18,5 @@
|
|||
{* Поле ввода *}
|
||||
{block name='search_input_placeholder'}{$aLang.blog.search.placeholder}{/block}
|
||||
{block name='search_input_name'}blog_title{/block}
|
||||
{block name='search_input_attributes'}
|
||||
onkeyup="ls.timer.run(ls.blog.searchBlogs,'blogs_search',['#form-blogs-search'],500);"
|
||||
{/block}
|
||||
{block name='search_input_classes'}js-search-ajax-option js-search-text-main{/block}
|
||||
{block name='search_input_attributes'}data-type="blogs"{/block}
|
|
@ -18,18 +18,5 @@
|
|||
{* Поле ввода *}
|
||||
{block name='search_input_placeholder'}{$aLang.user_search_title_hint}{/block}
|
||||
{block name='search_input_name'}user_login{/block}
|
||||
{block name='search_input_attributes'}
|
||||
id="search-user-login"
|
||||
onkeyup="ls.timer.run(ls.user.searchUsers,'users_search',['#form-users-search'],500);"
|
||||
{/block}
|
||||
|
||||
{* Алфавитный указатель *}
|
||||
{block name='search_input_after'}
|
||||
<ul id="user-prefix-filter" class="search-form-alphabet">
|
||||
<li class="active"><a href="#" class="link-dotted" onclick="return ls.user.searchUsersByPrefix('',this);">{$aLang.user_search_filter_all}</a></li>
|
||||
|
||||
{foreach $aPrefixUser as $sPrefixUser}
|
||||
<li><a href="#" class="link-dotted" onclick="return ls.user.searchUsersByPrefix('{$sPrefixUser}',this);">{$sPrefixUser}</a></li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
{/block}
|
||||
{block name='search_input_classes'}js-search-ajax-option js-search-text-main{/block}
|
||||
{block name='search_input_attributes'}data-type="users"{/block}
|
|
@ -1,13 +0,0 @@
|
|||
{**
|
||||
* Навигация по пользователям
|
||||
*}
|
||||
|
||||
<ul class="nav nav-pills">
|
||||
<li {if $sMenuItemSelect=='all'}class="active"{/if}><a href="{router page='people'}">{$aLang.people_menu_users_all}</a></li>
|
||||
<li {if $sMenuItemSelect=='online'}class="active"{/if}><a href="{router page='people'}online/">{$aLang.people_menu_users_online}</a></li>
|
||||
<li {if $sMenuItemSelect=='new'}class="active"{/if}><a href="{router page='people'}new/">{$aLang.people_menu_users_new}</a></li>
|
||||
|
||||
{hook run='menu_people_people_item'}
|
||||
</ul>
|
||||
|
||||
{hook run='menu_people'}
|
30
application/frontend/skin/developer/sort.ajax.tpl
Normal file
30
application/frontend/skin/developer/sort.ajax.tpl
Normal file
|
@ -0,0 +1,30 @@
|
|||
{**
|
||||
* Блок сортировки
|
||||
*
|
||||
* @param string $sSortName
|
||||
* @param array $aSortList
|
||||
* @param string $sSortOrder
|
||||
* @param string $sSortOrderWay
|
||||
* @param string $sSortLabel
|
||||
* @param boolean $bSortShowLabel
|
||||
*
|
||||
* @styles assets/css/sort.css
|
||||
*}
|
||||
|
||||
<div class="sort js-search-sort {$sSortClasses}">
|
||||
{if $bSortShowLabel|default:true}
|
||||
<div class="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 js-search-sort-menu" id="js-dropdown-sort-{$sSortName}">
|
||||
{foreach $aSortList as $aSortItem}
|
||||
<li class="sort-item {if $aSortItem@index == 0}active{/if}" data-search-type="users" data-name="sort_by" data-value="{$aSortItem['name']}" data-order="asc">
|
||||
<a href="#">
|
||||
{$aSortItem['text']}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
|
@ -11,26 +11,23 @@
|
|||
* @styles assets/css/sort.css
|
||||
*}
|
||||
|
||||
{if $sSortUrl}
|
||||
<div class="sort {$sSortClasses}">
|
||||
{if $bSortShowLabel|default:true}
|
||||
<div class="sort-label">{if $sSortLabel}{$sSortLabel}{else}{$aLang.sort.label}{/if}</div>
|
||||
{/if}
|
||||
<div class="sort {$sSortClasses}">
|
||||
{if $bSortShowLabel|default:true}
|
||||
<div class="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>
|
||||
<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']}
|
||||
<ul class="dropdown-menu" id="js-dropdown-sort-{$sSortName}">
|
||||
{foreach $aSortList as $aSortItem}
|
||||
{$bIsActive = $sSortOrder == $aSortItem['name']}
|
||||
|
||||
{* TODO: i18n *}
|
||||
<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'}↓{else}↑{/if}{/if}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
||||
{/if}
|
||||
<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'}↓{else}↑{/if}{/if}
|
||||
</a>
|
||||
</li>
|
||||
{/foreach}
|
||||
</ul>
|
||||
</div>
|
|
@ -3,15 +3,9 @@
|
|||
*}
|
||||
|
||||
{if $aUsersList}
|
||||
{* Сортировка *}
|
||||
{include 'sort.tpl'
|
||||
sSortName = 'sort-user-list'
|
||||
aSortList = [ [ name => 'user_login', text => $aLang.sort.by_name ],
|
||||
[ name => 'user_date_register', text => $aLang.user_date_registration ],
|
||||
[ name => 'user_rating', text => $aLang.user_rating ] ]
|
||||
sSortUrl = $sUsersRootPage
|
||||
sSortOrder = $sUsersOrder
|
||||
sSortOrderWay = $sUsersOrderWay}
|
||||
{if $bIsSearch}
|
||||
<h3 class="h3">Найдено {$iSearchCount} человек</h3>
|
||||
{/if}
|
||||
|
||||
{* Список пользователей *}
|
||||
<ul class="object-list user-list">
|
||||
|
@ -40,7 +34,7 @@
|
|||
|
||||
{* Информация *}
|
||||
{$aUserInfo = [
|
||||
[ 'label' => "{$aLang.user_date_last}:",
|
||||
[ 'label' => "{$aLang.user_date_last}:",
|
||||
'content' => ($oSession) ? {date_format date=$oSession->getDateLast() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"} : '—' ],
|
||||
[ 'label' => "{$aLang.user_date_registration}:", 'content' => {date_format date=$oUser->getDateRegister() hours_back="12" minutes_back="60" now="60" day="day H:i" format="j F Y, H:i"} ],
|
||||
[ 'label' => "{$aLang.vote.rating}:", 'content' => $oUser->getRating() ]
|
||||
|
@ -51,7 +45,7 @@
|
|||
{/foreach}
|
||||
</ul>
|
||||
{else}
|
||||
{include 'alert.tpl' mAlerts=$aLang.user_empty sAlertStyle='empty'}
|
||||
{include 'alert.tpl' mAlerts=(($sUserListEmpty) ? $sUserListEmpty : $aLang.blog.alerts.empty) sAlertStyle='empty'}
|
||||
{/if}
|
||||
|
||||
{include 'pagination.tpl' aPaging=$aPaging}
|
Loading…
Reference in a new issue