Faza 1 complete: bilingual+enrichment plumbing, UI/filters, frozen DB
Extraction finished (575/588 chunks; 6 content-filter-blocked, 7 await re-extraction). DB rebuilt and frozen at 9418 activities — content_keys are now stable for the enrichment overlay. Part A (plumbing + UI): - database.py: name_ro/description_ro/rules_ro/variations_ro, indoor_outdoor, space_needed, estimated_fields, source_id/source_ids/chunk_key columns; FTS5 indexes the 4 *_ro columns across CREATE + all 3 triggers; new equality filters + category counts for both axes. - activity.py: new fields + bilingual display helpers (get_display_*, is_estimated, axis displays). - config_taxonomy.py: INDOOR_OUTDOOR/SPACE_NEEDED enums + normalizers (None on unrecognised, no fabrication). - search.py / routes.py / config.py / templates / css: new dropdowns, RO-primary rendering with "(estimat)" markers and collapsible original text, and a /source/<id> download route shipped DARK behind SOURCE_DOWNLOAD_ENABLED (copyright opt-in). - build_database.py: source_id/chunk_key in dict_to_activity; merge_cluster unions source_ids without touching enrichment fields. Part B (enrichment pipeline, built not yet run): - build_database.py: load_enrichment + apply_enrichment (post-dedup, keyed on content_key) + --enrichment CLI + stated-vs-estimated QA. - run_enrichment.py (resumable, --source/--limit pilot scoping, --collect), ENRICHMENT_PROMPT.md. Repair: scripts/repair_extractions.py fixes the subagents' systematic unescaped-ASCII-quote bug with a faithful char-scanner (escapes, never truncates) + schema validation + a strictly-more-text guard. json_repair was tried first, truncated silently, and is NOT used. build_database has no repair dependency. Tests: tests/test_enrichment.py added; 99 pass. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -8,13 +8,13 @@
|
||||
<nav class="breadcrumb">
|
||||
<a href="{{ url_for('main.index') }}">Căutare</a>
|
||||
<span class="breadcrumb-separator">»</span>
|
||||
<span class="breadcrumb-current">{{ activity.name }}</span>
|
||||
<span class="breadcrumb-current">{{ activity.get_display_name() }}</span>
|
||||
</nav>
|
||||
|
||||
<!-- Activity header -->
|
||||
<header class="activity-detail-header">
|
||||
<div class="activity-title-section">
|
||||
<h1 class="activity-detail-title">{{ activity.name }}</h1>
|
||||
<h1 class="activity-detail-title">{{ activity.get_display_name() }}</h1>
|
||||
<span class="activity-category-badge">{{ display_names.get(activity.category, activity.category) }}</span>
|
||||
{% if activity.content_type %}
|
||||
<span class="activity-content-type-badge">{{ display_names.get(activity.content_type, activity.content_type) }}</span>
|
||||
@@ -31,27 +31,46 @@
|
||||
|
||||
<!-- Activity content -->
|
||||
<div class="activity-detail-content">
|
||||
<!-- Main description -->
|
||||
<!-- Main description (Romanian-primary, falls back to original) -->
|
||||
<section class="activity-section">
|
||||
<h2 class="section-title">Descriere</h2>
|
||||
<div class="activity-description">{{ activity.description }}</div>
|
||||
<div class="activity-description">{{ activity.get_display_description() }}</div>
|
||||
</section>
|
||||
|
||||
<!-- Rules and variations -->
|
||||
{% if activity.rules %}
|
||||
{% if activity.get_display_rules() %}
|
||||
<section class="activity-section">
|
||||
<h2 class="section-title">Reguli</h2>
|
||||
<div class="activity-rules">{{ activity.rules }}</div>
|
||||
<div class="activity-rules">{{ activity.get_display_rules() }}</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.variations %}
|
||||
{% if activity.get_display_variations() %}
|
||||
<section class="activity-section">
|
||||
<h2 class="section-title">Variații</h2>
|
||||
<div class="activity-variations">{{ activity.variations }}</div>
|
||||
<div class="activity-variations">{{ activity.get_display_variations() }}</div>
|
||||
</section>
|
||||
{% endif %}
|
||||
|
||||
<!-- Original (pre-translation) text, collapsed by default -->
|
||||
{% if activity.has_translation() %}
|
||||
<details class="activity-section original-text">
|
||||
<summary class="section-title">Text original ({{ display_names.get(activity.language, activity.language or 'sursă') }})</summary>
|
||||
<div class="original-content">
|
||||
<h3 class="metadata-title">{{ activity.name }}</h3>
|
||||
<div class="activity-description">{{ activity.description }}</div>
|
||||
{% if activity.rules %}
|
||||
<h4 class="metadata-title">Reguli</h4>
|
||||
<div class="activity-rules">{{ activity.rules }}</div>
|
||||
{% endif %}
|
||||
{% if activity.variations %}
|
||||
<h4 class="metadata-title">Variații</h4>
|
||||
<div class="activity-variations">{{ activity.variations }}</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</details>
|
||||
{% endif %}
|
||||
|
||||
<!-- Metadata grid -->
|
||||
<section class="activity-section">
|
||||
<h2 class="section-title">Detalii activitate</h2>
|
||||
@@ -59,21 +78,35 @@
|
||||
{% if activity.get_age_range_display() != "toate vârstele" %}
|
||||
<div class="metadata-card">
|
||||
<h3 class="metadata-title">Grupa de vârstă</h3>
|
||||
<p class="metadata-value">{{ activity.get_age_range_display() }}</p>
|
||||
<p class="metadata-value">{{ activity.get_age_range_display() }}{% if activity.is_estimated('age_group_min') or activity.is_estimated('age_group_max') %} <em class="estimated">(estimat)</em>{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.get_participants_display() != "orice număr" %}
|
||||
<div class="metadata-card">
|
||||
<h3 class="metadata-title">Participanți</h3>
|
||||
<p class="metadata-value">{{ activity.get_participants_display() }}</p>
|
||||
<p class="metadata-value">{{ activity.get_participants_display() }}{% if activity.is_estimated('participants_min') or activity.is_estimated('participants_max') %} <em class="estimated">(estimat)</em>{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.get_duration_display() != "durată variabilă" %}
|
||||
<div class="metadata-card">
|
||||
<h3 class="metadata-title">Durata</h3>
|
||||
<p class="metadata-value">{{ activity.get_duration_display() }}</p>
|
||||
<p class="metadata-value">{{ activity.get_duration_display() }}{% if activity.is_estimated('duration_min') or activity.is_estimated('duration_max') %} <em class="estimated">(estimat)</em>{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.get_indoor_outdoor_display() %}
|
||||
<div class="metadata-card">
|
||||
<h3 class="metadata-title">Interior / exterior</h3>
|
||||
<p class="metadata-value">{{ activity.get_indoor_outdoor_display() }}{% if activity.is_estimated('indoor_outdoor') %} <em class="estimated">(estimat)</em>{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if activity.get_space_needed_display() %}
|
||||
<div class="metadata-card">
|
||||
<h3 class="metadata-title">Spațiu necesar</h3>
|
||||
<p class="metadata-value">{{ activity.get_space_needed_display() }}{% if activity.is_estimated('space_needed') %} <em class="estimated">(estimat)</em>{% endif %}</p>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
@@ -125,9 +158,15 @@
|
||||
<h2 class="section-title">Informații sursă</h2>
|
||||
<div class="source-info">
|
||||
{% if activity.source_file %}
|
||||
{% if config.SOURCE_DOWNLOAD_ENABLED %}
|
||||
<p><strong>Fișier sursă:</strong>
|
||||
<a href="{{ url_for('main.source_download', activity_id=activity.id) }}">{{ activity.source_file }}</a>
|
||||
<span class="download-hint">(descarcă)</span></p>
|
||||
{% else %}
|
||||
<p><strong>Fișier sursă:</strong> {{ activity.source_file }}</p>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if activity.page_reference %}
|
||||
<p><strong>Referință:</strong> {{ activity.page_reference }}</p>
|
||||
{% endif %}
|
||||
|
||||
Reference in New Issue
Block a user