2018-10-30 11:42:32 -04:00
|
|
|
<?php
|
2020-08-26 15:22:14 -04:00
|
|
|
use Aviat\AnimeClient\Kitsu;
|
2018-10-30 11:42:32 -04:00
|
|
|
?>
|
2017-03-31 16:36:22 -04:00
|
|
|
<main class="user-page details">
|
2018-11-05 09:56:38 -05:00
|
|
|
<h2 class="toph">
|
2023-05-18 15:17:19 -04:00
|
|
|
About
|
2023-12-21 13:46:15 -05:00
|
|
|
<?= $_->h->a(
|
2023-05-18 15:17:19 -04:00
|
|
|
"https://kitsu.io/users/{$data['slug']}",
|
|
|
|
$data['name'], [
|
|
|
|
'title' => 'View profile on Kitsu'
|
2018-11-05 09:56:38 -05:00
|
|
|
])
|
|
|
|
?>
|
|
|
|
</h2>
|
|
|
|
|
2017-03-08 13:46:50 -05:00
|
|
|
<section class="flex flex-no-wrap">
|
2018-11-05 09:56:38 -05:00
|
|
|
<aside class="info">
|
2023-05-18 15:17:19 -04:00
|
|
|
<table class="media-details invisible">
|
|
|
|
<tr>
|
2023-05-18 16:25:50 -04:00
|
|
|
<?php if($data['avatar'] !== null): ?>
|
2023-12-21 13:46:15 -05:00
|
|
|
<td><?= $_->h->img($data['avatar'], ['alt' => '', 'width' => '225']); ?></td>
|
2023-05-18 16:25:50 -04:00
|
|
|
<?php endif ?>
|
2023-12-21 13:46:15 -05:00
|
|
|
<td><?= $_->escape->html($data['about']) ?></td>
|
2023-05-18 15:17:19 -04:00
|
|
|
</tr>
|
|
|
|
</table>
|
2017-03-08 13:46:50 -05:00
|
|
|
<br />
|
2018-11-02 10:48:20 -04:00
|
|
|
<table class="media-details">
|
2023-05-18 15:17:19 -04:00
|
|
|
<?php foreach ([
|
|
|
|
'joinDate' => 'Joined',
|
|
|
|
'birthday' => 'Birthday',
|
2023-05-18 16:25:50 -04:00
|
|
|
'gender' => 'Gender',
|
2023-05-18 15:17:19 -04:00
|
|
|
'location' => 'Location'
|
|
|
|
] as $key => $label): ?>
|
|
|
|
<?php if ($data[$key] !== null): ?>
|
2017-03-08 13:46:50 -05:00
|
|
|
<tr>
|
2023-05-18 15:17:19 -04:00
|
|
|
<td><?= $label ?></td>
|
|
|
|
<td><?= $data[$key] ?></td>
|
2017-03-08 13:46:50 -05:00
|
|
|
</tr>
|
2023-05-18 15:17:19 -04:00
|
|
|
<?php endif ?>
|
|
|
|
<?php endforeach; ?>
|
|
|
|
|
|
|
|
<?php if ($data['website'] !== null): ?>
|
2017-03-08 16:21:01 -05:00
|
|
|
<tr>
|
|
|
|
<td>Website</td>
|
2023-12-21 13:46:15 -05:00
|
|
|
<td><?= $_->h->a($data['website'], $data['website']) ?></td>
|
2017-03-08 16:21:01 -05:00
|
|
|
</tr>
|
2023-05-18 15:17:19 -04:00
|
|
|
<?php endif ?>
|
|
|
|
|
2023-05-18 16:25:50 -04:00
|
|
|
<?php if ($data['waifu']['character'] !== null): ?>
|
2017-03-08 16:21:01 -05:00
|
|
|
<tr>
|
2023-12-21 13:46:15 -05:00
|
|
|
<td><?= $_->escape->html($data['waifu']['label']) ?></td>
|
2017-03-08 16:21:01 -05:00
|
|
|
<td>
|
2017-03-31 14:15:29 -04:00
|
|
|
<?php
|
2018-11-08 11:36:42 -05:00
|
|
|
$character = $data['waifu']['character'];
|
2023-12-21 13:46:15 -05:00
|
|
|
echo $_->component->character(
|
2023-05-18 15:17:19 -04:00
|
|
|
$character['names']['canonical'],
|
2023-12-21 13:46:15 -05:00
|
|
|
$_->urlFromRoute('character', ['slug' => $character['slug']]),
|
|
|
|
$_->h->img(Kitsu::getImage($character))
|
2017-03-08 16:21:01 -05:00
|
|
|
);
|
|
|
|
?>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
<?php endif ?>
|
2018-11-05 09:56:38 -05:00
|
|
|
</table>
|
|
|
|
|
|
|
|
<h3>User Stats</h3><br />
|
|
|
|
<table class="media-details">
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php foreach($data['stats'] as $label => $stat): ?>
|
2018-10-30 11:42:32 -04:00
|
|
|
<tr>
|
2018-11-08 11:36:42 -05:00
|
|
|
<td><?= $label ?></td>
|
|
|
|
<td><?= $stat ?></td>
|
2017-03-31 14:15:29 -04:00
|
|
|
</tr>
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php endforeach ?>
|
2017-03-08 13:46:50 -05:00
|
|
|
</table>
|
2018-11-05 09:56:38 -05:00
|
|
|
</aside>
|
|
|
|
<article>
|
2018-11-08 11:36:42 -05:00
|
|
|
<?php if ( ! empty($data['favorites'])): ?>
|
2018-10-30 11:42:32 -04:00
|
|
|
<h3>Favorites</h3>
|
2023-12-21 13:46:15 -05:00
|
|
|
<?= $_->component->tabs('user-favorites', $data['favorites'], static function ($items, $type) use ($_) {
|
2020-08-24 15:20:07 -04:00
|
|
|
if ($type === 'character')
|
2020-08-21 19:25:27 -04:00
|
|
|
{
|
2020-08-24 15:20:07 -04:00
|
|
|
uasort($items, fn ($a, $b) => $a['names']['canonical'] <=> $b['names']['canonical']);
|
2020-08-21 19:25:27 -04:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2020-08-24 15:20:07 -04:00
|
|
|
uasort($items, fn ($a, $b) => $a['titles']['canonical'] <=> $b['titles']['canonical']);
|
2020-08-21 19:25:27 -04:00
|
|
|
}
|
|
|
|
|
2023-12-21 13:46:15 -05:00
|
|
|
$rendered = array_map(fn ($item) => match ($type) {
|
|
|
|
'character' => $_->component->character(
|
|
|
|
$item['names']['canonical'],
|
|
|
|
$_->urlFromRoute('character', ['slug' => $item['slug']]),
|
|
|
|
$_->h->img(Kitsu::getImage($item))
|
|
|
|
),
|
|
|
|
default => $_->component->media(
|
|
|
|
array_merge(
|
|
|
|
[$item['titles']['canonical']],
|
|
|
|
Kitsu::getFilteredTitles($item['titles']),
|
|
|
|
),
|
|
|
|
$_->urlFromRoute("{$type}.details", ['id' => $item['slug']]),
|
|
|
|
$_->h->img(Kitsu::getPosterImage($item), ['width' => 220]),
|
|
|
|
),
|
|
|
|
}, $items);
|
2020-08-21 19:25:27 -04:00
|
|
|
|
|
|
|
return implode('', array_map('mb_trim', $rendered));
|
|
|
|
|
|
|
|
}, 'content full-width media-wrap') ?>
|
2017-03-31 14:15:29 -04:00
|
|
|
<?php endif ?>
|
2018-11-05 09:56:38 -05:00
|
|
|
</article>
|
2017-03-08 13:46:50 -05:00
|
|
|
</section>
|
|
|
|
</main>
|