diff --git a/admin/themes/default/js/history.js b/admin/themes/default/js/history.js index b5d8a5117..5b0f71204 100644 --- a/admin/themes/default/js/history.js +++ b/admin/themes/default/js/history.js @@ -109,11 +109,11 @@ function fillHistoryResult(ajaxParam) { $(".loading").removeClass("hide"); // console.log(ajaxParam.user); // console.log(raw_data); - data = raw_data.result[0]; - imageDisplay = raw_data.result[1].display_thumbnail; - console.log("RESULTS"); - maxPage = raw_data.result[2]; - + data = raw_data.result["lines"]; + imageDisplay = raw_data.result["params"].display_thumbnail; + // console.log("RESULTS"); + maxPage = raw_data.result["maxPage"]; + console.log(data); //clear lines before refill $(".tab .search-line").remove(); @@ -172,7 +172,7 @@ function lineConstructor(line, id, imageDisplay) { newLine.find(".date-day").html(line.DATE); newLine.find(".date-hour").html(line.TIME); - newLine.find(".user-name").html(line.USERNAME); + newLine.find(".user-name").html(line.USERNAME + ''); newLine.find(".user-name").attr("id", line.USERID); if (current_param.user == "-1") { @@ -184,10 +184,11 @@ function lineConstructor(line, id, imageDisplay) { }) } - newLine.find(".user-ip").html(line.IP); + newLine.find(".user-ip").html(line.IP + ''); + newLine.find(".user-ip").data("ip", line.IP); if (current_param.ip == "") { newLine.find(".user-ip").on("click", function () { - current_param.ip = $(this).html(); + current_param.ip = $(this).data("ip"); current_param.pageNumber = 0; addIpFilter($(this).html()); fillHistoryResult(current_param); @@ -207,8 +208,17 @@ function lineConstructor(line, id, imageDisplay) { switch (line.SECTION) { case "tags": - newLine.find(".type-name").html(line.TAGS[0]); - newLine.find(".type-id").html("#" + line.TAGIDS[0]); + if (line.TAGS.length > 1 && line.TAGS.length <= 2 ) { + newLine.find(".type-name").html(line.TAGS[0] +", "+ line.TAGS[1] + ", ..."); + newLine.find(".type-id").html("#" + line.TAGIDS[0] +", "+ line.TAGIDS[1] + ", ..."); + } else if (line.TAGS.length > 2) { + newLine.find(".type-name").html(line.TAGS[0] +", "+ line.TAGS[1] +", "+ line.TAGS[2] + ", ..."); + newLine.find(".type-id").html("#" + line.TAGIDS[0] +", "+ line.TAGIDS[1] +", "+ line.TAGIDS[2] + ", ..."); + } else { + newLine.find(".type-name").html(line.TAGS[0]); + newLine.find(".type-id").html("#" + line.TAGIDS[0]); + } + let detail_str = ""; line.TAGS.forEach(tag => { detail_str += tag + ", "; @@ -234,6 +244,17 @@ function lineConstructor(line, id, imageDisplay) { newLine.find(".type-name").html(str_favorites); newLine.find(".type-id").remove(); break; + case "recent_cats": + newLine.find(".type-name").html(str_recent_cats); + newLine.find(".type-id").remove(); + break; + case "recent_pics": + newLine.find(".type-name").html(str_recent_pics); + newLine.find(".type-id").remove(); + break; + case "categories": + newLine.find(".type-name").html(line.CATEGORY); + newLine.find(".type-id").remove(); default: break; diff --git a/admin/themes/default/template/history.tpl b/admin/themes/default/template/history.tpl index 7ba339710..0acec9f88 100644 --- a/admin/themes/default/template/history.tpl +++ b/admin/themes/default/template/history.tpl @@ -36,8 +36,10 @@ const API_METHOD = "{$API_METHOD}"; const str_dwld = "{'Downloaded'|translate}"; const str_most_visited = "{'Most visited'|translate}"; const str_best_rated = "{'Best rated'|translate}"; -const str_list = "{'Random'|translate}"; -const str_favorites = "{'Favorites'|translate}"; +const str_list = "{'Random photo'|translate}"; +const str_favorites = "{'Your favorites'|translate}"; +const str_recent_cats = "{'Recent albums'|translate}"; +const str_recent_pics = "{'Recent photos'|translate}"; {/footer_script} {combine_script id='common' load='footer' path='admin/themes/default/js/common.js'} @@ -82,7 +84,7 @@ const str_favorites = "{'Favorites'|translate}";