Complete v2.0 transformation: Production-ready Flask application
Major Changes: - Migrated from prototype to production architecture - Implemented modular Flask app with models/services/web layers - Added Docker containerization with docker-compose - Switched to Pipenv for dependency management - Built advanced parser extracting 63 real activities from INDEX_MASTER - Implemented SQLite FTS5 full-text search - Created minimalist, responsive web interface - Added comprehensive documentation and deployment guides Technical Improvements: - Clean separation of concerns (models, services, web) - Enhanced database schema with FTS5 indexing - Dynamic filters populated from real data - Production-ready configuration management - Security best practices implementation - Health monitoring and API endpoints Removed Legacy Files: - Old src/ directory structure - Static requirements.txt (replaced by Pipfile) - Test and debug files - Temporary cache files Current Status: - 63 activities indexed across 8 categories - Full-text search operational - Docker deployment ready - Production documentation complete 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
153
app/templates/index.html
Normal file
153
app/templates/index.html
Normal file
@@ -0,0 +1,153 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Căutare Activități - INDEX Sistem Jocuri{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<div class="search-page">
|
||||
<div class="search-header">
|
||||
<h2 class="search-title">Căutare Activități Educaționale</h2>
|
||||
<p class="search-subtitle">
|
||||
Descoperă activități pentru copii și tineri din catalogul nostru de
|
||||
{% if stats and stats.total_activities %}{{ stats.total_activities }}{% else %}500+{% endif %}
|
||||
jocuri și exerciții.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<form method="POST" action="{{ url_for('main.search') }}" class="search-form">
|
||||
<!-- Main search input -->
|
||||
<div class="search-input-group">
|
||||
<input
|
||||
type="text"
|
||||
name="search_query"
|
||||
id="search_query"
|
||||
class="search-input"
|
||||
placeholder="Caută activități după nume, descriere sau cuvinte cheie..."
|
||||
autocomplete="off"
|
||||
>
|
||||
<button type="submit" class="search-button">Căutare</button>
|
||||
</div>
|
||||
|
||||
<!-- Dynamic filters -->
|
||||
<div class="filters-grid">
|
||||
{% if filters %}
|
||||
{% if filters.category %}
|
||||
<div class="filter-group">
|
||||
<label for="category" class="filter-label">Categorie</label>
|
||||
<select name="category" id="category" class="filter-select">
|
||||
<option value="">Toate categoriile</option>
|
||||
{% for category in filters.category %}
|
||||
<option value="{{ category }}">{{ category }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if filters.age_group %}
|
||||
<div class="filter-group">
|
||||
<label for="age_group" class="filter-label">Grupa de vârstă</label>
|
||||
<select name="age_group" id="age_group" class="filter-select">
|
||||
<option value="">Toate vârstele</option>
|
||||
{% for age_group in filters.age_group %}
|
||||
<option value="{{ age_group }}">{{ age_group }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if filters.participants %}
|
||||
<div class="filter-group">
|
||||
<label for="participants" class="filter-label">Participanți</label>
|
||||
<select name="participants" id="participants" class="filter-select">
|
||||
<option value="">Orice număr</option>
|
||||
{% for participants in filters.participants %}
|
||||
<option value="{{ participants }}">{{ participants }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if filters.duration %}
|
||||
<div class="filter-group">
|
||||
<label for="duration" class="filter-label">Durata</label>
|
||||
<select name="duration" id="duration" class="filter-select">
|
||||
<option value="">Orice durată</option>
|
||||
{% for duration in filters.duration %}
|
||||
<option value="{{ duration }}">{{ duration }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if filters.materials %}
|
||||
<div class="filter-group">
|
||||
<label for="materials" class="filter-label">Materiale</label>
|
||||
<select name="materials" id="materials" class="filter-select">
|
||||
<option value="">Orice materiale</option>
|
||||
{% for materials in filters.materials %}
|
||||
<option value="{{ materials }}">{{ materials }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if filters.difficulty %}
|
||||
<div class="filter-group">
|
||||
<label for="difficulty" class="filter-label">Dificultate</label>
|
||||
<select name="difficulty" id="difficulty" class="filter-select">
|
||||
<option value="">Orice nivel</option>
|
||||
{% for difficulty in filters.difficulty %}
|
||||
<option value="{{ difficulty }}">{{ difficulty }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<!-- Action buttons -->
|
||||
<div class="search-actions">
|
||||
<button type="submit" class="btn btn-primary">Aplică filtrele</button>
|
||||
<button type="button" class="btn btn-secondary" onclick="clearFilters()">Resetează</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- Quick stats -->
|
||||
{% if stats and stats.categories %}
|
||||
<div class="quick-stats">
|
||||
<h3 class="stats-title">Categorii disponibile</h3>
|
||||
<div class="stats-grid">
|
||||
{% for category, count in stats.categories.items() %}
|
||||
<div class="stat-item">
|
||||
<span class="stat-label">{{ category }}</span>
|
||||
<span class="stat-value">{{ count }}</span>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}
|
||||
<script>
|
||||
function clearFilters() {
|
||||
// Reset all form fields
|
||||
document.getElementById('search_query').value = '';
|
||||
|
||||
const selects = document.querySelectorAll('.filter-select');
|
||||
selects.forEach(select => select.selectedIndex = 0);
|
||||
}
|
||||
|
||||
// Auto-submit on filter change for better UX
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const filterSelects = document.querySelectorAll('.filter-select');
|
||||
filterSelects.forEach(select => {
|
||||
select.addEventListener('change', function() {
|
||||
if (this.value) {
|
||||
document.querySelector('.search-form').submit();
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user