коррекция высоты блоков подписки и связанных событий, декодировка представления текста опроса
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-09-28 20:09:41 +03:00
parent b8189e9b12
commit c91c0d6e1c
+24 -17
View File
@@ -1651,6 +1651,13 @@
minute: '2-digit'
});
};
// Декодируем Unicode строки
const decodeUnicode = (str) => {
if (!str) return str;
return str.replace(/\\u[\dA-F]{4}/gi, (match) => {
return String.fromCharCode(parseInt(match.replace(/\\u/g, ''), 16));
});
};
// Загружаем связанные события
const linkedEvents = await fetch(`${PREFIX}/api/posts/${postId}/linked_events`)
.then(response => response.json())
@@ -1719,22 +1726,22 @@
<i class="fas fa-poll me-1"></i> Информация об опросе
</div>
<div class="card-body">
<div class="mb-3">
<label class="form-label fw-bold">Вопрос опроса:</label>
<div class="form-control">${post.poll_question || 'Не указан'}</div>
<div class="mb-2">
<label class="form-label fw-bold mb-1">Вопрос опроса:</label>
<div class="form-control py-2" style="min-height: auto; height: auto;">${post.poll_question || 'Не указан'}</div>
</div>
<div class="mb-3">
<label class="form-label fw-bold">Варианты ответов:</label>
<div class="form-control">${post.poll_options || 'Не указаны'}</div>
<div class="mb-2">
<label class="form-label fw-bold mb-1">Варианты ответов:</label>
<div class="form-control py-2" style="min-height: auto; height: auto;">${decodeUnicode(post.poll_options) || 'Не указаны'}</div>
</div>
<div class="row">
<div class="col-md-6">
<label class="form-label fw-bold">Множественный выбор:</label>
<div class="form-control">${post.poll_multiple ? 'Да' : 'Нет'}</div>
<label class="form-label fw-bold mb-1">Множественный выбор:</label>
<div class="form-control py-2" style="min-height: auto; height: auto;">${post.poll_multiple ? 'Да' : 'Нет'}</div>
</div>
<div class="col-md-6">
<label class="form-label fw-bold">Окончание опроса:</label>
<div class="form-control">${formatDate(post.poll_end_date)}</div>
<label class="form-label fw-bold mb-1">Окончание опроса:</label>
<div class="form-control py-2" style="min-height: auto; height: auto;">${formatDate(post.poll_end_date)}</div>
</div>
</div>
</div>
@@ -1744,8 +1751,8 @@
<div class="card-header bg-info text-white">
<i class="fas fa-chart-bar me-1"></i> Результаты опроса в Telegram
</div>
<div class="card-body">
<pre class="bg-light p-3 rounded">${post.tg_poll_results}</pre>
<div class="card-body py-2">
<pre class="bg-light p-2 rounded mb-0" style="font-size: 0.9em; max-height: 200px; overflow-y: auto;">${post.tg_poll_results}</pre>
</div>
</div>` : ''}
${post.marks && post.marks.length > 0 ? `
@@ -1753,9 +1760,9 @@
<div class="card-header bg-success text-white">
<i class="fas fa-users me-1"></i> Подписки (${post.marks.length})
</div>
<div class="card-body">
<div class="card-body py-2">
<div class="table-responsive">
<table class="table table-sm">
<table class="table table-sm mb-0">
<thead>
<tr>
<th>Имя пользователя</th>
@@ -1783,11 +1790,11 @@
<div class="card-header bg-warning text-white">
<i class="fas fa-link me-1"></i> Связанные события (${linkedEvents.length})
</div>
<div class="card-body">
<div class="card-body py-2">
<div class="linked-items-list">
<div class="list-group">
<div class="list-group mb-0">
${linkedEvents.map(event => `
<a href="#" class="list-group-item list-group-item-action"
<a href="#" class="list-group-item list-group-item-action py-2"
onclick="highlightSelectedEvent(${event.id}); document.getElementById('events-tab').click(); return false;">
${event.name || `Событие ${event.id}`}
<button class="btn btn-sm btn-outline-danger float-end"