Add BackPRO News theme and update database schema for article tracking

- Introduced a new WordPress theme "BackPRO News" with a lightweight magazine-style design.
- Added columns for tracking retry attempts and timestamps for unpublished/generated articles in the articles table.
- Included remote service metadata fields in the sites table for better management.
- Created log files for image replacements, installer actions, OpenAI article generation, and publishing processes.
- Implemented a dashboard template for site management, including permalink settings and theme installation options.
This commit is contained in:
2026-02-17 20:08:02 +01:00
parent b653cea252
commit 4d5e220b3c
41 changed files with 4229 additions and 239 deletions

View File

@@ -165,19 +165,17 @@
</div>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Add subtopic modal
document.querySelectorAll('.btn-add-subtopic').forEach(function(btn) {
btn.addEventListener('click', function() {
document.addEventListener('DOMContentLoaded', function () {
document.querySelectorAll('.btn-add-subtopic').forEach(function (btn) {
btn.addEventListener('click', function () {
document.getElementById('subtopicForm').action = '/global-topics/' + this.dataset.parentId + '/subtopics';
document.getElementById('subtopicParentName').textContent = this.dataset.parentName;
new bootstrap.Modal(document.getElementById('addSubtopicModal')).show();
});
});
// Edit modal
document.querySelectorAll('.btn-edit-global').forEach(function(btn) {
btn.addEventListener('click', function() {
document.querySelectorAll('.btn-edit-global').forEach(function (btn) {
btn.addEventListener('click', function () {
document.getElementById('editGlobalForm').action = '/global-topics/' + this.dataset.id + '/update';
document.getElementById('editGlobalName').value = this.dataset.name;
document.getElementById('editGlobalDesc').value = this.dataset.description;
@@ -185,13 +183,18 @@ document.addEventListener('DOMContentLoaded', function() {
});
});
// AJAX delete
document.querySelectorAll('.btn-delete-global').forEach(function(btn) {
btn.addEventListener('click', function() {
document.querySelectorAll('.btn-delete-global').forEach(function (btn) {
btn.addEventListener('click', async function () {
var id = this.dataset.id;
var isCategory = this.dataset.type === 'category';
var msg = isCategory ? 'Usunąć kategorię i wszystkie jej tematy?' : 'Usunąć ten temat?';
if (!confirm(msg)) return;
var msg = isCategory ? 'Usunac kategorie i wszystkie jej tematy?' : 'Usunac ten temat?';
var ok = await backproConfirm(msg, {
title: 'Potwierdzenie usuniecia',
confirmText: 'Usun',
cancelText: 'Anuluj',
confirmClass: 'btn-danger'
});
if (!ok) return;
var el = isCategory ? this.closest('.accordion-item') : this.closest('tr');
var origHtml = btn.innerHTML;
@@ -202,25 +205,23 @@ document.addEventListener('DOMContentLoaded', function() {
method: 'POST',
headers: { 'X-Requested-With': 'XMLHttpRequest' }
})
.then(function(r) { return r.json(); })
.then(function(data) {
.then(function (r) { return r.json(); })
.then(function (data) {
if (data.success) {
el.style.transition = 'opacity .3s';
el.style.opacity = '0';
setTimeout(function() {
setTimeout(function () {
el.remove();
if (!isCategory) {
var tbody = el.closest && document.querySelector('table tbody');
}
}, 300);
backproNotify('Element zostal usuniety.', 'success', { delay: 2500 });
} else {
alert(data.message || 'Błąd usuwania');
backproNotify(data.message || 'Blad usuwania', 'danger');
btn.disabled = false;
btn.innerHTML = origHtml;
}
})
.catch(function() {
alert('Błąd połączenia');
.catch(function () {
backproNotify('Blad polaczenia', 'danger');
btn.disabled = false;
btn.innerHTML = origHtml;
});