Initial commit: Organize project structure
- Create organized directory structure (src/, docs/, data/, static/, templates/) - Add comprehensive .gitignore for Python projects - Move Python source files to src/ - Move documentation files to docs/ with project/ and user/ subdirectories - Move database files to data/ - Update all database path references in Python code - Maintain Flask static/ and templates/ directories 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
23
templates/404.html
Normal file
23
templates/404.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ro">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Pagină negăsită - INDEX-SISTEM-JOCURI</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="welcome-section">
|
||||
<h1>🔍 Pagina nu a fost găsită</h1>
|
||||
<p class="subtitle">Eroare 404</p>
|
||||
<p class="description">
|
||||
Pagina pe care o căutați nu există sau a fost mutată.
|
||||
</p>
|
||||
<div style="margin-top: 30px;">
|
||||
<a href="{{ url_for('index') }}" class="btn-back">🏠 Înapoi la căutare</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
23
templates/500.html
Normal file
23
templates/500.html
Normal file
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ro">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Eroare server - INDEX-SISTEM-JOCURI</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<div class="welcome-section">
|
||||
<h1>⚠️ Eroare internă de server</h1>
|
||||
<p class="subtitle">Eroare 500</p>
|
||||
<p class="description">
|
||||
A apărut o eroare în timpul procesării cererii dumneavoastră. Vă rugăm să încercați din nou.
|
||||
</p>
|
||||
<div style="margin-top: 30px;">
|
||||
<a href="{{ url_for('index') }}" class="btn-back">🏠 Înapoi la căutare</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
222
templates/fisa.html
Normal file
222
templates/fisa.html
Normal file
@@ -0,0 +1,222 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ro">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Fișa activității: {{ activity.title }}</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
<style>
|
||||
/* Print-specific styles */
|
||||
@media print {
|
||||
.no-print { display: none !important; }
|
||||
body { font-size: 12px; }
|
||||
.sheet-container { max-width: none; margin: 0; box-shadow: none; }
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="sheet-body">
|
||||
<div class="sheet-container">
|
||||
<!-- Header -->
|
||||
<div class="sheet-header">
|
||||
<h1>🎮 FIȘA ACTIVITĂȚII</h1>
|
||||
<h2>{{ activity.title }}</h2>
|
||||
<div class="sheet-meta">
|
||||
<span class="category-badge">{{ activity.category or 'General' }}</span>
|
||||
<span class="difficulty-badge">{{ activity.difficulty or 'mediu' }}</span>
|
||||
<span class="generated-date">Generată: <span class="current-date"></span></span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Activity Info Grid -->
|
||||
<div class="activity-info-grid">
|
||||
<div class="info-item">
|
||||
<h3>👥 Participanți</h3>
|
||||
<p>{{ activity.participants or 'Nedefinit' }}</p>
|
||||
</div>
|
||||
|
||||
<div class="info-item">
|
||||
<h3>⏰ Durata</h3>
|
||||
<p>{{ activity.duration or 'Nedefinit' }}</p>
|
||||
</div>
|
||||
|
||||
<div class="info-item">
|
||||
<h3>🎂 Grupa de vârstă</h3>
|
||||
<p>{{ activity.age_group or 'Orice vârstă' }}</p>
|
||||
</div>
|
||||
|
||||
<div class="info-item">
|
||||
<h3>📊 Dificultate</h3>
|
||||
<p>{{ activity.difficulty or 'Mediu' }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
<div class="section">
|
||||
<h3>🎯 Descrierea activității</h3>
|
||||
<div class="description-text">
|
||||
{{ activity.description or 'Nu este disponibilă o descriere detaliată.' }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Materials -->
|
||||
<div class="section">
|
||||
<h3>🧰 Materiale necesare</h3>
|
||||
<div class="materials-list">
|
||||
{% if activity.materials %}
|
||||
{% if 'fără' in activity.materials.lower() or 'niciuna' in activity.materials.lower() %}
|
||||
<div class="no-materials">✅ <strong>Nu sunt necesare materiale</strong></div>
|
||||
{% else %}
|
||||
<p>{{ activity.materials }}</p>
|
||||
<div class="materials-checklist">
|
||||
<h4>📋 Checklist materiale:</h4>
|
||||
<ul>
|
||||
{% for material in activity.materials.split(',')[:5] %}
|
||||
<li>☐ {{ material.strip() }}</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% else %}
|
||||
<p>Materialele nu sunt specificate în documentul sursă.</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Instructions (derived from source text) -->
|
||||
<div class="section">
|
||||
<h3>📝 Instrucțiuni pas cu pas</h3>
|
||||
<div class="instructions">
|
||||
{% if activity.source_text %}
|
||||
{% set instructions = activity.source_text[:800].split('.') %}
|
||||
<ol>
|
||||
{% for instruction in instructions[:5] %}
|
||||
{% if instruction.strip() and instruction.strip()|length > 10 %}
|
||||
<li>{{ instruction.strip() }}{% if not instruction.endswith('.') %}.{% endif %}</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</ol>
|
||||
{% else %}
|
||||
<p><em>Consultați documentul sursă pentru instrucțiuni detaliate.</em></p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Keywords/Tags -->
|
||||
{% if activity.tags and activity.tags != '[]' %}
|
||||
<div class="section">
|
||||
<h3>🏷️ Cuvinte cheie</h3>
|
||||
<div class="tags-container">
|
||||
{% set tags_list = activity.tags | replace('[', '') | replace(']', '') | replace('"', '') | split(',') %}
|
||||
{% for tag in tags_list %}
|
||||
{% if tag.strip() %}
|
||||
<span class="tag">{{ tag.strip() }}</span>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Recommendations -->
|
||||
{% if recommendations %}
|
||||
<div class="section recommendations">
|
||||
<h3>💡 Activități similare recomandate</h3>
|
||||
<div class="recommendations-grid">
|
||||
{% for rec in recommendations %}
|
||||
<div class="recommendation-item">
|
||||
<h4>{{ rec.title }}</h4>
|
||||
<p class="rec-details">
|
||||
{% if rec.age_group %}<span>{{ rec.age_group }}</span>{% endif %}
|
||||
{% if rec.duration %} • <span>{{ rec.duration }}</span>{% endif %}
|
||||
</p>
|
||||
<p class="rec-description">{{ rec.description[:100] }}...</p>
|
||||
<a href="{{ url_for('generate_sheet', activity_id=rec.id) }}"
|
||||
class="rec-link no-print">→ Vezi fișa</a>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Source Info -->
|
||||
<div class="section source-info">
|
||||
<h3>📁 Informații sursă</h3>
|
||||
<div class="source-details">
|
||||
<p><strong>Fișier:</strong> <code>{{ activity.file_path|basename }}</code></p>
|
||||
<p><strong>Tip fișier:</strong> {{ activity.file_type|upper or 'Nedefinit' }}</p>
|
||||
{% if activity.page_number %}
|
||||
<p><strong>Pagina:</strong> {{ activity.page_number }}</p>
|
||||
{% endif %}
|
||||
<p><strong>ID Activitate:</strong> {{ activity.id }}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<div class="sheet-actions no-print">
|
||||
<button onclick="window.print()" class="btn-print">🖨️ Printează</button>
|
||||
<button onclick="copyToClipboard()" class="btn-copy">📋 Copiază</button>
|
||||
<button onclick="window.close()" class="btn-close">❌ Închide</button>
|
||||
<a href="{{ url_for('index') }}" class="btn-back">🏠 Înapoi la căutare</a>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<div class="sheet-footer">
|
||||
<p>
|
||||
<small>
|
||||
Generat automat de <strong>INDEX-SISTEM-JOCURI v1.0</strong> •
|
||||
<span class="current-date"></span> •
|
||||
ID: {{ activity.id }}
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Copy sheet content to clipboard
|
||||
async function copyToClipboard() {
|
||||
try {
|
||||
const title = document.querySelector('.sheet-header h2').textContent;
|
||||
const description = document.querySelector('.description-text').textContent;
|
||||
const materials = document.querySelector('.materials-list').textContent;
|
||||
const participants = document.querySelector('.activity-info-grid .info-item:first-child p').textContent;
|
||||
const duration = document.querySelector('.activity-info-grid .info-item:nth-child(2) p').textContent;
|
||||
|
||||
const content = `
|
||||
FIȘA ACTIVITĂȚII: ${title}
|
||||
|
||||
PARTICIPANȚI: ${participants}
|
||||
DURATA: ${duration}
|
||||
|
||||
DESCRIERE:
|
||||
${description.trim()}
|
||||
|
||||
MATERIALE:
|
||||
${materials.trim()}
|
||||
|
||||
---
|
||||
Generat de INDEX-SISTEM-JOCURI
|
||||
`;
|
||||
|
||||
await navigator.clipboard.writeText(content);
|
||||
alert('✅ Conținutul a fost copiat în clipboard!');
|
||||
} catch (err) {
|
||||
console.error('Error copying to clipboard:', err);
|
||||
alert('❌ Eroare la copierea în clipboard');
|
||||
}
|
||||
}
|
||||
|
||||
// Simple date formatting (since moment.js is not included)
|
||||
function getCurrentDateTime() {
|
||||
const now = new Date();
|
||||
return now.toLocaleDateString('ro-RO') + ' ' + now.toLocaleTimeString('ro-RO', {hour: '2-digit', minute: '2-digit'});
|
||||
}
|
||||
|
||||
// Set current date in all date elements
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const dateElements = document.querySelectorAll('.current-date');
|
||||
dateElements.forEach(el => {
|
||||
el.textContent = getCurrentDateTime();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
216
templates/index.html
Normal file
216
templates/index.html
Normal file
@@ -0,0 +1,216 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ro">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Resurse educaționale - INDEX-SISTEM-JOCURI</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<!-- Header with dropdown filters - exactly matching mockup -->
|
||||
<div class="filters-header">
|
||||
<form method="POST" action="{{ url_for('search') }}" id="searchForm">
|
||||
<div class="filters-row">
|
||||
<!-- Row 1: Valori, Durată, Tematică, Domeniu -->
|
||||
<select name="valori" class="filter-select">
|
||||
<option value="">– Valori –</option>
|
||||
{% for option in filters.get('valori', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="durata" class="filter-select">
|
||||
<option value="">– Durată –</option>
|
||||
{% for option in filters.get('durata', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="tematica" class="filter-select">
|
||||
<option value="">– Tematică –</option>
|
||||
{% for option in filters.get('tematica', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="domeniu" class="filter-select">
|
||||
<option value="">– Domeniu –</option>
|
||||
{% for option in filters.get('domeniu', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="filters-row">
|
||||
<!-- Row 2: Metodă, Materiale necesare, Numărul de participanți -->
|
||||
<select name="metoda" class="filter-select">
|
||||
<option value="">– Metodă –</option>
|
||||
{% for option in filters.get('metoda', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="materiale" class="filter-select">
|
||||
<option value="">– Materiale necesare –</option>
|
||||
{% for option in filters.get('materiale', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="participanti" class="filter-select">
|
||||
<option value="">– Numărul de participanți –</option>
|
||||
{% for option in filters.get('participanti', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="filters-row">
|
||||
<!-- Row 3: Competențe Europene, Competențe Impactate, Vârsta -->
|
||||
<select name="competente_fizice" class="filter-select">
|
||||
<option value="">– Competențe Europene –</option>
|
||||
{% for option in filters.get('competente_fizice', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="competente_impactate" class="filter-select">
|
||||
<option value="">– Competențe Impactate –</option>
|
||||
{% for option in filters.get('competente_impactate', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="varsta" class="filter-select">
|
||||
<option value="">– Vârsta –</option>
|
||||
{% for option in filters.get('varsta', []) %}
|
||||
<option value="{{ option }}">{{ option }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Search box and buttons section -->
|
||||
<div class="search-section">
|
||||
<input type="text" name="search_query" class="search-input"
|
||||
placeholder="cuvinte cheie" value="{{ request.form.get('search_query', '') }}">
|
||||
|
||||
<button type="submit" class="btn-aplica">Aplică</button>
|
||||
<button type="button" class="btn-reseteaza" onclick="resetForm()">Resetează</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Branding section -->
|
||||
<div class="branding">
|
||||
<div class="initiative">
|
||||
<p>Inițiativa:</p>
|
||||
<div class="logo-container">
|
||||
<img src="{{ url_for('static', filename='logo-noi-orizonturi.png') }}"
|
||||
alt="Noi Orizonturi" class="brand-logo"
|
||||
onerror="this.style.display='none'; this.nextElementSibling.style.display='block';">
|
||||
<span class="brand-text" style="display:none;">Noi Orizonturi</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="support">
|
||||
<p>Sprijinită de:</p>
|
||||
<div class="logo-container">
|
||||
<img src="{{ url_for('static', filename='logo-telekom.png') }}"
|
||||
alt="Telekom" class="brand-logo"
|
||||
onerror="this.style.display='none'; this.nextElementSibling.style.display='block';">
|
||||
<span class="brand-text" style="display:none;">Telekom</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Welcome section -->
|
||||
<div class="welcome-section">
|
||||
<h1>Resurse educaționale</h1>
|
||||
<p class="subtitle">
|
||||
Sistemul de indexare și căutare pentru activități educaționale
|
||||
</p>
|
||||
<p class="description">
|
||||
Caută prin colecția de <strong>2000+ activități</strong> din <strong>200+ fișiere</strong>
|
||||
folosind filtrele de mai sus sau introdu cuvinte cheie în caseta de căutare.
|
||||
</p>
|
||||
|
||||
<!-- Statistics -->
|
||||
<div class="stats-container">
|
||||
<div class="stat-item">
|
||||
<span class="stat-number" id="total-activities">-</span>
|
||||
<span class="stat-label">Activități indexate</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-number" id="total-files">-</span>
|
||||
<span class="stat-label">Fișiere procesate</span>
|
||||
</div>
|
||||
<div class="stat-item">
|
||||
<span class="stat-number" id="categories-count">-</span>
|
||||
<span class="stat-label">Categorii disponibile</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Quick start buttons -->
|
||||
<div class="quick-start">
|
||||
<h3>🚀 Start rapid:</h3>
|
||||
<div class="quick-buttons">
|
||||
<button onclick="quickSearch('team building')" class="quick-btn">Team Building</button>
|
||||
<button onclick="quickSearch('jocuri cercetășești')" class="quick-btn">Jocuri Scout</button>
|
||||
<button onclick="quickSearch('8-11 ani')" class="quick-btn">Cubs (8-11 ani)</button>
|
||||
<button onclick="quickSearch('fără materiale')" class="quick-btn">Fără materiale</button>
|
||||
<button onclick="quickSearch('orientare')" class="quick-btn">Orientare</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="footer">
|
||||
<p>
|
||||
🎮 <strong>INDEX-SISTEM-JOCURI v1.0</strong> |
|
||||
Dezvoltat cu Claude AI |
|
||||
<a href="/api/statistics" target="_blank">📊 Statistici</a>
|
||||
</p>
|
||||
<p class="footer-note">
|
||||
Pentru probleme tehnice sau sugestii, contactați administratorul sistemului.
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
// Load statistics on page load
|
||||
async function loadStats() {
|
||||
try {
|
||||
const response = await fetch('/api/statistics');
|
||||
const stats = await response.json();
|
||||
|
||||
document.getElementById('total-activities').textContent = stats.total_activities || '0';
|
||||
document.getElementById('categories-count').textContent = Object.keys(stats.categories || {}).length;
|
||||
|
||||
// Estimate total files from categories
|
||||
const totalFiles = Object.values(stats.file_statistics || [])
|
||||
.reduce((sum, stat) => sum + (stat.files_processed || 0), 0);
|
||||
document.getElementById('total-files').textContent = totalFiles || '0';
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error loading statistics:', error);
|
||||
}
|
||||
}
|
||||
|
||||
function resetForm() {
|
||||
document.getElementById('searchForm').reset();
|
||||
// Also redirect to clear URL parameters
|
||||
window.location.href = '{{ url_for("index") }}';
|
||||
}
|
||||
|
||||
function quickSearch(query) {
|
||||
document.querySelector('input[name="search_query"]').value = query;
|
||||
document.getElementById('searchForm').submit();
|
||||
}
|
||||
|
||||
// Initialize page
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
loadStats();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
283
templates/results.html
Normal file
283
templates/results.html
Normal file
@@ -0,0 +1,283 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ro">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Rezultate căutare - INDEX-SISTEM-JOCURI</title>
|
||||
<link rel="stylesheet" href="{{ url_for('static', filename='style.css') }}">
|
||||
</head>
|
||||
<body>
|
||||
<div class="container">
|
||||
<!-- Header with dropdown filters - same as index page -->
|
||||
<div class="filters-header">
|
||||
<form method="POST" action="{{ url_for('search') }}" id="searchForm">
|
||||
<div class="filters-row">
|
||||
<!-- Row 1: Valori, Durată, Tematică, Domeniu -->
|
||||
<select name="valori" class="filter-select">
|
||||
<option value="">– Valori –</option>
|
||||
{% for option in filters.get('valori', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('valori') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="durata" class="filter-select">
|
||||
<option value="">– Durată –</option>
|
||||
{% for option in filters.get('durata', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('durata') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="tematica" class="filter-select">
|
||||
<option value="">– Tematică –</option>
|
||||
{% for option in filters.get('tematica', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('tematica') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="domeniu" class="filter-select">
|
||||
<option value="">– Domeniu –</option>
|
||||
{% for option in filters.get('domeniu', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('domeniu') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="filters-row">
|
||||
<!-- Row 2: Metodă, Materiale necesare, Numărul de participanți -->
|
||||
<select name="metoda" class="filter-select">
|
||||
<option value="">– Metodă –</option>
|
||||
{% for option in filters.get('metoda', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('metoda') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="materiale" class="filter-select">
|
||||
<option value="">– Materiale necesare –</option>
|
||||
{% for option in filters.get('materiale', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('materiale') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="participanti" class="filter-select">
|
||||
<option value="">– Numărul de participanți –</option>
|
||||
{% for option in filters.get('participanti', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('participanti') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="filters-row">
|
||||
<!-- Row 3: Competențe Europene, Competențe Impactate, Vârsta -->
|
||||
<select name="competente_fizice" class="filter-select">
|
||||
<option value="">– Competențe Europene –</option>
|
||||
{% for option in filters.get('competente_fizice', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('competente_fizice') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="competente_impactate" class="filter-select">
|
||||
<option value="">– Competențe Impactate –</option>
|
||||
{% for option in filters.get('competente_impactate', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('competente_impactate') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
|
||||
<select name="varsta" class="filter-select">
|
||||
<option value="">– Vârsta –</option>
|
||||
{% for option in filters.get('varsta', []) %}
|
||||
<option value="{{ option }}" {% if applied_filters.get('varsta') == option %}selected{% endif %}>
|
||||
{{ option }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<!-- Search box and buttons section -->
|
||||
<div class="search-section">
|
||||
<input type="text" name="search_query" class="search-input"
|
||||
placeholder="cuvinte cheie" value="{{ search_query }}">
|
||||
|
||||
<button type="submit" class="btn-aplica">Aplică</button>
|
||||
<button type="button" class="btn-reseteaza" onclick="resetForm()">Resetează</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<!-- Results section -->
|
||||
<div class="results-section">
|
||||
<div class="results-header">
|
||||
<h2>Resurse educaționale</h2>
|
||||
{% if search_query or applied_filters %}
|
||||
<div class="search-summary">
|
||||
{% if search_query %}
|
||||
<p><strong>Căutare:</strong> "{{ search_query }}"</p>
|
||||
{% endif %}
|
||||
{% if applied_filters %}
|
||||
<p><strong>Filtre aplicate:</strong>
|
||||
{% for key, value in applied_filters.items() %}
|
||||
{{ key.replace('_', ' ').title() }}: {{ value }}{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p class="results-count">
|
||||
<strong>{{ results_count }} rezultate găsite</strong>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
{% if activities %}
|
||||
<!-- Results table matching mockup -->
|
||||
<div class="results-table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>TITLU</th>
|
||||
<th>DETALII</th>
|
||||
<th>METODĂ</th>
|
||||
<th>TEMĂ</th>
|
||||
<th>VALORI</th>
|
||||
<th>ACȚIUNI</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for activity in activities %}
|
||||
<tr>
|
||||
<td class="title-cell">
|
||||
<strong>{{ activity.title }}</strong>
|
||||
{% if activity.duration %}
|
||||
<div class="duration">{{ activity.duration }}</div>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="details-cell">
|
||||
{% if activity.materials %}
|
||||
<p><strong>Materiale utilizare:</strong> {{ activity.materials }}</p>
|
||||
{% endif %}
|
||||
{% if activity.duration %}
|
||||
<p><strong>Durata activității:</strong> {{ activity.duration }}</p>
|
||||
{% endif %}
|
||||
{% if activity.participants %}
|
||||
<p><strong>Participanți:</strong> {{ activity.participants }}</p>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="method-cell">
|
||||
{{ activity.category or 'Nedefinit' }}
|
||||
</td>
|
||||
<td class="theme-cell">
|
||||
{% if activity.tags %}
|
||||
{% for tag in activity.tags[:2] %}
|
||||
{{ tag.title() }}{% if not loop.last %}, {% endif %}
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
{{ activity.age_group or 'General' }}
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="values-cell">
|
||||
{% if activity.tags and activity.tags|length > 2 %}
|
||||
{{ activity.tags[2:4]|join(', ') }}
|
||||
{% else %}
|
||||
Educație și dezvoltare
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="actions-cell">
|
||||
<a href="{{ url_for('generate_sheet', activity_id=activity.id) }}"
|
||||
class="btn-generate" target="_blank">
|
||||
📄 Generează fișă
|
||||
</a>
|
||||
{% if activity.file_path %}
|
||||
<a href="{{ url_for('view_file', filename=activity.file_path.replace('/mnt/d/GoogleDrive/Cercetasi/carti-camp-jocuri/', '')) }}"
|
||||
class="btn-source" target="_blank">
|
||||
📁 Vezi sursa
|
||||
</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% else %}
|
||||
<!-- No results found -->
|
||||
<div class="no-results">
|
||||
<h3>🔍 Nu au fost găsite rezultate</h3>
|
||||
<p>Încercați să:</p>
|
||||
<ul>
|
||||
<li>Modificați criteriile de căutare</li>
|
||||
<li>Eliminați unele filtre</li>
|
||||
<li>Folosiți cuvinte cheie mai generale</li>
|
||||
<li>Verificați ortografia</li>
|
||||
</ul>
|
||||
<div class="suggestions">
|
||||
<h4>Sugestii populare:</h4>
|
||||
<div class="suggestion-buttons">
|
||||
<button onclick="quickSearch('team building')" class="quick-btn">Team Building</button>
|
||||
<button onclick="quickSearch('jocuri')" class="quick-btn">Jocuri</button>
|
||||
<button onclick="quickSearch('copii')" class="quick-btn">Activități copii</button>
|
||||
<button onclick="quickSearch('grup')" class="quick-btn">Activități grup</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Back to search -->
|
||||
<div class="back-section">
|
||||
<a href="{{ url_for('index') }}" class="btn-back">
|
||||
← Înapoi la căutare
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<!-- Footer -->
|
||||
<footer class="footer">
|
||||
<p>
|
||||
🎮 <strong>INDEX-SISTEM-JOCURI v1.0</strong> |
|
||||
Rezultate pentru {{ results_count }} activități |
|
||||
<a href="/api/statistics" target="_blank">📊 Statistici</a>
|
||||
</p>
|
||||
</footer>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function resetForm() {
|
||||
// Clear all form fields
|
||||
document.getElementById('searchForm').reset();
|
||||
// Submit to get fresh results
|
||||
document.getElementById('searchForm').submit();
|
||||
}
|
||||
|
||||
function quickSearch(query) {
|
||||
document.querySelector('input[name="search_query"]').value = query;
|
||||
document.getElementById('searchForm').submit();
|
||||
}
|
||||
|
||||
// Auto-submit form when filters change
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const selects = document.querySelectorAll('.filter-select');
|
||||
selects.forEach(select => {
|
||||
select.addEventListener('change', function() {
|
||||
// Optional: auto-submit on filter change
|
||||
// document.getElementById('searchForm').submit();
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user