{% extends "frontend/base.html" %}
{% load i18n static %}
{% block html_title %}
    {% block page_title %}
        {% translate "Services" %}
    {% endblock page_title %}
{% endblock html_title %}
{% block content %}
    <section class="section">
        <div class="card">
            <div class="card-content">
                <div class="card-body">
                    <form class="search-form" auto-submit>
                        {{ filter_form }}
                    </form>
                </div>
            </div>
        </div>
        <div class="row match-height card-grid service-cards-container {% if not deactivated_services %}mb-5{% endif %}">
            {% for service in services %}
                <div class="col-12 col-md-6 col-lg-3">{% include "includes/service_card.html" %}</div>
            {% empty %}
                <div class="col-12">
                    <div class="card">
                        <div class="card-body">
                            <div class="card-content">
                                <p>{% translate "No services found." %}</p>
                            </div>
                        </div>
                    </div>
                </div>
            {% endfor %}
        </div>
        {% if deactivated_services %}
            <div class="card">
                <div class="card-body">
                    <h5 class="card-title">{% translate "You may also be interested in one of these …" %}</h5>
                    <p class="text-muted">
                        <i class="bi bi-info-circle mt-1"></i>
                        {% translate "These services need to be enabled first before they become available in the Servala portal." %}
                    </p>
                </div>
            </div>
            <div class="row match-height card-grid service-cards-container mb-5">
                {% for service in deactivated_services %}
                    <div class="col-12 col-md-6 col-lg-3 service-deactivated">{% include "includes/service_card.html" %}</div>
                {% endfor %}
            </div>
        {% endif %}
    </section>
    <script src="{% static "js/autosubmit.js" %}" defer></script>
{% endblock content %}
