mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-05-06 05:22:37 +02:00
related to #1465 displaying real info in lines
This commit is contained in:
committed by
plegall
parent
8d41d27258
commit
717213e6d4
@@ -1,4 +1,6 @@
|
||||
$(document).ready(() => {
|
||||
|
||||
fillHistoryResult()
|
||||
|
||||
$(".filter").submit(function (e) {
|
||||
e.preventDefault();
|
||||
@@ -35,8 +37,11 @@ $(document).ready(() => {
|
||||
console.log("RESULTS");
|
||||
console.log(data);
|
||||
|
||||
var id = 0;
|
||||
|
||||
data.forEach(line => {
|
||||
lineConstructor(line)
|
||||
lineConstructor(line, id)
|
||||
id++
|
||||
});
|
||||
},
|
||||
error: function (e) {
|
||||
@@ -47,10 +52,83 @@ $(document).ready(() => {
|
||||
console.log(dataObj);
|
||||
});
|
||||
|
||||
function lineConstructor(line) {
|
||||
// console.log(line);
|
||||
function fillHistoryResult() {
|
||||
|
||||
var dateObj = new Date();
|
||||
var month = dateObj.getUTCMonth() + 1; //months from 1-12
|
||||
var day = dateObj.getUTCDate();
|
||||
var year = dateObj.getUTCFullYear();
|
||||
|
||||
if (month < 10) month = "0" + month;
|
||||
if (day < 10) day = "0" + day;
|
||||
|
||||
today = year + "-" + month + "-" + day;
|
||||
|
||||
var dataSend = {
|
||||
start: "",
|
||||
end: today,
|
||||
types: {
|
||||
0: "none",
|
||||
1: "picture",
|
||||
2: "high",
|
||||
3: "other"
|
||||
},
|
||||
user: "-1",
|
||||
image_id: "",
|
||||
filename: "",
|
||||
ip: "",
|
||||
display_thumbnail: "no_display_thumbnail",
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: API_METHOD,
|
||||
method: "POST",
|
||||
dataType: "JSON",
|
||||
data: dataSend,
|
||||
success: function (raw_data) {
|
||||
$(".loading").removeClass("hide");
|
||||
data = raw_data.result;
|
||||
console.log("RESULTS");
|
||||
console.log(data);
|
||||
|
||||
var id = 0;
|
||||
|
||||
data.forEach(line => {
|
||||
lineConstructor(line, id)
|
||||
id++
|
||||
});
|
||||
},
|
||||
error: function (e) {
|
||||
console.log("Something went wrong: " + e);
|
||||
}
|
||||
}).done(() => {
|
||||
$(".loading").addClass("hide");
|
||||
})
|
||||
}
|
||||
|
||||
function lineConstructor(line, id) {
|
||||
let newLine = $("#-1").clone();
|
||||
|
||||
newLine.removeClass("hide");
|
||||
|
||||
/* console log to help debug */
|
||||
console.log(line);
|
||||
newLine.attr("id", id);
|
||||
console.log(id);
|
||||
|
||||
newLine.find(".date-day").html(line.DATE);
|
||||
newLine.find(".date-hour").html(line.TIME);
|
||||
|
||||
newLine.find(".user-name").html(line.USERNAME);
|
||||
newLine.find(".user-ip").html(line.IP);
|
||||
|
||||
displayLine(newLine);
|
||||
}
|
||||
|
||||
function displayLine(line) {
|
||||
$(".tab").append(line);
|
||||
}
|
||||
|
||||
$(".search-line").find(".img-option").hide();
|
||||
|
||||
/* Display the option on the click on "..." */
|
||||
|
||||
@@ -155,7 +155,47 @@ const API_METHOD = "{$API_METHOD}";
|
||||
<span class="icon-spin6 animate-spin"> </span>
|
||||
</div>
|
||||
|
||||
<div class="search-line" id="-1">
|
||||
<div class="search-line hide" id="-1">
|
||||
<div class="date-section">
|
||||
<span class="date-day bold"> July 4th, 2042 </span>
|
||||
<span> at <span class="date-hour">23:59:59</span> </span>
|
||||
</div>
|
||||
|
||||
<div class="user-section">
|
||||
<span class="user-name bold"> Zac le boss </span>
|
||||
<span class="user-ip"> 192.168.0.0</span>
|
||||
</div>
|
||||
|
||||
<div class="type-section">
|
||||
<span class="type-icon"> <i class="icon-file-image"> </i> </span>
|
||||
<span class="icon-ellipsis-vert toggle-img-option">
|
||||
<div class="img-option">
|
||||
<span> info 2</span>
|
||||
<span> info 1</span>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<div class="type-desc">
|
||||
<span class="type-name bold"> WIP </span>
|
||||
<span class="type-id"> tag #99 </span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="detail-section">
|
||||
<div class="detail-item detail-item-1">
|
||||
detail 1
|
||||
</div>
|
||||
<div class="detail-item detail-item-2">
|
||||
detail 2
|
||||
</div>
|
||||
<div class="detail-item detail-item-3">
|
||||
detail 3
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{* <div class="search-line" id="-2">
|
||||
<div class="date-section">
|
||||
<span class="date-day bold"> July 4th, 2042 </span>
|
||||
<span class="date-hour"> at 23:59:59</span>
|
||||
@@ -193,47 +233,7 @@ const API_METHOD = "{$API_METHOD}";
|
||||
detail 3
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="search-line" id="-2">
|
||||
<div class="date-section">
|
||||
<span class="date-day bold"> July 4th, 2042 </span>
|
||||
<span class="date-hour"> at 23:59:59</span>
|
||||
</div>
|
||||
|
||||
<div class="user-section">
|
||||
<span class="user-name bold"> Zac le boss </span>
|
||||
<span class="user-ip"> 127.0.0.1 </span>
|
||||
</div>
|
||||
|
||||
<div class="type-section">
|
||||
<span class="type-icon"> <i class="icon-file-image"> </i> </span>
|
||||
<span class="icon-ellipsis-vert toggle-img-option">
|
||||
<div class="img-option">
|
||||
<span> info 2</span>
|
||||
<span> info 1</span>
|
||||
</div>
|
||||
</span>
|
||||
|
||||
<div class="type-desc">
|
||||
<span class="type-name bold"> WIP </span>
|
||||
<span class="type-id"> tag #99 </span>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="detail-section">
|
||||
<div class="detail-item detail-item-1">
|
||||
detail 1
|
||||
</div>
|
||||
<div class="detail-item detail-item-2">
|
||||
detail 2
|
||||
</div>
|
||||
<div class="detail-item detail-item-3">
|
||||
detail 3
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> *}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -867,6 +867,7 @@ SELECT
|
||||
$user_string = '';
|
||||
if (isset($username_of[$line['user_id']]))
|
||||
{
|
||||
$user_name = $username_of[$line['user_id']];
|
||||
$user_string.= $username_of[$line['user_id']];
|
||||
}
|
||||
else
|
||||
@@ -961,9 +962,10 @@ SELECT
|
||||
|
||||
array_push( $result,
|
||||
array(
|
||||
'DATE' => $line['date'],
|
||||
'DATE' => format_date($line['date']),
|
||||
'TIME' => $line['time'],
|
||||
'USER' => $user_string,
|
||||
'USERNAME' => $user_name,
|
||||
'IP' => $line['IP'],
|
||||
'IMAGE' => $image_string,
|
||||
'TYPE' => $line['image_type'],
|
||||
|
||||
Reference in New Issue
Block a user