Ред пост 6
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2025-10-12 20:33:18 +03:00
parent 9e70b1aea4
commit 9ab01a5f74
+48 -38
View File
@@ -26,6 +26,17 @@
right: 20px;
z-index: 1050;
}
/* Скрытие крутилок у числовых полей */
input[type="text"][pattern="[0-9]*"]::-webkit-outer-spin-button,
input[type="text"][pattern="[0-9]*"]::-webkit-inner-spin-button {
-webkit-appearance: none;
appearance: none;
margin: 0;
}
input[type="text"][pattern="[0-9]*"] {
-moz-appearance: textfield;
appearance: textfield;
}
</style>
</head>
<body>
@@ -67,7 +78,7 @@
</div>
</div>
<!-- VK ID -->
<div class="row">
<div class="row mb-2">
<div class="col-md-2">
<label for="vk_post_id" class="form-label">VK ID:</label>
</div>
@@ -75,6 +86,35 @@
<input type="text" class="form-control" id="vk_post_id" maxlength="8" required>
</div>
</div>
<!-- Переключатели -->
<div class="row mb-2">
<div class="col-md-6">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="is_event">
<label class="form-check-label" for="is_event">Событие</label>
</div>
</div>
<div class="col-md-6">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="is_poll">
<label class="form-check-label" for="is_poll">Опрос</label>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="marked_for_publication">
<label class="form-check-label" for="marked_for_publication">К публикации</label>
</div>
</div>
<div class="col-md-6">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="published_in_tg">
<label class="form-check-label" for="published_in_tg">Опубликовано в TG</label>
</div>
</div>
</div>
</div>
<div class="col-md-4 text-end">
<div id="image-preview-container" style="display: none;">
@@ -83,38 +123,9 @@
</div>
</div>
<!-- Переключатели -->
<div class="row mb-3">
<div class="col-md-3">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="is_event">
<label class="form-check-label" for="is_event">Событие</label>
</div>
</div>
<div class="col-md-3">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="is_poll">
<label class="form-check-label" for="is_poll">Опрос</label>
</div>
</div>
<div class="col-md-3">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="marked_for_publication">
<label class="form-check-label" for="marked_for_publication">К публикации</label>
</div>
</div>
<div class="col-md-3">
<div class="form-check form-switch">
<input class="form-check-input" type="checkbox" id="published_in_tg">
<label class="form-check-label" for="published_in_tg">Опубликовано в TG</label>
</div>
</div>
</div>
<!-- Текстовое поле поста -->
<div class="mb-3">
<label for="text" class="form-label required">Текст поста</label>
<textarea class="form-control" id="text" rows="4" required></textarea>
<textarea class="form-control" id="text" rows="4" required placeholder="Введите текст поста"></textarea>
</div>
<!-- URL изображения -->
@@ -124,7 +135,6 @@
</div>
<div class="col-md-10">
<input type="url" class="form-control" id="image_url">
<div class="form-text">Ссылка на изображение для поста</div>
</div>
</div>
@@ -160,19 +170,19 @@
<label for="tg_message_id" class="form-label">ID TG:</label>
</div>
<div class="col-md-2">
<input type="number" class="form-control" id="tg_message_id">
<input type="text" class="form-control" id="tg_message_id" pattern="[0-9]*" inputmode="numeric">
</div>
<div class="col-md-2">
<label for="tg_poll_id" class="form-label">ID опроса TG:</label>
</div>
<div class="col-md-2">
<input type="number" class="form-control" id="tg_poll_id">
<input type="text" class="form-control" id="tg_poll_id" pattern="[0-9]*" inputmode="numeric">
</div>
<div class="col-md-2">
<label for="tg_markpost_id" class="form-label">ID отметок TG:</label>
</div>
<div class="col-md-2">
<input type="number" class="form-control" id="tg_markpost_id">
<input type="text" class="form-control" id="tg_markpost_id" pattern="[0-9]*" inputmode="numeric">
</div>
</div>
@@ -354,13 +364,13 @@
document.getElementById('vk_post_url').value = post.vk_post_url || '';
// Форматирование дат для input[type=datetime-local]
// Конвертация UTC в локальное время с округлением до минут
// Конвертация UTC в локальное время с округлением до минут в 24-часовом формате
const formatForInput = (dateStr) => {
if (!dateStr) return '';
const date = new Date(dateStr);
// Округляем до минут (убираем секунды и миллисекунды)
date.setSeconds(0, 0);
// Возвращаем в локальном времени в формате YYYY-MM-DDTHH:MM
// Возвращаем в локальном времени в формате YYYY-MM-DDTHH:MM (24-часовой формат)
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
@@ -409,7 +419,7 @@
const date = new Date(localString);
// Округляем до минут
date.setSeconds(0, 0);
// Возвращаем в UTC формате для сервера
// Возвращаем в UTC формате для сервера (24-часовой формат)
return date.toISOString().slice(0, 19).replace('T', ' ');
};