Character | -Series | -
---|---|
-
- = $character['character']['canonicalName'] ?>
-
-
- |
-
- |
-
Castings
+
$entries): ?>
@@ -25,30 +25,17 @@ use Aviat\AnimeClient\API\Kitsu;
$casting): ?>
-
+
+
$series): ?>
-
- generate("{$mediaType}.details", ['id' => $series['slug']]);
- $titles = Kitsu::filterTitles($series);
- ?>
-
- = $helper->picture("images/{$type}/{$sid}.webp") ?>
-
-
-
+
+ = $component->media(
+ Kitsu::filterTitles($series),
+ $url->generate("{$mediaType}.details", ['id' => $series['slug']]),
+ $helper->picture("images/{$type}/{$sid}.webp")
+ ) ?>
@@ -61,7 +48,51 @@ use Aviat\AnimeClient\API\Kitsu;
-
+ {$character}
+
+ {$media}
+
+
+HTML;
+ endforeach;
+
+ $roles = implode('', array_map('mb_trim', $voiceRoles));
+
+ return <<
+
+
+ Character
+ Series
+
+
+ {$roles}
+
+HTML;
+
+ }) ?>
diff --git a/app/views/settings/settings.php b/app/views/settings/settings.php
index b51319aa..16fef5f0 100644
--- a/app/views/settings/settings.php
+++ b/app/views/settings/settings.php
@@ -28,9 +28,7 @@ $nestedPrefix = 'config';
/>
-
-
checkAuth(); ?> @@ -43,11 +41,15 @@ $nestedPrefix = 'config'; + = $helper->a( - $url->generate('anilist-redirect'), - 'Update Access Token' - ) ?> + $url->generate('anilist-redirect'), + 'Update Access Token', + ['class' => 'bracketed user-btn'] + ) ?> + +
diff --git a/app/views/user/details.php b/app/views/user/details.php
index f47bb675..f31d7a79 100644
--- a/app/views/user/details.php
+++ b/app/views/user/details.php
@@ -57,79 +57,40 @@ use Aviat\AnimeClient\API\Kitsu;
= ucfirst($type) ?>
-Voice Acting Roles
+ = $component->tabs('voice-acting-roles', $data['characters'], static function ($characterList) use ($component, $helper, $url) { + $voiceRoles = []; + foreach ($characterList as $cid => $item): + $character = $component->character( + $item['character']['canonicalName'], + $url->generate('character', ['slug' => $item['character']['slug']]), + $helper->picture(getLocalImg($item['character']['image']['original'])) + ); + $medias = []; + foreach ($item['media'] as $sid => $series) + { + $medias[] = $component->media( + Kitsu::filterTitles($series), + $url->generate('anime.details', ['id' => $series['slug']]), + $helper->picture("images/anime/{$sid}.webp") + ); + } + $media = implode('', array_map('mb_trim', $medias)); + + $voiceRoles[] = << +checkAuth(); ?> @@ -43,11 +41,15 @@ $nestedPrefix = 'config'; + = $helper->a( - $url->generate('anilist-redirect'), - 'Update Access Token' - ) ?> + $url->generate('anilist-redirect'), + 'Update Access Token', + ['class' => 'bracketed user-btn'] + ) ?> + +
Favorites
-
-
-
- />
-
-
- $char): ?>
-
-
- generate('character', ['slug' => $char['slug']]) ?>
-
-
-
-
-
-
-
- />
-
-
-
-
- generate('anime.details', ['id' => $anime['slug']]);
- $titles = Kitsu::filterTitles($anime);
- ?>
-
- = $helper->picture("images/anime/{$anime['id']}.webp") ?>
-
-
-
-
-
-
-
-
- />
-
-
-
-
- generate('manga.details', ['id' => $manga['slug']]);
- $titles = Kitsu::filterTitles($manga);
- ?>
-
- = $helper->picture("images/manga/{$manga['id']}.webp") ?>
-
-
-
-
-
-
-
-
+ = $component->tabs('user-favorites', $data['favorites'], static function ($items, $type) use ($component, $helper, $url) {
+ $rendered = [];
+ if ($type === 'characters')
+ {
+ uasort($items, fn ($a, $b) => $a['canonicalName'] <=> $b['canonicalName']);
+ }
+ else
+ {
+ uasort($items, fn ($a, $b) => Kitsu::filterTitles($a)[0] <=> Kitsu::filterTitles($b)[0]);
+ }
+
+ foreach ($items as $id => $item)
+ {
+ if ($type === 'characters')
+ {
+ $rendered[] = $component->character(
+ $item['canonicalName'],
+ $url->generate('character', ['slug', $item['slug']]),
+ $helper->picture("images/characters/{$item['id']}.webp")
+ );
+ }
+ else
+ {
+ $rendered[] = $component->media(
+ Kitsu::filterTitles($item),
+ $url->generate("{$type}.details", ['id' => $item['slug']]),
+ $helper->picture("images/{$type}/{$item['id']}.webp"),
+ );
+ }
+ }
+
+ return implode('', array_map('mb_trim', $rendered));
+
+ }, 'content full-width media-wrap') ?>
= $helper->a($link, $char['canonicalName']); ?>
-
- = $helper->picture("images/characters/{$char['id']}.webp") ?>
-
-