<?php
use App\CGUtils;
use App\CoreUtils;
use App\Models\User;
use App\DeviantArt;
use App\Permission;
use App\Users;
use App\Appearances;
use App\ColorGroups;
use App\Tags;
/** @var $Appearance array */
/** @var $heading string */ ?>
<div id="content">
	<div class="sprite-wrap"><?=Appearances::getSpriteHTML($Appearance)?></div>
	<h1><?=CoreUtils::escapeHTML($heading)?></h1>
	<p>from the MLP-VectorClub <a href="/cg"><?=$Color?> Guide</a></p>

<?  if (Permission::sufficient('staff')){ ?>
	<div class="notice warn align-center appearance-private-notice"<?=!empty($Appearance['private'])?'':' style="display:none"'?>><p><span class="typcn typcn-lock-closed"></span> <strong>This appearance is currently private (its colors are only visible to staff members)</strong></p></div>
<?php
	}

	$RenderPath = FSPATH."cg_render/{$Appearance['id']}.png";
	$FileModTime = '?t='.(file_exists($RenderPath) ? filemtime($RenderPath) : time()); ?>
	<div id="p<?=$Appearance['id']?>">
		<div class='align-center'>
			<a class='darkblue btn typcn typcn-image' href='/cg/v/<?="{$Appearance['id']}.png$FileModTime"?>' target='_blank'>View as PNG</a>
			<button class='getswatch typcn typcn-brush teal'>Download swatch file</button>
<?  if (Permission::sufficient('staff')){ ?>
			<button class='blue edit typcn typcn-pencil'>Edit metadata</button>
<?php   if ($Appearance['id']){ ?>