web/templates/ArtworkList.php
Mike Colagrosso af956b2714
Replace EbookUrl with EbookId in Artworks (#482)
* Replace `EbookUrl` with `EbookId` in `Artworks`

* Add a `FullUrl` member to `Ebook`

Add documentation about when to use it versus Url.

The full URL is also being used as an ID in RSS feeds, so use `FullUrl` there.

* Store an `EbookId` in `Artworks`
2025-03-10 14:33:20 -05:00

36 lines
770 B
PHP

<?
/**
* @var array<Artwork> $artworks
*/
?>
<ol class="artwork-list">
<? foreach($artworks as $artwork){ ?>
<?
$class = '';
if($artwork->EbookId !== null){
$class .= ' in-use';
}
switch($artwork->Status){
case Enums\ArtworkStatusType::Unverified:
$class .= ' unverified';
break;
case Enums\ArtworkStatusType::Declined:
$class .= ' declined';
break;
}
$class = trim($class);
?>
<li<? if($class != ''){ ?> class="<?= $class ?>"<? } ?>>
<a href="<?= $artwork->Url ?>">
<picture>
<source srcset="<?= $artwork->Thumb2xUrl ?> 2x, <?= $artwork->ThumbUrl ?> 1x" type="image/jpg"/>
<img src="<?= $artwork->ThumbUrl ?>" alt="" property="schema:image"/>
</picture>
</a>
</li>
<? } ?>
</ol>