{% load i18n %}
{% if show_quick_full_sync_banner %}
<div class="row mb-2 noprint">
    <div class="col-12">
        <div class="alert alert-info py-2 px-3 mb-2" role="status">
            <div class="d-flex flex-column flex-md-row flex-md-wrap align-items-start gap-2">
                <strong class="text-nowrap">{% trans "No recurring full sync scheduled" %}</strong>
                <span class="small flex-grow-1">
                    {% blocktrans trimmed %}
                    No active recurring Proxbox Sync job (among jobs you can view) uses sync type <strong>All</strong>.
                    {% endblocktrans %}
                </span>
                <span class="small text-nowrap">
                    <a href="{% url 'core:job_list' %}" class="alert-link">{% trans "View jobs" %}</a>
                    <span class="text-muted">&middot;</span>
                    <a href="{% url 'plugins:netbox_proxbox:schedule_sync' %}" class="alert-link">{% trans "Open schedule form" %}</a>
                </span>
            </div>
        </div>

        {% if can_quick_schedule_sync and quick_schedule_form %}
        <div class="card border-primary mb-0 nb-proxbox-quick-card shadow-sm">
            <button
                type="button"
                class="card-header py-2 px-3 bg-body-secondary w-100 border-0 text-body text-start d-flex flex-wrap align-items-center justify-content-between gap-2 quick-schedule-collapse-toggle {% if not quick_schedule_form.is_bound %}collapsed{% endif %}"
                data-bs-toggle="collapse"
                data-bs-target="#proxboxQuickScheduleBody"
                aria-expanded="{% if quick_schedule_form.is_bound %}true{% else %}false{% endif %}"
                aria-controls="proxboxQuickScheduleBody"
            >
                <span class="d-inline-flex align-items-center gap-1 fw-semibold">
                    <i class="mdi mdi-chevron-down" aria-hidden="true"></i>
                    {% trans "Quick schedule: Proxbox Sync" %}
                </span>
                <span class="small text-muted text-md-end ms-md-auto">
                    {% trans "Defaults:" %}
                    {% trans "All" %} · {% trans "1 day" %} · {% trans "03:00 local" %}
                </span>
            </button>
            <div
                id="proxboxQuickScheduleBody"
                class="collapse {% if quick_schedule_form.is_bound %}show{% endif %}"
            >
                <div class="card-body py-2 px-3">
                    <form method="post" action="{% url 'plugins:netbox_proxbox:schedule_sync_quick' %}" class="mb-0">
                        {% csrf_token %}
                        {% include "netbox_proxbox/inc/schedule_sync_form_fields_quick.html" with form=quick_schedule_form %}
                        <div class="d-flex flex-wrap align-items-center gap-2 mt-2 pt-2 border-top">
                            <button type="submit" class="btn btn-primary btn-sm">
                                <i class="mdi mdi-clock-plus-outline" aria-hidden="true"></i>
                                {% trans "Schedule" %}
                            </button>
                            <span class="small text-muted">{% trans "Change options above, then submit." %}</span>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        {% elif not can_quick_schedule_sync %}
        <div class="alert alert-secondary py-2 px-3 mb-0" role="note">
            <span class="small">
                {% blocktrans trimmed %}
                You do not have permission to queue sync jobs from here. An administrator can schedule a recurring job or grant you permission to add sync operations.
                {% endblocktrans %}
            </span>
        </div>
        {% endif %}
    </div>
</div>
{% endif %}
