mirror of
https://github.com/Piwigo/Piwigo.git
synced 2025-04-28 12:19:57 +03:00
Fixes #1399 Added mesage at the end of result list if result limit reached
Related to #1387 changed variables names for more clarity
This commit is contained in:
parent
1ce38771f5
commit
e5ed68e6a8
4 changed files with 24 additions and 8 deletions
|
@ -121,7 +121,7 @@ $template->assign(
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
$template->assign('delay_before_autoOpen', $conf['delay_before_auto_openning']);
|
$template->assign('delay_before_autoOpen', $conf['album_move_delay_before_auto_opening']);
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | Album display |
|
// | Album display |
|
||||||
|
|
|
@ -14,8 +14,6 @@ var str_root = "{'Root'|@translate}"
|
||||||
var openCat = {$open_cat};
|
var openCat = {$open_cat};
|
||||||
|
|
||||||
var delay_autoOpen = {$delay_before_autoOpen}
|
var delay_autoOpen = {$delay_before_autoOpen}
|
||||||
|
|
||||||
console.log(delay_autoOpen)
|
|
||||||
{/footer_script}
|
{/footer_script}
|
||||||
|
|
||||||
{combine_script id='jquery.confirm' load='footer' require='jquery' path='themes/default/js/plugins/jquery-confirm.min.js'}
|
{combine_script id='jquery.confirm' load='footer' require='jquery' path='themes/default/js/plugins/jquery-confirm.min.js'}
|
||||||
|
|
|
@ -16,12 +16,14 @@ const RESULT_LIMIT = 100;
|
||||||
|
|
||||||
var str_albums_found = '{"<b>%d</b> albums found"|translate}';
|
var str_albums_found = '{"<b>%d</b> albums found"|translate}';
|
||||||
var str_album_found = '{"<b>1</b> album found"|translate}';
|
var str_album_found = '{"<b>1</b> album found"|translate}';
|
||||||
var str_result_limit = '{"<b>%d+</b> albums found, try to refine the search"|translate}';
|
var str_result_limit = '{"<b>%d+</b> albums found, try to refine the search"|translate|escape:javascript}';
|
||||||
|
|
||||||
{literal}
|
{literal}
|
||||||
var editLink = "admin.php?page=album-";
|
var editLink = "admin.php?page=album-";
|
||||||
var colors = ["icon-red", "icon-blue", "icon-yellow", "icon-purple", "icon-green"];
|
var colors = ["icon-red", "icon-blue", "icon-yellow", "icon-purple", "icon-green"];
|
||||||
|
|
||||||
|
$(".limit-album-reached").hide();
|
||||||
|
|
||||||
$('.search-input').on('input', () => {
|
$('.search-input').on('input', () => {
|
||||||
updateSearch();
|
updateSearch();
|
||||||
})
|
})
|
||||||
|
@ -31,6 +33,7 @@ function updateSearch () {
|
||||||
string = $('.search-input').val();
|
string = $('.search-input').val();
|
||||||
$('.search-album-result').html("");
|
$('.search-album-result').html("");
|
||||||
$('.search-album-noresult').hide();
|
$('.search-album-noresult').hide();
|
||||||
|
$(".limit-album-reached").hide();
|
||||||
if (string == '') {
|
if (string == '') {
|
||||||
// help button unnecessary so do not show
|
// help button unnecessary so do not show
|
||||||
// $('.search-album-help').show();
|
// $('.search-album-help').show();
|
||||||
|
@ -44,8 +47,8 @@ function updateSearch () {
|
||||||
nbResult = 0;
|
nbResult = 0;
|
||||||
categories.forEach((c) => {
|
categories.forEach((c) => {
|
||||||
if (c[0].toString().toLowerCase().search(string.toLowerCase()) != -1 && nbResult < RESULT_LIMIT) {
|
if (c[0].toString().toLowerCase().search(string.toLowerCase()) != -1 && nbResult < RESULT_LIMIT) {
|
||||||
addAlbumResult(c);
|
|
||||||
nbResult++;
|
nbResult++;
|
||||||
|
addAlbumResult(c, nbResult);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -68,7 +71,7 @@ function updateSearch () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add an album as a result in the page
|
// Add an album as a result in the page
|
||||||
function addAlbumResult (cat) {
|
function addAlbumResult (cat, nbResult) {
|
||||||
id = cat[1][cat[1].length - 1];
|
id = cat[1][cat[1].length - 1];
|
||||||
template = $('.search-album-elem-template').html();
|
template = $('.search-album-elem-template').html();
|
||||||
newCatNode = $(template);
|
newCatNode = $(template);
|
||||||
|
@ -97,6 +100,11 @@ function addAlbumResult (cat) {
|
||||||
newCatNode.find('.search-album-edit').attr('href', href);
|
newCatNode.find('.search-album-edit').attr('href', href);
|
||||||
|
|
||||||
$('.search-album-result').append(newCatNode);
|
$('.search-album-result').append(newCatNode);
|
||||||
|
|
||||||
|
if(nbResult >= RESULT_LIMIT) {
|
||||||
|
$(".limit-album-reached").show(1000);
|
||||||
|
$('.limit-album-reached').html(str_result_limit.replace('%d', nbResult));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the path "PARENT / parent / album" with link to the edition of all albums
|
// Get the path "PARENT / parent / album" with link to the edition of all albums
|
||||||
|
@ -168,8 +176,17 @@ $('.search-input').focus();
|
||||||
<div class="search-album-result">
|
<div class="search-album-result">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="search-album-elem limit-album-reached"></div>
|
||||||
|
|
||||||
<div class="search-album-noresult">
|
<div class="search-album-noresult">
|
||||||
{'No albums found'|translate}
|
{'No albums found'|translate}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.limit-album-reached {
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
|
|
|
@ -716,8 +716,9 @@ $conf['dashboard_check_for_updates'] = true;
|
||||||
// Number Weeks displayed on activity chart on the dashboard
|
// Number Weeks displayed on activity chart on the dashboard
|
||||||
$conf['dashboard_activity_nb_weeks'] = 4;
|
$conf['dashboard_activity_nb_weeks'] = 4;
|
||||||
|
|
||||||
// Number of seconds before auto openning when dragging albums in milliseconds : 3 seconds by default
|
// On album mover page, number of seconds before auto openning album when
|
||||||
$conf['delay_before_auto_openning'] = 3*1000;
|
// dragging an album. In milliseconds. 3 seconds by default.
|
||||||
|
$conf['album_move_delay_before_auto_opening'] = 3*1000;
|
||||||
|
|
||||||
// +-----------------------------------------------------------------------+
|
// +-----------------------------------------------------------------------+
|
||||||
// | Filter |
|
// | Filter |
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue