- Add case-insensitive search across all fields (inhalt, titel, geltungsbereich) - Include Vorgabe.titel field in search scope for better coverage - Implement comprehensive input validation against SQL injection and XSS - Add German error messages for validation failures - Escape search terms in templates to prevent XSS attacks - Add input length limits and character validation - Preserve user input on validation errors for better UX
29 lines
806 B
HTML
29 lines
806 B
HTML
{% extends "base.html" %}
|
|
{% block content %}
|
|
<h1 class="mb-4">Suche</h1>
|
|
|
|
{% if error_message %}
|
|
<div class="alert alert-danger">
|
|
<strong>Fehler:</strong> {{ error_message }}
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Search form -->
|
|
<form action="." method="post">
|
|
{% csrf_token %}
|
|
<!-- Search field -->
|
|
<div class="mb-3">
|
|
<label for="query" class="form-label">Suchbegriff</label>
|
|
<input type="text"
|
|
class="form-control"
|
|
id="query"
|
|
name="q"
|
|
placeholder="Suchbegriff eingeben …"
|
|
value="{{ search_term|default:'' }}"
|
|
required
|
|
maxlength="200">
|
|
</div>
|
|
<button type="submit" class="btn btn-primary">Suchen</button>
|
|
</form>
|
|
{% endblock %}
|