{$max_count_themes = 5} {if !empty($app_themes)} {$count_app_themes = $app_themes|count} {$_themes_url = []} {if !empty($routes)} {foreach $routes as $r} {$r.theme = $r.theme|default:'default'} {$r.theme_mobile = $r.theme_mobile|default:'default'} {* because rtrim removes repetitions *} {if $r.url && $r.url|substr:-1 == "*"} {$r.url = $r.url|substr:0:-1} {/if} {if isset($app_themes[$r.theme])} {$_themes_url[$r.theme] = '//'|cat:waIdna::dec($r._domain)|cat:'/'|cat:$r.url} {/if} {if isset($app_themes[$r.theme_mobile]) && $r.theme != $r.theme_mobile} {$_themes_url[$r.theme_mobile] = '//'|cat:waIdna::dec($r._domain)|cat:'/'|cat:$r.url} {/if} {/foreach} {/if}

[`Installed`]

{foreach $app_themes as $_theme} {$_name = $_theme->getName()} {$_cover_image = $_theme->getCover()} {if empty($_cover_image)} {$_cover_image = "`$wa_url`wa-content/img/design/themes/no-image.png"} {/if} {$_theme_id = $_theme->id} {$_theme_url = "`$design_url`theme=`$_theme_id`&domain={$domain|urlencode}"} {if !empty($used_domain_themes[$_theme_id])} {$_theme_url = "`$_theme_url`&route=`$used_domain_themes[$_theme_id]`"} {/if}
{if empty($_themes_url[$_theme_id])} {$_name|escape} {else} {$_name|escape} {/if}
{if isset($used_app_themes[$_theme_id])} {if isset($used_domain_themes[$_theme_id])} [`Used`] {else} [`Used on other sites.`] {/if} {else} [`Not used`] {/if}
{/foreach}
{if $count_app_themes > $max_count_themes} {/if}
{* Dialogs *}

[s`Upload theme`]

[s`Theme must be uploaded as a valid Webasyst design theme archive (.tar.gz archive with theme files and theme.xml manifest file).`]

{$wa->csrf()}
{elseif isset($app_themes)}

[`Installed`]

[`No installed themes.`]
{/if}