wyszukiwanie i dodawanie sugestii oraz poprawki

This commit is contained in:
Mateusz Gruszczyński
2025-08-17 22:56:25 +02:00
parent 268f8d2e85
commit dd65230636
4 changed files with 81 additions and 2 deletions

View File

@@ -7,6 +7,32 @@
<a href="{{ url_for('admin_panel') }}" class="btn btn-outline-secondary">← Powrót do panelu</a>
</div>
<div class="card bg-dark text-white mb-4">
<div class="card-body">
<!-- Formularz dodawania sugestii -->
<form action="{{ url_for('add_suggestion') }}" method="POST" class="mb-4">
<label class="form-label fw-bold mb-2"> Dodaj nową sugestię:</label>
<div class="input-group">
<input type="text" name="suggestion_name" class="form-control bg-dark text-white border-secondary"
placeholder="Nowa sugestia produktu…" required>
<button type="submit" class="btn btn-outline-light"> Dodaj</button>
</div>
</form>
<hr class="border-secondary opacity-50 mb-4 mt-2">
<!-- Szukajka z przyciskiem wyczyść -->
<label for="search-table" class="form-label fw-bold mb-2">🔍 Przeszukaj tabelę produktów i sugestii:</label>
<div class="input-group">
<input type="text" id="search-table" class="form-control bg-dark text-white border-secondary"
placeholder="Wpisz frazę, np. 'mleko'">
<button type="button" id="clear-search" class="btn btn-outline-light">🧹 Wyczyść</button>
</div>
</div>
</div>
<div class="card bg-dark text-white mb-5">
<div class="card-body">
<div class="card-header d-flex justify-content-between align-items-center">
@@ -96,7 +122,9 @@
{% endfor %}
{% if orphan_suggestions|length == 0 %}
<tr>
<td colspan="3" class="text-center">Brak sugestii do wyświetlenia.</td>
<td colspan="12" class="text-center py-4">
Brak niepowiązanych sugestii do wyświetlenia
</td>
</tr>
{% endif %}
</tbody>
@@ -135,6 +163,7 @@
{% block scripts %}
<script src="{{ url_for('static_bp.serve_js', filename='product_suggestion.js') }}"></script>
<script src="{{ url_for('static_bp.serve_js', filename='table_search.js') }}"></script>
{% endblock %}
{% endblock %}