HummingBirdAnimeClient/app/views/anime/cover.php

103 lines
3.9 KiB
PHP
Raw Normal View History

<main>
2017-02-15 16:30:14 -05:00
<?php if ($auth->isAuthenticated()): ?>
<a class="bracketed" href="<?= $url->generate('anime.add.get') ?>">Add Item</a>
<?php endif ?>
<?php if (empty($sections)): ?>
<h3>There's nothing here!</h3>
<?php else: ?>
<?php foreach ($sections as $name => $items): ?>
2017-09-14 17:33:24 -04:00
<?php if (empty($items)): ?>
<section class="status">
<h2><?= $escape->html($name) ?></h2>
<h3>There's nothing here!</h3>
</section>
<?php else: ?>
<section class="status">
2015-09-17 23:11:18 -04:00
<h2><?= $escape->html($name) ?></h2>
<section class="media-wrap">
<?php foreach($items as $item): ?>
2017-02-15 16:30:14 -05:00
<?php if ($item['private'] && ! $auth->isAuthenticated()) continue; ?>
2017-01-13 16:49:46 -05:00
<article class="media" data-kitsu-id="<?= $item['id'] ?>" data-mal-id="<?= $item['mal_id'] ?>">
2017-02-15 16:30:14 -05:00
<?php if ($auth->isAuthenticated()): ?>
2016-01-04 10:53:03 -05:00
<button title="Increment episode count" class="plus_one" hidden>+1 Episode</button>
<?php endif ?>
<img src="<?= $urlGenerator->assetUrl("images/anime/{$item['anime']['id']}.jpg") ?>" alt="" />
2015-06-17 08:50:01 -04:00
<div class="name">
2016-04-08 11:56:17 -04:00
<a href="<?= $url->generate('anime.details', ['id' => $item['anime']['slug']]); ?>">
<?= array_shift($item['anime']['titles']) ?>
<?php foreach ($item['anime']['titles'] as $title): ?>
<br /><small><?= $title ?></small>
<?php endforeach ?>
</a>
</div>
2015-06-17 08:50:01 -04:00
<div class="table">
2017-02-15 16:30:14 -05:00
<?php if ($auth->isAuthenticated()): ?>
2016-01-04 10:53:03 -05:00
<div class="row">
<span class="edit">
<a class="bracketed" title="Edit information about this anime" href="<?=
2017-02-17 08:25:19 -05:00
$url->generate('edit', [
'controller' => 'anime',
'id' => $item['id'],
2017-02-17 08:25:19 -05:00
'status' => $item['watching_status']
]);
?>">Edit</a>
2016-01-04 10:53:03 -05:00
</span>
</div>
<?php endif ?>
2016-01-04 10:53:03 -05:00
<?php if ($item['private'] || $item['rewatching']): ?>
<div class="row">
2016-01-06 11:08:56 -05:00
<?php foreach(['private', 'rewatching'] as $attr): ?>
2016-01-04 10:53:03 -05:00
<?php if($item[$attr]): ?>
<span class="item-<?= $attr ?>"><?= ucfirst($attr) ?></span>
<?php endif ?>
<?php endforeach ?>
</div>
<?php endif ?>
2016-01-06 11:08:56 -05:00
<?php if ($item['rewatched'] > 0): ?>
<div class="row">
<div>Rewatched <?= $item['rewatched'] ?> time(s)</div>
</div>
<?php endif ?>
2017-01-13 16:49:46 -05:00
<?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'] ?>">
<img class="streaming-logo" width="20" height="20" src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" alt="<?= $link['meta']['name'] ?> logo" />
2017-01-13 16:49:46 -05:00
</a>
<?php else: ?>
<img class="streaming-logo" width="20" height="20" src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" alt="<?= $link['meta']['name'] ?> logo" />
2017-01-13 16:49:46 -05:00
<?php endif ?>
</div>
<?php endforeach ?>
</div>
<?php endif ?>
2015-06-17 08:50:01 -04:00
<div class="row">
2015-09-28 14:41:45 -04:00
<div class="user_rating">Rating: <?= $item['user_rating'] ?> / 10</div>
<div class="completion">Episodes:
2015-09-28 14:41:45 -04:00
<span class="completed_number"><?= $item['episodes']['watched'] ?></span> /
<span class="total_number"><?= $item['episodes']['total'] ?></span>
</div>
2015-06-17 08:50:01 -04:00
</div>
<div class="row">
2015-09-28 14:41:45 -04:00
<div class="media_type"><?= $escape->html($item['anime']['type']) ?></div>
<div class="airing_status"><?= $escape->html($item['airing']['status']) ?></div>
2015-09-17 23:11:18 -04:00
<div class="age_rating"><?= $escape->html($item['anime']['age_rating']) ?></div>
2015-06-17 08:50:01 -04:00
</div>
</div>
</article>
<?php endforeach ?>
</section>
</section>
2017-09-14 17:33:24 -04:00
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
</main>
2017-02-15 16:30:14 -05:00
<?php if ($auth->isAuthenticated()): ?>
2017-02-15 15:56:10 -05:00
<script defer="defer" src="<?= $urlGenerator->assetUrl('js.php/g/edit') ?>"></script>
<?php endif ?>