QWidget, QVBoxLayout, QTabWidget,
QListWidget, QListWidgetItem, QLabel,
)
-from PyQt6.QtCore import Qt, pyqtSignal
+from PyQt6.QtCore import Qt, pyqtSignal, QSize
from PyQt6.QtGui import QColor
from core.models import Article
self.article = article
if article.has_translation:
badge = f"🇬🇧 ✓" if article.lang == "it" else "🇮🇹 ✓"
- status = f"{article.slug} [{badge}]"
else:
badge = f"🇬🇧 ✗" if article.lang == "it" else "🇮🇹 ✗"
- status = f"{article.slug} [{badge}]"
- self.setText(status)
- if not article.has_translation:
+ line1 = f"{article.slug} [{badge}]"
+ if article.draft:
+ line1 = f"[DRAFT] {line1}"
+
+ parts = []
+ if article.meta_type:
+ parts.append(article.meta_type)
+ if article.meta_date:
+ parts.append(article.meta_date)
+ if article.meta_tags:
+ parts.append(f"#{article.meta_tags.replace(', ', ' #')}")
+ if article.meta_categories:
+ parts.append(f"[{article.meta_categories}]")
+ line2 = " ".join(parts) if parts else ""
+
+ text = f"{line1}\n{line2}" if line2 else line1
+ self.setText(text)
+ self.setSizeHint(QSize(0, 42) if line2 else QSize(0, 26))
+
+ if article.draft:
+ self.setForeground(QColor("#f59e0b"))
+ elif not article.has_translation:
self.setForeground(QColor("#ff6b6b"))
class ArticlesView(QWidget):