{% extends ajax-suffix ? "@gantry-admin/partials/ajax.html.twig" : "@gantry-admin/partials/base.html.twig" %}

{% set settings_url = gantry.platform.settings %}
{% set settings_key = gantry.platform.settings_key %}

{% block content %}
    <div id="g5-container" class="g-container">
        <div class="inner-container">
            <div class="g-grid">
                <div class="g-block main-block">
                    <section id="main">
                        <div data-g5-content="">
                            {% block gantry %}
                                <div class="g-content" data-g5-content="">
                                    <div class="g-grid overview-header">
                                        <div class="g-block">
                                            <h2 class="theme-title"><i class="fa fa-fw fa-plug"></i> {{ 'GANTRY5_PLATFORM_AVAILABLE_THEMES'|trans }}</h2>
                                        </div>
                                    {% if settings_url %}
                                        <div class="g-block">
                                            <a class="button button-primary float-right" href="{{ settings_url|e }}" data-settings-key="{{ settings_key|e }}"><i class="fa fa-cog"></i> {{ 'GANTRY5_PLATFORM_PLATFORM_SETTINGS'|trans }}</a>
                                        </div>
                                    {% endif %}
                                    </div>
                                    <div class="themes cards-wrapper g-grid fixed-blocks">
                                        {% if themes|length %}
                                        {% for id, theme in themes %}
                                            <div class="theme card">
                                                <div class="theme-id">
                                                    {% if theme.details.icon %}<i class="fa fa-fw fa-{{ theme.details.icon|e }}"></i>{% endif %}
                                                    {{ theme.title|e }} <span class="theme-info">(v{{ gantry.theme.version }} / {{ theme.name|e }})</span>
                                                </div>
                                                <div class="theme-screenshot">
                                                    <a href="{{ theme.admin_url|e }}">
                                                        <img src="{{ url(theme.thumbnail)|default('http://www.placehold.it/206x150/f4f4f4')|e }}" />
                                                    </a>
                                                </div>
                                                <div class="theme-name">
                                                    {% if theme.preview_url %}
                                                    <a class="button" href="{{ theme.preview_url|e }}">Preview</a>
                                                    {% endif %}
                                                    <a class="button button-primary" href="{{ theme.admin_url|e }}">Configure</a>
                                                </div>
                                            </div>
                                        {% endfor %}
                                        {% else %}
                                            <p>No themes installed.</p>
                                        {% endif %}
                                    </div>
                                </div>
                            {% endblock %}
                        </div>
                    </section>
                </div>
            </div>
        </div>
    </div>
{% endblock %}

{% block footer_section %}
{% endblock %}
