2018-11-01 22:01:09 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use function Aviat\AnimeClient\getLocalImg;
|
|
|
|
use Aviat\AnimeClient\API\Kitsu;
|
|
|
|
|
|
|
|
?>
|
|
|
|
<main class="details fixed">
|
|
|
|
<section class="flex flex-no-wrap">
|
|
|
|
<div>
|
2018-11-08 11:36:42 -05:00
|
|
|
<?= $helper->picture("images/characters/{$data['id']}-original.webp") ?>
|
|
|
|
<?php if ( ! empty($data['otherNames'])): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<h3>Nicknames / Other names</h3>
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php foreach ($data['otherNames'] as $name): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<h4><?= $name ?></h4>
|
|
|
|
<?php endforeach ?>
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<h2 class="toph"><?= $data['name'] ?></h2>
|
|
|
|
<?php foreach ($data['names'] as $name): ?>
|
|
|
|
<h3><?= $name ?></h3>
|
|
|
|
<?php endforeach ?>
|
|
|
|
|
|
|
|
<hr />
|
|
|
|
|
2018-11-08 11:36:42 -05:00
|
|
|
<p class="description"><?= $data['description'] ?></p>
|
2018-11-01 22:01:09 -04:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
|
2018-12-07 10:22:16 -05:00
|
|
|
<?php if ( ! (empty($data['media']['anime']) || empty($data['media']['manga']))): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<h3>Media</h3>
|
|
|
|
<div class="tabs">
|
2018-12-07 10:22:16 -05:00
|
|
|
<?php if ( ! empty($data['media']['anime'])): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<input checked="checked" type="radio" id="media-anime" name="media-tabs" />
|
|
|
|
<label for="media-anime">Anime</label>
|
|
|
|
|
|
|
|
<section class="media-wrap content">
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php foreach ($data['media']['anime'] as $id => $anime): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<article class="media">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('anime.details', ['id' => $anime['attributes']['slug']]);
|
|
|
|
$titles = Kitsu::filterTitles($anime['attributes']);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= $helper->picture("images/anime/{$id}.webp") ?>
|
|
|
|
</a>
|
|
|
|
<div class="name">
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= array_shift($titles) ?>
|
|
|
|
<?php foreach ($titles as $title): ?>
|
|
|
|
<br />
|
|
|
|
<small><?= $title ?></small>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</section>
|
|
|
|
<?php endif ?>
|
|
|
|
|
2018-12-07 10:22:16 -05:00
|
|
|
<?php if ( ! empty($data['media']['manga'])): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<input type="radio" id="media-manga" name="media-tabs" />
|
|
|
|
<label for="media-manga">Manga</label>
|
|
|
|
|
|
|
|
<section class="media-wrap content">
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php foreach ($data['media']['manga'] as $id => $manga): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<article class="media">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('manga.details', ['id' => $manga['attributes']['slug']]);
|
|
|
|
$titles = Kitsu::filterTitles($manga['attributes']);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= $helper->picture("images/manga/{$id}.webp") ?>
|
|
|
|
</a>
|
|
|
|
<div class="name">
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= array_shift($titles) ?>
|
|
|
|
<?php foreach ($titles as $title): ?>
|
|
|
|
<br />
|
|
|
|
<small><?= $title ?></small>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</section>
|
|
|
|
<?php endif ?>
|
|
|
|
</div>
|
|
|
|
<?php endif ?>
|
|
|
|
|
|
|
|
<section>
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php if (count($data['castings']) > 0): ?>
|
2018-11-01 22:01:09 -04:00
|
|
|
<h3>Castings</h3>
|
|
|
|
<?php
|
2018-11-08 11:36:42 -05:00
|
|
|
$vas = $data['castings']['Voice Actor'];
|
|
|
|
unset($data['castings']['Voice Actor']);
|
|
|
|
ksort($vas)
|
2018-11-01 22:01:09 -04:00
|
|
|
?>
|
|
|
|
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php foreach ($data['castings'] as $role => $entries): ?>
|
|
|
|
<h4><?= $role ?></h4>
|
|
|
|
<?php foreach ($entries as $language => $casting): ?>
|
|
|
|
<h5><?= $language ?></h5>
|
|
|
|
<table class="min-table">
|
|
|
|
<tr>
|
|
|
|
<th>Cast Member</th>
|
|
|
|
<th>Series</th>
|
|
|
|
</tr>
|
|
|
|
<?php foreach ($casting as $cid => $c): ?>
|
|
|
|
<tr>
|
2018-11-08 14:18:24 -05:00
|
|
|
<td>
|
2018-11-08 11:36:42 -05:00
|
|
|
<article class="character">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('person', ['id' => $c['person']['id']]);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= $helper->picture(getLocalImg($c['person']['image'], TRUE)) ?>
|
|
|
|
<div class="name">
|
|
|
|
<?= $c['person']['name'] ?>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</article>
|
|
|
|
</td>
|
|
|
|
<td>
|
|
|
|
<section class="align-left media-wrap">
|
|
|
|
<?php foreach ($c['series'] as $series): ?>
|
|
|
|
<article class="media">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('anime.details', ['id' => $series['attributes']['slug']]);
|
|
|
|
$titles = Kitsu::filterTitles($series['attributes']);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= $helper->picture(getLocalImg($series['attributes']['posterImage']['small'], TRUE)) ?>
|
|
|
|
</a>
|
|
|
|
<div class="name">
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= array_shift($titles) ?>
|
|
|
|
<?php foreach ($titles as $title): ?>
|
|
|
|
<br />
|
|
|
|
<small><?= $title ?></small>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</section>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
</table>
|
|
|
|
<?php endforeach ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
|
2018-11-01 22:01:09 -04:00
|
|
|
<?php if ( ! empty($vas)): ?>
|
|
|
|
<h4>Voice Actors</h4>
|
|
|
|
|
|
|
|
<div class="tabs">
|
|
|
|
<?php $i = 0; ?>
|
|
|
|
|
|
|
|
<?php foreach ($vas as $language => $casting): ?>
|
|
|
|
<input <?= $i === 0 ? 'checked="checked"' : '' ?> type="radio" id="character-va<?= $i ?>"
|
|
|
|
name="character-vas"
|
|
|
|
/>
|
|
|
|
<label for="character-va<?= $i ?>"><?= $language ?></label>
|
|
|
|
<section class="content">
|
|
|
|
<table class="borderless max-table">
|
|
|
|
<tr>
|
|
|
|
<th>Cast Member</th>
|
|
|
|
<th>Series</th>
|
|
|
|
</tr>
|
|
|
|
<?php foreach ($casting as $cid => $c): ?>
|
|
|
|
<tr>
|
|
|
|
<td>
|
|
|
|
<article class="character">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('person', ['id' => $c['person']['id']]);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= $helper->picture(getLocalImg($c['person']['image'])) ?>
|
|
|
|
<div class="name">
|
|
|
|
<?= $c['person']['name'] ?>
|
|
|
|
</div>
|
|
|
|
</a>
|
|
|
|
</article>
|
|
|
|
</td>
|
|
|
|
<td width="75%">
|
2018-11-02 10:48:20 -04:00
|
|
|
<section class="align-left media-wrap-flex">
|
2018-11-01 22:01:09 -04:00
|
|
|
<?php foreach ($c['series'] as $series): ?>
|
|
|
|
<article class="media">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('anime.details', ['id' => $series['attributes']['slug']]);
|
|
|
|
$titles = Kitsu::filterTitles($series['attributes']);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= $helper->picture(getLocalImg($series['attributes']['posterImage']['small'], TRUE)) ?>
|
|
|
|
</a>
|
|
|
|
<div class="name">
|
|
|
|
<a href="<?= $link ?>">
|
|
|
|
<?= array_shift($titles) ?>
|
|
|
|
<?php foreach ($titles as $title): ?>
|
|
|
|
<br />
|
|
|
|
<small><?= $title ?></small>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
</article>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</section>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</table>
|
|
|
|
</section>
|
|
|
|
<?php $i++ ?>
|
|
|
|
<?php endforeach ?>
|
|
|
|
</div>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php endif ?>
|
|
|
|
</section>
|
|
|
|
</main>
|