Fix log display for checkins and order splits (Z#23181229) (#4818)

- Fix link in pretix.event.order.changed.split
- Add link to existing order in pretix.event.order.changed.split_from
- Fix display of checkin entries without datetime in data
- Add additional info for admins (action type, linked content object)
This commit is contained in:
Mira
2025-02-07 11:53:17 +01:00
committed by GitHub
parent c4436ca319
commit f7cba6a2bd
3 changed files with 25 additions and 12 deletions

View File

@@ -1065,11 +1065,17 @@ function add_log_expand_handlers(el) {
} else if ($a.is("[data-expandpayment]")) {
url += 'payment/'
}
function format_data(data) {
return Object.entries(data).map(([key, value]) =>
$("<div>").append(
$("<b>").text(key + ': '),
$("<span>").text(JSON.stringify(value, null, 2))));
}
$.getJSON(url + '?pk=' + id, function (data) {
if ($a.parent().tagName === "p") {
$("<pre>").text(JSON.stringify(data.data, null, 2)).insertAfter($a.parent());
$("<pre>").append(format_data(data)).insertAfter($a.parent());
} else {
$("<pre>").text(JSON.stringify(data.data, null, 2)).appendTo($a.parent());
$("<pre>").append(format_data(data)).appendTo($a.parent());
}
$a.remove();
});