2017-03-31 16:36:22 -04:00
|
|
|
<?php use Aviat\AnimeClient\API\Kitsu; ?>
|
|
|
|
<main class="user-page details">
|
2017-03-08 13:46:50 -05:00
|
|
|
<section class="flex flex-no-wrap">
|
|
|
|
<div>
|
2017-03-31 17:01:53 -04:00
|
|
|
<center>
|
|
|
|
<h2>
|
|
|
|
<a title='View profile on Kisu'
|
|
|
|
href="https://kitsu.io/users/<?= $attributes['name'] ?>">
|
|
|
|
<?= $attributes['name'] ?>
|
|
|
|
</a>
|
|
|
|
</h2>
|
2017-04-13 14:25:39 -04:00
|
|
|
<?php
|
|
|
|
$file = basename(parse_url($attributes['avatar']['original'], \PHP_URL_PATH));
|
|
|
|
$parts = explode('.', $file);
|
|
|
|
$ext = end($parts);
|
|
|
|
?>
|
|
|
|
<img src="<?= $urlGenerator->assetUrl('images/avatars', "{$data['id']}.{$ext}") ?>" alt="" />
|
2017-03-31 17:01:53 -04:00
|
|
|
</center>
|
2017-03-08 13:46:50 -05:00
|
|
|
<br />
|
|
|
|
<br />
|
|
|
|
<table class="media_details">
|
2017-03-31 14:15:29 -04:00
|
|
|
<tr>
|
|
|
|
<th colspan="2">General</th>
|
|
|
|
</tr>
|
2017-03-08 13:46:50 -05:00
|
|
|
<tr>
|
|
|
|
<td>Location</td>
|
|
|
|
<td><?= $attributes['location'] ?></td>
|
|
|
|
</tr>
|
2017-03-08 16:21:01 -05:00
|
|
|
<tr>
|
|
|
|
<td>Website</td>
|
|
|
|
<td><?= $helper->a($attributes['website'], $attributes['website']) ?></td>
|
|
|
|
</tr>
|
|
|
|
<?php if (array_key_exists('waifu', $relationships)): ?>
|
|
|
|
<tr>
|
|
|
|
<td><?= $escape->html($attributes['waifuOrHusbando']) ?></td>
|
|
|
|
<td>
|
2017-03-31 14:15:29 -04:00
|
|
|
<?php
|
2017-03-10 12:50:48 -05:00
|
|
|
$character = $relationships['waifu']['attributes'];
|
2017-03-08 16:21:01 -05:00
|
|
|
echo $helper->a(
|
|
|
|
$url->generate('character', ['slug' => $character['slug']]),
|
|
|
|
$character['name']
|
|
|
|
);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endif ?>
|
2017-03-31 14:15:29 -04:00
|
|
|
<tr>
|
|
|
|
<th colspan="2">User Stats</th>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td># of Posts</td>
|
|
|
|
<td><?= $attributes['postsCount'] ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td># of Comments</td>
|
|
|
|
<td><?= $attributes['commentsCount'] ?></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td># of Media Rated</td>
|
|
|
|
<td><?= $attributes['ratingsCount'] ?></td>
|
|
|
|
</tr>
|
2017-03-08 13:46:50 -05:00
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<dl>
|
|
|
|
<dt>About:</dt>
|
2017-03-08 16:21:01 -05:00
|
|
|
<dd><?= $escape->html($attributes['bio']) ?></dd>
|
2017-03-08 13:46:50 -05:00
|
|
|
</dl>
|
2017-03-31 14:15:29 -04:00
|
|
|
<?php if ( ! empty($favorites)): ?>
|
|
|
|
<?php if ( ! empty($favorites['characters'])): ?>
|
2017-03-31 16:36:22 -04:00
|
|
|
<h4>Favorite Characters</h4>
|
|
|
|
<section class="media-wrap">
|
2017-04-13 14:25:39 -04:00
|
|
|
<?php foreach($favorites['characters'] as $id => $char): ?>
|
2017-03-31 14:15:29 -04:00
|
|
|
<?php if ( ! empty($char['image']['original'])): ?>
|
2017-03-31 16:36:22 -04:00
|
|
|
<article class="small_character">
|
2017-03-31 14:15:29 -04:00
|
|
|
<?php $link = $url->generate('character', ['slug' => $char['slug']]) ?>
|
2017-03-31 16:36:22 -04:00
|
|
|
<div class="name"><?= $helper->a($link, $char['name']); ?></div>
|
2017-03-31 14:15:29 -04:00
|
|
|
<a href="<?= $link ?>">
|
2017-04-13 14:25:39 -04:00
|
|
|
<?= $helper->img($urlGenerator->assetUrl('images/characters', "{$char['id']}.jpg")) ?>
|
2017-03-31 14:15:29 -04:00
|
|
|
</a>
|
2017-03-31 16:36:22 -04:00
|
|
|
</article>
|
2017-03-31 14:15:29 -04:00
|
|
|
<?php endif ?>
|
|
|
|
<?php endforeach ?>
|
2017-03-31 16:36:22 -04:00
|
|
|
</section>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php if ( ! empty($favorites['anime'])): ?>
|
|
|
|
<h4>Favorite Anime</h4>
|
|
|
|
<section class="media-wrap">
|
|
|
|
<?php foreach($favorites['anime'] as $anime): ?>
|
|
|
|
<article class="media">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('anime.details', ['id' => $anime['slug']]);
|
|
|
|
$titles = Kitsu::filterTitles($anime);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
2017-04-13 14:25:39 -04:00
|
|
|
<img src="<?= $urlGenerator->assetUrl('images/anime', "{$anime['id']}.jpg") ?>" width="220" alt="" />
|
2017-03-31 16:36:22 -04:00
|
|
|
</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 ?>
|
|
|
|
<?php if ( ! empty($favorites['manga'])): ?>
|
|
|
|
<h4>Favorite Manga</h4>
|
|
|
|
<section class="media-wrap">
|
|
|
|
<?php foreach($favorites['manga'] as $manga): ?>
|
|
|
|
<article class="media">
|
|
|
|
<?php
|
|
|
|
$link = $url->generate('manga.details', ['id' => $manga['slug']]);
|
|
|
|
$titles = Kitsu::filterTitles($manga);
|
|
|
|
?>
|
|
|
|
<a href="<?= $link ?>">
|
2017-04-13 14:25:39 -04:00
|
|
|
<img src="<?= $urlGenerator->assetUrl('images/manga', "{$manga['id']}.jpg") ?>" width="220" alt="" />
|
2017-03-31 16:36:22 -04:00
|
|
|
</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 ?>
|
2017-03-31 14:15:29 -04:00
|
|
|
</section>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php endif ?>
|
2017-03-08 13:46:50 -05:00
|
|
|
</div>
|
|
|
|
</section>
|
|
|
|
</main>
|