добавил в веб-интерфейс отображение рядом с номером игра фото, если фотографии у игрока нет
This commit is contained in:
@@ -2277,6 +2277,7 @@ function getRowPlayer(row) {
|
||||
number: row.dataset.playerNumber || "",
|
||||
position: row.dataset.playerPosition || "",
|
||||
isCaptain: row.dataset.playerCaptain === "1",
|
||||
photoEnabled: row.dataset.playerPhotoEnabled === "1",
|
||||
disciplineType: row.dataset.disciplineType || ""
|
||||
};
|
||||
}
|
||||
@@ -2289,6 +2290,7 @@ function setRowPlayer(row, player) {
|
||||
row.dataset.playerNumber = player.number ?? "";
|
||||
row.dataset.playerPosition = player.position ?? "";
|
||||
row.dataset.playerCaptain = player.isCaptain ? "1" : "0";
|
||||
row.dataset.playerPhotoEnabled = player.photoEnabled ? "1" : "0";
|
||||
row.dataset.disciplineType = player.disciplineType ?? "";
|
||||
}
|
||||
|
||||
@@ -2380,6 +2382,9 @@ function renderLineupRow(row) {
|
||||
|
||||
const idJs = JSON.stringify(player.id || player.number || "");
|
||||
const nameJs = JSON.stringify(displayName);
|
||||
const noPhotoIconHtml = player.photoEnabled
|
||||
? ''
|
||||
: '<span class="no-photo-icon" title="Фото выключено: в JSON будет подставлена EMPTY.png" aria-label="Фото выключено">📷</span>';
|
||||
|
||||
let actionsHtml = '';
|
||||
if (role === "starting") {
|
||||
@@ -2411,7 +2416,12 @@ function renderLineupRow(row) {
|
||||
}
|
||||
|
||||
row.innerHTML = `
|
||||
<td class="num-cell">${escapeHtml(player.number || "")}</td>
|
||||
<td class="num-cell">
|
||||
<span class="num-with-photo-status">
|
||||
${noPhotoIconHtml}
|
||||
<span class="player-number-value">${escapeHtml(player.number || "")}</span>
|
||||
</span>
|
||||
</td>
|
||||
<td class="player-cell" title="Показать титр игрока">
|
||||
<button
|
||||
type="button"
|
||||
@@ -3264,7 +3274,8 @@ function normalizePlayer(item = {}) {
|
||||
first_name: item.first_name || "",
|
||||
number: item.number || "",
|
||||
position: item.position || "",
|
||||
is_captain: !!item.is_captain
|
||||
is_captain: !!item.is_captain,
|
||||
photo_enabled: item.photo_enabled === true || item.photo_enabled === 1 || item.photo_enabled === "1"
|
||||
};
|
||||
}
|
||||
|
||||
@@ -3651,6 +3662,7 @@ function rerenderLineupTable(side, role) {
|
||||
number: player.number,
|
||||
position: player.position,
|
||||
isCaptain: !!player.is_captain,
|
||||
photoEnabled: !!player.photo_enabled,
|
||||
disciplineType: ""
|
||||
});
|
||||
renderLineupRow(row);
|
||||
@@ -3680,6 +3692,7 @@ function rebuildFormationFromMatchData(side) {
|
||||
position: p.position || "",
|
||||
is_captain: !!p.is_captain,
|
||||
photo: p.photo || "",
|
||||
photo_enabled: p.photo_enabled === true || p.photo_enabled === 1 || p.photo_enabled === "1",
|
||||
x: old?.x ?? 50,
|
||||
y: old?.y ?? (12 + idx * 6)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user