{% if installing %}
{% include 'partials/release-toggle.html.twig' %}
{% endif %}
{% include 'partials/list-sort.html.twig' with { list_view: 'themes' } %}
{% for slug, theme in admin.themes(not installing).toArray|ksort %}
{% set state = 'inactive' %}
{% if (installing) %}{% set state = 'installing' %}{% endif %}
{% if (config.get('system.pages.theme') == slug) %}{% set state = 'active' %}{% endif %}
{% set isTestingRelease = admin.gpm.isTestingRelease(slug) %}
{% set isPremium = admin.isPremiumProduct(theme) %}
{% set releaseDate = theme.date ?: admin.gpm.findPackage(slug, true).date %}
{{ theme.name }}
{% if admin.isTeamGrav(theme) %}
{% endif %}
{% if isPremium %}
{% if not gumroad_loaded %}
{% set gumroad_loaded = true %}
{% endif %}
{{ "PLUGIN_ADMIN.PREMIUM_PRODUCT"|t }}
{% endif %}
{% if theme.symlink %}
{% endif %}
v{{ theme.version }}
{% if isTestingRelease %}test release{% endif %}
{% set compat = theme.compatibility.grav ?? ['1.7'] %}
{% if '1.7' in compat %}1.7{% endif %}
{% if '1.8' in compat %}1.8{% endif %}
{% set thumb = installing ? '//getgrav.org/images/' ~ theme.screenshot : theme.thumbnail %}
{% if (state == 'installing') %}
{% if (theme.premium and not admin.license(theme.slug)) %}
{% set permalink = theme.premium.permalink|default(null) %}
{% if permalink %}
{% set checkout_url = 'https://licensing.getgrav.org/buy/' ~ permalink %}
{% set success_url = 'https://licensing.getgrav.org/portal?checkout=success&checkout_id={CHECKOUT_ID}' %}
{% set final_checkout_url = checkout_url ~ '?success_url=' ~ success_url|url_encode %}
{{ theme.premium.button|default('Purchase') }}
{% endif %}
{% else %}
{{ "PLUGIN_ADMIN.INSTALL"|t }}
{% endif %}
{% include 'partials/modal-switch-theme.html.twig' %}
{% include 'partials/modal-add-package.html.twig' with { type: 'theme' } %}
{% include 'partials/modal-update-packages.html.twig' with { type: 'theme' } %}