mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-06-02 04:15:05 +02:00
fixed #1832 Number of displayed users in user manager is now saved in user_prefs
This commit is contained in:
@@ -252,24 +252,45 @@ $( document ).ready(function() {
|
|||||||
|
|
||||||
/* Pagination */
|
/* Pagination */
|
||||||
|
|
||||||
if (view_selector === "compact") {
|
console.log(pagination);
|
||||||
if (per_page < 10) {
|
switch (pagination) {
|
||||||
per_page = 10
|
case '5':
|
||||||
update_pagination_menu();
|
console.log(pagination);
|
||||||
update_user_list();
|
|
||||||
|
|
||||||
$("#pagination-per-page-5").removeClass("selected-pagination");
|
|
||||||
$("#pagination-per-page-10").addClass("selected-pagination");
|
|
||||||
$("#pagination-per-page-25").removeClass("selected-pagination");
|
|
||||||
$("#pagination-per-page-50").removeClass("selected-pagination");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$("#pagination-per-page-5").addClass("selected-pagination");
|
$("#pagination-per-page-5").addClass("selected-pagination");
|
||||||
$("#pagination-per-page-10").removeClass("selected-pagination");
|
$("#pagination-per-page-10").removeClass("selected-pagination");
|
||||||
$("#pagination-per-page-25").removeClass("selected-pagination");
|
$("#pagination-per-page-25").removeClass("selected-pagination");
|
||||||
$("#pagination-per-page-50").removeClass("selected-pagination");
|
$("#pagination-per-page-50").removeClass("selected-pagination");
|
||||||
|
break;
|
||||||
|
case '10':
|
||||||
|
console.log(pagination);
|
||||||
|
$("#pagination-per-page-5").removeClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-10").addClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-25").removeClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-50").removeClass("selected-pagination");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case '25':
|
||||||
|
console.log(pagination);
|
||||||
|
$("#pagination-per-page-5").removeClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-10").removeClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-25").addClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-50").removeClass("selected-pagination");
|
||||||
|
|
||||||
|
break;
|
||||||
|
case '50':
|
||||||
|
console.log(pagination);
|
||||||
|
$("#pagination-per-page-5").removeClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-10").removeClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-25").removeClass("selected-pagination");
|
||||||
|
$("#pagination-per-page-50").addClass("selected-pagination");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$("#pagination-per-page-"+pagination).trigger('click');
|
||||||
|
|
||||||
if (has_group) {
|
if (has_group) {
|
||||||
advanced_filter_button_click();
|
advanced_filter_button_click();
|
||||||
$("select[name='filter_group']").val(has_group);
|
$("select[name='filter_group']").val(has_group);
|
||||||
@@ -514,6 +535,17 @@ $('.pagination-arrow.left').on('click', () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
$('.pagination-per-page a').on('click',function () {
|
$('.pagination-per-page a').on('click',function () {
|
||||||
|
|
||||||
|
jQuery.ajax({
|
||||||
|
url: "ws.php?format=json&method=pwg.users.preferences.set",
|
||||||
|
type: "POST",
|
||||||
|
data: {
|
||||||
|
param: "user-manager-pagination",
|
||||||
|
value: parseInt($(this).html()),
|
||||||
|
is_json: false,
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
per_page = parseInt($(this).html());
|
per_page = parseInt($(this).html());
|
||||||
actual_page = 1;
|
actual_page = 1;
|
||||||
update_pagination_menu();
|
update_pagination_menu();
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ const str_popin_update_btn = '{'Update'|@translate|escape:javascript}';
|
|||||||
const history_base_url = "{$U_HISTORY}";
|
const history_base_url = "{$U_HISTORY}";
|
||||||
|
|
||||||
const view_selector = '{$view_selector}';
|
const view_selector = '{$view_selector}';
|
||||||
|
const pagination = '{$pagination}';
|
||||||
|
|
||||||
months = [
|
months = [
|
||||||
"{'Jan'|@translate}",
|
"{'Jan'|@translate}",
|
||||||
|
|||||||
@@ -173,6 +173,17 @@ $template->assign('groups_arr_name', implode(',', $groups_arr_name));
|
|||||||
$template->assign('guest_id', $conf["guest_id"]);
|
$template->assign('guest_id', $conf["guest_id"]);
|
||||||
|
|
||||||
$template->assign('view_selector', userprefs_get_param('user-manager-view', 'line'));
|
$template->assign('view_selector', userprefs_get_param('user-manager-view', 'line'));
|
||||||
|
|
||||||
|
if (userprefs_get_param('user-manager-view', 'line') == 'line')
|
||||||
|
{
|
||||||
|
//Show 5 users by default
|
||||||
|
$template->assign('pagination', userprefs_get_param('user-manager-pagination', 5));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//Show 10 users by default
|
||||||
|
$template->assign('pagination', userprefs_get_param('user-manager-pagination', 10));
|
||||||
|
}
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | html code display |
|
// | html code display |
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
|
|||||||
Reference in New Issue
Block a user