HummingBirdAnimeClient/app/templates/anime-cover.php

100 lines
3.3 KiB
PHP
Raw Permalink Normal View History

<article
class="media"
2020-08-26 17:26:42 -04:00
data-kitsu-id="<?= $item['id'] ?>"
data-anilist-id="<?= $item['anilist_id'] ?>"
2020-08-26 17:26:42 -04:00
data-mal-id="<?= $item['mal_id'] ?>"
>
<?php if ($_->isAuthenticated()): ?>
<button title="Increment episode count" class="plus-one" hidden>+1 Episode</button>
<?php endif ?>
<?= $_->h->img($item['anime']['cover_image'], ['width' => 220, 'loading' => 'lazy']) ?>
<div class="name">
<a href="<?= $_->urlFromRoute('anime.details', ['id' => $item['anime']['slug']]) ?>">
<span class="canonical"><?= $item['anime']['title'] ?></span>
<?php foreach ($item['anime']['titles'] as $title): ?>
<br/>
<small><?= $title ?></small>
<?php endforeach ?>
</a>
</div>
<div class="table">
2021-02-03 09:45:18 -05:00
<?php if (isset($item['private']) || isset($item['rewatching'])): ?>
<div class="row">
<?php foreach (['private', 'rewatching'] as $attr): ?>
<?php if ($item[$attr]): ?>
<span class="item-<?= $attr ?>"><?= ucfirst($attr) ?></span>
<?php endif ?>
<?php endforeach ?>
</div>
<?php endif ?>
<?php if ($item['rewatched'] > 0): ?>
<div class="row">
2020-05-04 16:46:27 -04:00
<?php if ($item['rewatched'] == 1): ?>
2020-08-26 17:26:42 -04:00
<div>Rewatched once</div>
2020-05-04 16:46:27 -04:00
<?php elseif ($item['rewatched'] == 2): ?>
2020-08-26 17:26:42 -04:00
<div>Rewatched twice</div>
2020-05-04 16:46:27 -04:00
<?php elseif ($item['rewatched'] == 3): ?>
2020-08-26 17:26:42 -04:00
<div>Rewatched thrice</div>
2020-05-04 16:46:27 -04:00
<?php else: ?>
2020-08-26 17:26:42 -04:00
<div>Rewatched <?= $item['rewatched'] ?> times</div>
2020-05-04 16:46:27 -04:00
<?php endif ?>
</div>
<?php endif ?>
<?php if (count($item['anime']['streaming_links']) > 0): ?>
<div class="row">
<?php foreach ($item['anime']['streaming_links'] as $link): ?>
<div class="cover-streaming-link">
<?php if ($link['meta']['link']): ?>
<a href="<?= $link['link'] ?>"
title="Stream '<?= $item['anime']['title'] ?>' on <?= $link['meta']['name'] ?>">
<?= $_->h->img("/public/images/{$link['meta']['image']}", [
2018-11-05 09:56:38 -05:00
'class' => 'streaming-logo',
'width' => 20,
'height' => 20,
'alt' => "{$link['meta']['name']} logo",
]); ?>
</a>
<?php else: ?>
<?= $_->h->img("/public/images/{$link['meta']['image']}", [
2018-11-05 09:56:38 -05:00
'class' => 'streaming-logo',
'width' => 20,
'height' => 20,
'alt' => "{$link['meta']['name']} logo",
]); ?>
<?php endif ?>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
<?php if ($_->isAuthenticated()): ?>
<div class="row">
<span class="edit">
<a class="bracketed" title="Edit information about this anime" href="<?=
$_->urlFromRoute('edit', [
'controller' => 'anime',
'id' => $item['id'],
'status' => $item['watching_status']
]);
?>">Edit</a>
</span>
</div>
<?php endif ?>
<div class="row">
<div class="user-rating">Rating: <?= $item['user_rating'] ?> / 10</div>
<div class="completion">Episodes:
<span class="completed_number"><?= $item['episodes']['watched'] ?></span> /
<span class="total_number"><?= $item['episodes']['total'] ?></span>
</div>
</div>
<div class="row">
<div class="media_type"><?= $_->escape->html($item['anime']['show_type']) ?></div>
<div class="airing-status"><?= $_->escape->html($item['airing']['status']) ?></div>
<div class="age-rating"><?= $_->escape->html($item['anime']['age_rating']) ?></div>
</div>
</div>
</article>