HummingBirdAnimeClient/app/views/anime/cover.php

70 lines
2.8 KiB
PHP
Raw Normal View History

<main>
2016-12-21 12:46:20 -05:00
<?php /*if ($auth->is_authenticated()): ?>
<a class="bracketed" href="<?= $url->generate('anime.add.get') ?>">Add Item</a>
2016-12-21 12:46:20 -05:00
<?php endif */ ?>
<?php if (empty($sections)): ?>
<h3>There's nothing here!</h3>
<?php else: ?>
<?php foreach ($sections as $name => $items): ?>
2016-12-21 12:46:20 -05:00
<?php /*<pre><?= print_r($items, TRUE) ?></pre> */ ?>
<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): ?>
2016-12-21 12:46:20 -05:00
<?php if ($item['private']/* && ! $auth->is_authenticated()*/) continue; ?>
2015-11-13 11:33:27 -05:00
<article class="media" id="<?= $item['anime']['slug'] ?>">
2016-12-21 12:46:20 -05:00
<?php /* if ($auth->is_authenticated()): ?>
2016-01-04 10:53:03 -05:00
<button title="Increment episode count" class="plus_one" hidden>+1 Episode</button>
2016-12-21 12:46:20 -05:00
<?php endif */ ?>
2015-09-28 14:41:45 -04:00
<?= $helper->img($item['anime']['image']); ?>
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']]); ?>">
2015-09-17 23:11:18 -04:00
<?= $escape->html($item['anime']['title']) ?>
<?= ($item['anime']['alternate_title'] != "") ? "<br />({$item['anime']['alternate_title']})" : ""; ?>
</a>
</div>
2015-06-17 08:50:01 -04:00
<div class="table">
2016-12-21 12:46:20 -05:00
<?php /* if ($auth->is_authenticated()): ?>
2016-01-04 10:53:03 -05:00
<div class="row">
<span class="edit">
<a class="bracketed" title="Edit information about this anime" href="<?= $urlGenerator->url("anime/edit/{$item['id']}/{$item['watching_status']}") ?>">Edit</a>
2016-01-04 10:53:03 -05:00
</span>
</div>
2016-12-21 12:46:20 -05:00
<?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 ?>
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>
<?php endforeach ?>
<?php endif ?>
</main>
2016-12-21 12:46:20 -05:00
<?php /* if ($auth->is_authenticated()): ?>
<script src="<?= $urlGenerator->asset_url('js.php/g/edit') ?>"></script>
2016-12-21 12:46:20 -05:00
<?php endif */ ?>