related to #1465 added hover on ip and user name + adjustments for labels and translation

This commit is contained in:
Matthieu Leproux
2021-09-20 15:06:21 +02:00
committed by plegall
parent 98c8269cdf
commit 5ca10bbfae
5 changed files with 38 additions and 11 deletions

View File

@@ -1,6 +1,7 @@
$(document).ready(() => {
activateLineOptions();
checkFilters();
$(".elem-type-select").on("change", function (e) {
console.log($(".elem-type-select option:selected").attr("value"));
@@ -71,6 +72,11 @@ $(document).ready(() => {
current_param.pageNumber -= 1;
fillHistoryResult(current_param);
});
$(".refresh-results").on("click", function () {
$(this).addClass("animate-spin")
fillHistoryResult(current_param);
})
})
function activateLineOptions() {
@@ -130,6 +136,7 @@ function fillHistoryResult(ajaxParam) {
activateLineOptions();
$(".loading").addClass("hide");
updatePagination(maxPage);
$(".refresh-results").removeClass("animate-spin")
})
}
@@ -303,10 +310,11 @@ function addUserFilter(username) {
current_param.user = "-1";
current_param.pageNumber = 0;
fillHistoryResult(current_param);
checkFilters();
})
$(".filter-container").append(newFilter);
checkFilters();
}
function addIpFilter(ip) {
@@ -322,16 +330,17 @@ function addIpFilter(ip) {
current_param.ip = "";
current_param.pageNumber = 0;
fillHistoryResult(current_param);
checkFilters();
})
$(".filter-container").append(newFilter);
checkFilters();
}
function addImageFilter(img_id) {
var newFilter = $("#default-filter").clone();
newFilter.removeClass("hide");
newFilter.find(".filter-title").html("Image #" + img_id);
newFilter.find(".filter-icon").addClass("icon-picture");
@@ -341,10 +350,11 @@ function addImageFilter(img_id) {
current_param.image_id = "";
current_param.pageNumber = 0;
fillHistoryResult(current_param);
checkFilters();
})
$(".filter-container").append(newFilter);
checkFilters();
}
function updateArrows(actualPage, maxPage) {
@@ -369,3 +379,11 @@ function updatePagination(maxPage) {
"<a class='actual'>"+ (current_param.pageNumber+1) +"</a>"
)
}
function checkFilters() {
if ($(".filter-container")[0].childElementCount - 1 > 0) { //Check if there are filters
$(".filter-tags label").show();
} else {
$(".filter-tags label").hide();
}
}

View File

@@ -73,7 +73,7 @@ const str_recent_pics = "{'Recent photos'|translate}";
</div>
<div class="filter-part elem-type advanced-filter-select-container">
<label>
{'Element type'|@translate}
{'Action'|@translate}
<select name="types[]" class="elem-type-select user-action-select advanced-filter-select">
{* {html_options values=$type_option_values output=$type_option_values|translate selected=$type_option_selected} *}
<option value=""></option>
@@ -92,6 +92,8 @@ const str_recent_pics = "{'Recent photos'|translate}";
</div>
</div>
</div>
<div class="refresh-results icon-arrows-cw tiptip" title="{'Refresh'|translate}">
</div>
</fieldset>
</form>
@@ -123,7 +125,7 @@ const str_recent_pics = "{'Recent photos'|translate}";
{'User'|translate}
</div>
<div class="type-title">
{'Type'|translate}
{'Object'|translate}
</div>
<div class="detail-title">
{'Details'|translate}
@@ -265,6 +267,14 @@ jQuery(document).ready( function() {
font-weight: bold;
}
.refresh-results {
margin-left: auto;
display: flex;
align-items: center;
cursor: pointer;
font-size: 17px;
}
.history-filter {
background: #f3f3f3;
display: flex;

View File

@@ -971,13 +971,10 @@ SELECT
$result = array_reverse($result, true);
$result = array_slice($result, $param['pageNumber']*100, 100);
/* Tableau associatif here cf ws_images_search*/
return array(
'lines' => $result,
'params' => $param,
'maxPage' => $max_page
);
// [$result, $param, $max_page];
}
?>

View File

@@ -1262,4 +1262,5 @@ $lang['Tag name'] = 'Tag name';
$lang['Visited'] = 'Visited';
$lang['Downloaded'] = 'Downloaded';
$lang['Personnalized filters'] = 'Personnalized filters';
$lang['Personnalized filters'] = 'Personnalized filters';
$lang['Object'] = 'Object';

View File

@@ -1264,4 +1264,5 @@ $lang['Tag name'] = 'Nom du tag';
$lang['Visited'] = 'Visité';
$lang['Downloaded'] = 'Téléchargé';
$lang['Personnalized filters'] = 'Filtres personnalisés';
$lang['Personnalized filters'] = 'Filtres personnalisés';
$lang['Object'] = 'Objet';