1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-21 18:28:17 +03:00

Merge pull request #627 from Chiliec/comments

Настройка отображения формы комментариев fix #444
This commit is contained in:
Maxim Mzhelskiy 2015-02-23 18:25:53 +06:00
commit 29474ac12f
5 changed files with 14 additions and 8 deletions

View file

@ -185,6 +185,7 @@ $config['module']['user']['count_auth_session_history'] = 10; // Общее ко
$config['module']['comment']['per_page'] = 20; // Число комментариев на одну страницу(это касается только полного списка комментариев прямого эфира)
$config['module']['comment']['bad'] = -5; // Рейтинг комментария, начиная с которого он будет скрыт
$config['module']['comment']['max_tree'] = 7; // Максимальная вложенность комментов при отображении
$config['module']['comment']['show_form'] = false; // Показать или скрыть форму комментов по умолчанию
$config['module']['comment']['use_nested'] = false; // Использовать или нет nested set при выборке комментов, увеличивает производительность при большом числе комментариев + позволяет делать постраничное разбиение комментов
$config['module']['comment']['nested_per_page'] = 0; // Число комментов на одну страницу в топике, актуально только при use_nested = true
$config['module']['comment']['nested_page_reverse'] = true; // Определяет порядок вывода страниц. true - последние комментарии на первой странице, false - последние комментарии на последней странице
@ -226,6 +227,7 @@ $config['module']['wall']['text_min'] = 1; // Ограничени
/**
* Модуль опросов (Poll)
*/
$config['module']['poll']['max_answers'] = 20; // Максимальное количество вариантов которое можно добавить в опрос
$config['module']['poll']['time_limit_update'] = 60 * 60 * 30; // Время в секундах, в течении которого можно изменять опрос
/**
* Модуль Image

View file

@ -163,7 +163,7 @@
// Ограничиваем кол-во добавляемых ответов
if ( answers.length == this.option( 'max' ) ) {
ls.msg.error( null, ls.lang.get( 'poll.notices.error_answers_max' ) );
ls.msg.error( null, ls.lang.get( 'poll.notices.error_answers_max', { count: this.option( 'max' ) } ) );
return;
} else if ( answers.length == 2 ) {
answers.find( this.option( 'selectors.form.item_remove' ) ).show();

View file

@ -549,8 +549,7 @@ return array(
),
// Всплывающие сообщения
'notices' => array(
// TODO: Fix max number
'error_answers_max' => 'Максимально возможное число вариантов ответа 20',
'error_answers_max' => 'Максимально возможное число вариантов ответа %%count%%',
),
),
/**
@ -2131,6 +2130,7 @@ return array(
'tags' => array(
'tags' => 'Теги',
'tag' => 'Тег',
'count' => 'Кол-во тегов должно быть от %s до %s',
'search' => array(
'title' => 'Поиск по тегам',
'label' => '___tags.search.title___',

View file

@ -356,7 +356,9 @@ jQuery(document).ready(function($){
* Poll
*/
$('.js-poll').lsPoll();
$('.js-poll-manage').lsPollManage();
$('.js-poll-manage').lsPollManage({
max: ls.registry.get('poll_max_answers')
});
/**
@ -472,7 +474,8 @@ jQuery(document).ready(function($){
urls: {
add: aRouter['blog'] + 'ajaxaddcomment/',
load: aRouter['blog'] + 'ajaxresponsecomment/'
}
},
show_form: ls.registry.get('comment_show_form')
});
// Кнопка обновления комментариев
@ -514,9 +517,8 @@ jQuery(document).ready(function($){
return tag_count && tag_count.length >= arrayRange[0] && tag_count.length <= arrayRange[1];
}
},
// TODO: Вынести в лок-ию
messages: {
rangetags: "Кол-во тегов должно быть от %s до %s"
rangetags: ls.lang.get('tags.count')
}
});

View file

@ -23,12 +23,14 @@
{block 'layout_head' append}
<script>
ls.lang.load({json var = $aLangJs});
ls.lang.load({lang_load name="comments.comments_declension, comments.unsubscribe, comments.subscribe, comments.folding.unfold, comments.folding.fold, comments.folding.unfold_all, comments.folding.fold_all, poll.notices.error_answers_max, blog.blog, favourite.add, favourite.remove, field.geo.select_city, field.geo.select_region, blog.add.fields.type.note_open, blog.add.fields.type.note_close, common.success.add, common.success.remove, pagination.notices.first, pagination.notices.last, user.actions.unfollow, user.actions.follow, user.friends.status.added, user.friends.status.notfriends, user.friends.status.pending, user.friends.status.rejected, user.friends.status.sent, user.friends.status.linked, blog.blocks.navigator.blog, user.settings.profile.notices.error_max_userfields, common.remove_confirm, more.empty"});
ls.lang.load({lang_load name="comments.comments_declension, comments.unsubscribe, comments.subscribe, comments.folding.unfold, comments.folding.fold, comments.folding.unfold_all, comments.folding.fold_all, poll.notices.error_answers_max, blog.blog, favourite.add, favourite.remove, field.geo.select_city, field.geo.select_region, blog.add.fields.type.note_open, blog.add.fields.type.note_close, common.success.add, common.success.remove, pagination.notices.first, pagination.notices.last, user.actions.unfollow, user.actions.follow, user.friends.status.added, user.friends.status.notfriends, user.friends.status.pending, user.friends.status.rejected, user.friends.status.sent, user.friends.status.linked, blog.blocks.navigator.blog, user.settings.profile.notices.error_max_userfields, common.remove_confirm, more.empty, tags.count"});
ls.registry.set({json var = $aVarsJs});
ls.registry.set('comment_max_tree', {json var=Config::Get('module.comment.max_tree')});
ls.registry.set('comment_show_form', {json var=Config::Get('module.comment.show_form')});
ls.registry.set('topic_max_blog_count', {json var=Config::Get('module.topic.max_blog_count')});
ls.registry.set('block_stream_show_tip', {json var=Config::Get('block.stream.show_tip')});
ls.registry.set('poll_max_answers', {json var=Config::Get('module.poll.max_answers')});
</script>
{**