{% extends 'base.html' %}

{% block content %}
<div class="container mt-4">
    <h2>Vulnerability Search</h2>
    <form method="post">
        {% csrf_token %}
        {{ form.as_p }}
        <button type="submit" class="btn btn-primary">Search</button>
    </form>

    {% if results %}
    <hr>
    <h3>Search Results</h3>
    <div class="list-group">
        {% for result in results %}
        <div class="list-group-item">
            <h5 class="mb-1">{{ result.cve_id }}</h5>
            <p class="mb-1">{{ result.description }}</p>
        </div>
        {% endfor %}
    </div>
    {% endif %}
</div>
{% endblock %}
