{% extends "base.html" %} {% block title %}Fakty - Baza Wiedzy ZOPK{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
Typ faktu: Wszystkie {% for ftype in fact_types %} {{ ftype }} {% endfor %} Status: ✓ Zweryfikowane ⏳ Oczekujące
Pokazuję {{ facts|length }} z {{ total }} faktów (strona {{ page }} z {{ pages }}) {% if source_news_id %} Źródło: Artykuł #{{ source_news_id }} ✕ usuń filtr {% endif %}
{% for fact in facts %} {% else %} {% endfor %}
ID Fakt Typ Wartość Encje Status Źródło Akcje
#{{ fact.id }} {{ fact.full_text }} {% if fact.subject or fact.predicate or fact.object %}
{% if fact.subject %}Podmiot: {{ fact.subject }}{% endif %} {% if fact.predicate %}Relacja: {{ fact.predicate }}{% endif %} {% if fact.object %}Obiekt: {{ fact.object[:50] }}{% if fact.object|length > 50 %}...{% endif %}{% endif %}
{% endif %}
{% if fact.fact_type %} {{ fact.fact_type }} {% else %} {% endif %} {% if fact.numeric_value %} {{ fact.numeric_value|round(2) }} {% if fact.numeric_unit %}{{ fact.numeric_unit }}{% endif %} {% elif fact.date_value %} {{ fact.date_value }} {% else %} {% endif %} {% if fact.entities_involved %} {% for e in fact.entities_involved[:3] %} {{ e.name if e.name else e }} {% endfor %} {% if fact.entities_involved|length > 3 %} +{{ fact.entities_involved|length - 3 }} {% endif %} {% else %} {% endif %} {% if fact.is_verified %} ✓ Zweryfikowany {% else %} ⏳ Oczekuje {% endif %} {% if fact.confidence_score %}
{{ (fact.confidence_score * 100)|round }}% pewności {% endif %}
{% if fact.source_news_id %} Art. #{{ fact.source_news_id }} {% if fact.source_title %}
{{ fact.source_title[:40] }}... {% endif %} {% endif %}
Brak faktów do wyświetlenia
{% if pages > 1 %} {% endif %}
{% endblock %} {% block extra_js %} async function toggleVerify(id, newState) { try { const response = await fetch(`/api/zopk/knowledge/facts/${id}/verify`, { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': '{{ csrf_token() }}' }, body: JSON.stringify({ is_verified: newState }) }); const data = await response.json(); if (data.success) { location.reload(); } else { alert('Błąd: ' + data.error); } } catch (error) { alert('Błąd: ' + error.message); } } {% endblock %}