{% extends "freeform/resources/_layout" %}

{% set title = "Explore"|t("freeform") %}
{% set crumbs = [
    { label: craft.freeform.name, url: url("freeform") },
    { label: "Resources"|t("freeform"), url: url("freeform/resources") },
] %}

{% block content %}

    <p>
        {{ "Check out Solspace's other offerings and explore more options below to go beyond Freeform or extend the functionality of it by using the documented Developer Events."|t("freeform") }}
    </p>

    {% set items = [
        {
            icon: icons.freeform,
            class: isPro ? "active" : "inactive",
            title: "Pro Edition",
            description: [
                "Get more out of Freeform with the Pro edition! Switch to Pro and get access to more Field Types, more Exporting options, Conditional Rules, mapping to Craft Elements, dashboard widgets, popular CRM and mailing list API integrations and much more!",
            ],
            footer: isPro ? '<span><span class="active-icon"></span> Installed</span>' : '<a href="https://docs.solspace.com/craft/freeform/v3/" class="btn submit large"><span class="upgrade-icon"></span>Get it</a>',
            features: [],
        },
        {
            icon: icons.calendar,
            title: "Calendar",
            class: "inactive",
            description: [
                "Calendar is the most reliable and powerful event management and calendaring plugin for Craft. Its intuitive interface allows you to create events with complex recurring event rules and exclusions, while the flexible templating offers a variety of options to satisfy your calendaring needs!",
            ],
            footer: '<a href="https://docs.solspace.com/craft/calendar" class="btn submit large icon search">Explore</a>',
            features: [],
        },
        {
            icon: icons.express,
            title: "Express Forms",
            class: "inactive",
            description: [
                "Express Forms is an intuitive and lightweight form builder plugin that gets the job done but doesn’t get in your way. It's great for building simple forms or for developers that enjoy the control of handling their own templating and custom features. It was developed with a 'developer first' mentality, so it’s highly extendable.",
            ],
            footer: '<a href="http://craft.express/forms" class="btn submit large icon search">Explore</a>',
            features: [],
        },
        {
            icon: icons.develop,
            title: "Developer-friendly",
            class: "inactive",
            description: [
                "Freeform is quite extendable. If you want more out of Freeform, we've done our best to make it as easily extendable as possible for you! Check out the Developer documentation to learn more!",
            ],
            footer: '<a href="https://docs.solspace.com/redirect/freeform/developer" class="btn submit large icon search">Explore</a>',
            features: [],
        }
    ] %}

    <ul class="cards">
        {% for item in items %}
            <li class="{{ item.class }}">
                <div class="explore-card">
                    <div class="icon">
                        {{ item.icon|raw }}
                    </div>
                    <h1>{{ item.title|t("freeform") }}</h1>
                    {% if item.description is iterable %}
                        {% for description in item.description %}
                            <p>
                                {{ description|t("freeform") }}
                            </p>
                        {% endfor %}
                    {% else %}
                        <p>
                            {{ item.description|t("freeform") }}
                        </p>
                    {% endif %}

                    <ul>
                        {% for feature in item.features %}
                            <li>
                                <h4>{{ feature.title|t("freeform") }}</h4>
                                {%- if feature.description is defined %}
                                    {{ feature.description|t("freeform") }}
                                {% endif -%}
                            </li>
                        {% endfor %}
                    </ul>
                </div>

                <div class="card-footer centered">
                    {{ item.footer|raw }}
                </div>
            </li>

        {% endfor %}
    </ul>

{% endblock %}
