{% extends "base.html" %} {% from "_form_helpers.html" import render_field %} {% block extra_head %} {# Assuming base.html has an 'extra_head' block for additional head elements #} {% endblock %} {% block content %} {# Main page content for searching and importing packages #}
{# Flash messages area - Ensure _flash_messages.html exists and is included in base.html or rendered here #} {% include "_flash_messages.html" %} {# Display warning if package fetching failed on initial load #} {% if fetch_failed %}
Unable to fetch packages from registries. Showing a fallback list. Please try again later or contact support.
{% endif %}
{# Left Column: Search Packages Area #}
{# Header with Refresh Button #}

Search Packages

{# Cache Status Timestamp #}
{% if last_cached_timestamp %} Package list last fetched: {{ last_cached_timestamp.strftime('%Y-%m-%d %H:%M:%S %Z') if last_cached_timestamp else 'Never' }} {% if fetch_failed %} (Fetch Failed){% endif %} {% elif is_fetching %} {# Show text spinner specifically during initial fetch state triggered by backend #} Fetching package list... {% else %} Never fetched or cache cleared. {% endif %}
{# Search Input with HTMX #}
{# Search Results Area (populated by HTMX) #}
{% include '_search_results_table.html' %} {# Includes the initial table state or updated results #}
{# Right Column: Import Form, Log Window, Animation, Warning #}
{# Import Form #}

Import a New IG

{# Form ID used by JS #} {{ form.hidden_tag() }} {# Include CSRF token if using Flask-WTF #} {{ render_field(form.package_name, class="form-control") }} {{ render_field(form.package_version, class="form-control") }} {{ render_field(form.dependency_mode, class="form-select") }}
{# Import Button triggers HTMX POST #} Back {# Simple link back #}
{# Live Log Output Window #}
Live Log Output

Logs from caching or import actions will appear here.

{# Indicator shown while connecting to SSE #}
{# Animation Window (Hidden by default) #} {# Warning Text (Hidden by default) #}
{# End card-body #}
{# End card #}
{# End col-md-3 #}
{# End row #}
{# End container #} {% endblock %}