Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
4 changed files with 85 additions and 59 deletions
Showing only changes of commit 67e068f053 - Show all commits

View File

@ -41,14 +41,20 @@
<?php if ($link['meta']['link']): ?> <?php if ($link['meta']['link']): ?>
<a href="<?= $link['link'] ?>" <a href="<?= $link['link'] ?>"
title="Stream '<?= $item['anime']['title'] ?>' on <?= $link['meta']['name'] ?>"> title="Stream '<?= $item['anime']['title'] ?>' on <?= $link['meta']['name'] ?>">
<img class="streaming-logo" width="20" height="20" <?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" 'class' => 'streaming-logo',
alt="<?= $link['meta']['name'] ?> logo"/> 'width' => 20,
'height' => 20,
'alt' => "{$link['meta']['name']} logo",
]); ?>
</a> </a>
<?php else: ?> <?php else: ?>
<img class="streaming-logo" width="20" height="20" <?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" 'class' => 'streaming-logo',
alt="<?= $link['meta']['name'] ?> logo"/> 'width' => 20,
'height' => 20,
'alt' => "{$link['meta']['name']} logo",
]); ?>
<?php endif ?> <?php endif ?>
</div> </div>
<?php endforeach ?> <?php endforeach ?>

View File

@ -46,7 +46,7 @@
<h3><?= $title ?></h3> <h3><?= $title ?></h3>
<?php endforeach ?> <?php endforeach ?>
<br /> <br />
<p><?= nl2br($show_data['synopsis']) ?></p> <p class="description"><?= nl2br($show_data['synopsis']) ?></p>
<?php if (count($show_data['streaming_links']) > 0): ?> <?php if (count($show_data['streaming_links']) > 0): ?>
<hr /> <hr />
<h4>Streaming on:</h4> <h4>Streaming on:</h4>
@ -67,19 +67,21 @@
href="<?= $link['link'] ?>" href="<?= $link['link'] ?>"
title="Stream '<?= $show_data['title'] ?>' on <?= $link['meta']['name'] ?>" title="Stream '<?= $show_data['title'] ?>' on <?= $link['meta']['name'] ?>"
> >
<img <?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
class="streaming-logo" width="50" height="50" 'class' => 'streaming-logo',
src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" 'width' => 50,
alt="<?= $link['meta']['name'] ?> logo" 'height' => 50,
/> 'alt' => "{$link['meta']['name']} logo",
]); ?>
&nbsp;&nbsp;<?= $link['meta']['name'] ?> &nbsp;&nbsp;<?= $link['meta']['name'] ?>
</a> </a>
<?php else: ?> <?php else: ?>
<img <?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
class="streaming-logo" width="50" height="50" 'class' => 'streaming-logo',
src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" 'width' => 50,
alt="<?= $link['meta']['name'] ?> logo" 'height' => 50,
/> 'alt' => "{$link['meta']['name']} logo",
]); ?>
&nbsp;&nbsp;<?= $link['meta']['name'] ?> &nbsp;&nbsp;<?= $link['meta']['name'] ?>
<?php endif ?> <?php endif ?>
</td> </td>
@ -91,12 +93,17 @@
</table> </table>
<?php endif ?> <?php endif ?>
<?php if ( ! empty($show_data['trailer_id'])): ?> <?php if ( ! empty($show_data['trailer_id'])): ?>
<hr /> <div class="responsive-iframe">
<h4>Trailer</h4> <h4>Trailer</h4>
<iframe <iframe
width="560" height="315" src="https://www.youtube.com/embed/<?= $show_data['trailer_id'] ?>" width="560"
frameborder="0" allow="autoplay; encrypted-media" allowfullscreen height="315"
src="https://www.youtube.com/embed/<?= $show_data['trailer_id'] ?>"
frameborder="0"
allow="autoplay; encrypted-media"
allowfullscreen
></iframe> ></iframe>
</div>
<?php endif ?> <?php endif ?>
</article> </article>
</section> </section>

View File

@ -72,10 +72,20 @@
<?php foreach($item['anime']['streaming_links'] as $link): ?> <?php foreach($item['anime']['streaming_links'] as $link): ?>
<?php if ($link['meta']['link'] !== FALSE): ?> <?php if ($link['meta']['link'] !== FALSE): ?>
<a href="<?= $link['link'] ?>" title="Stream '<?= $item['anime']['title'] ?>' on <?= $link['meta']['name'] ?>"> <a href="<?= $link['link'] ?>" title="Stream '<?= $item['anime']['title'] ?>' on <?= $link['meta']['name'] ?>">
<img class="streaming-logo" width="50" height="50" src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" alt="<?= $link['meta']['name'] ?> logo" /> <?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
'class' => 'streaming-logo',
'width' => 50,
'height' => 50,
'alt' => "{$link['meta']['name']} logo",
]); ?>
</a> </a>
<?php else: ?> <?php else: ?>
<img class="streaming-logo" width="50" height="50" src="<?= $urlGenerator->assetUrl('images', $link['meta']['image']) ?>" alt="<?= $link['meta']['name'] ?> logo" /> <?= $helper->picture("images/{$link['meta']['image']}", 'svg', [
'class' => 'streaming-logo',
'width' => 50,
'height' => 50,
'alt' => "{$link['meta']['name']} logo",
]); ?>
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
</td> </td>

View File

@ -3,8 +3,19 @@ use function Aviat\AnimeClient\getLocalImg;
use Aviat\AnimeClient\API\Kitsu; use Aviat\AnimeClient\API\Kitsu;
?> ?>
<main class="user-page details"> <main class="user-page details">
<h2 class="toph">
<?= $helper->a(
"https://kitsu.io/users/{$attributes['slug']}",
$attributes['name'], [
'title' => 'View profile on Kitsu'
])
?>
</h2>
<p><?= $escape->html($attributes['about']) ?></p>
<section class="flex flex-no-wrap"> <section class="flex flex-no-wrap">
<div> <aside class="info">
<center> <center>
<?php <?php
$avatar = $urlGenerator->assetUrl( $avatar = $urlGenerator->assetUrl(
@ -14,11 +25,7 @@ use Aviat\AnimeClient\API\Kitsu;
?> ?>
</center> </center>
<br /> <br />
<br />
<table class="media-details"> <table class="media-details">
<tr>
<th colspan="2">General</th>
</tr>
<tr> <tr>
<td>Location</td> <td>Location</td>
<td><?= $attributes['location'] ?></td> <td><?= $attributes['location'] ?></td>
@ -41,58 +48,48 @@ use Aviat\AnimeClient\API\Kitsu;
</td> </td>
</tr> </tr>
<?php endif ?> <?php endif ?>
<tr> </table>
<th colspan="2">User Stats</th>
</tr> <h3>User Stats</h3><br />
<table class="media-details">
<tr> <tr>
<td>Time spent watching anime:</td> <td>Time spent watching anime:</td>
<td><?= $timeOnAnime ?></td> <td><?= $timeOnAnime ?></td>
</tr> </tr>
<tr> <tr>
<td># of Anime episodes watched</td> <td># of Anime episodes watched</td>
<td><?= $stats['anime-amount-consumed']['units'] ?></td> <td><?= number_format($stats['anime-amount-consumed']['units']) ?></td>
</tr> </tr>
<tr> <tr>
<td># of Manga chapters read</td> <td># of Manga chapters read</td>
<td><?= $stats['manga-amount-consumed']['units'] ?></td> <td><?= number_format($stats['manga-amount-consumed']['units']) ?></td>
</tr> </tr>
<tr> <tr>
<td># of Posts</td> <td># of Posts</td>
<td><?= $attributes['postsCount'] ?></td> <td><?= number_format($attributes['postsCount']) ?></td>
</tr> </tr>
<tr> <tr>
<td># of Comments</td> <td># of Comments</td>
<td><?= $attributes['commentsCount'] ?></td> <td><?= number_format($attributes['commentsCount']) ?></td>
</tr> </tr>
<tr> <tr>
<td># of Media Rated</td> <td># of Media Rated</td>
<td><?= $attributes['ratingsCount'] ?></td> <td><?= number_format($attributes['ratingsCount']) ?></td>
</tr> </tr>
</table> </table>
</div> </aside>
<div> <article>
<h2>
<?= $helper->a(
"https://kitsu.io/users/{$attributes['slug']}",
$attributes['name'], [
'title' => 'View profile on Kitsu'
])
?>
</h2>
<dl>
<dt><h3>About:</h3></dt>
<dd><?= $escape->html($attributes['about']) ?></dd>
</dl>
<?php if ( ! empty($favorites)): ?> <?php if ( ! empty($favorites)): ?>
<h3>Favorites</h3> <h3>Favorites</h3>
<div class="tabs">
<?php $i = 0 ?>
<?php if ( ! empty($favorites['characters'])): ?> <?php if ( ! empty($favorites['characters'])): ?>
<h4>Characters</h4> <input type="radio" name="user-favorites" id="user-fav-chars" <?= $i === 0 ? 'checked' : '' ?> />
<section class="media-wrap"> <label for="user-fav-chars">Characters</label>
<section class="content full-width media-wrap">
<?php foreach($favorites['characters'] as $id => $char): ?> <?php foreach($favorites['characters'] as $id => $char): ?>
<?php if ( ! empty($char['image']['original'])): ?> <?php if ( ! empty($char['image']['original'])): ?>
<article class="small-character"> <article class="character">
<?php $link = $url->generate('character', ['slug' => $char['slug']]) ?> <?php $link = $url->generate('character', ['slug' => $char['slug']]) ?>
<div class="name"><?= $helper->a($link, $char['canonicalName']); ?></div> <div class="name"><?= $helper->a($link, $char['canonicalName']); ?></div>
<a href="<?= $link ?>"> <a href="<?= $link ?>">
@ -102,10 +99,12 @@ use Aviat\AnimeClient\API\Kitsu;
<?php endif ?> <?php endif ?>
<?php endforeach ?> <?php endforeach ?>
</section> </section>
<?php $i++; ?>
<?php endif ?> <?php endif ?>
<?php if ( ! empty($favorites['anime'])): ?> <?php if ( ! empty($favorites['anime'])): ?>
<h4>Anime</h4> <input type="radio" name="user-favorites" id="user-fav-anime" <?= $i === 0 ? 'checked' : '' ?> />
<section class="media-wrap"> <label for="user-fav-anime">Anime</label>
<section class="content full-width media-wrap">
<?php foreach($favorites['anime'] as $anime): ?> <?php foreach($favorites['anime'] as $anime): ?>
<article class="media"> <article class="media">
<?php <?php
@ -126,10 +125,12 @@ use Aviat\AnimeClient\API\Kitsu;
</article> </article>
<?php endforeach ?> <?php endforeach ?>
</section> </section>
<?php $i++; ?>
<?php endif ?> <?php endif ?>
<?php if ( ! empty($favorites['manga'])): ?> <?php if ( ! empty($favorites['manga'])): ?>
<h4>Manga</h4> <input type="radio" name="user-favorites" id="user-fav-manga" <?= $i === 0 ? 'checked' : '' ?> />
<section class="media-wrap"> <label for="user-fav-manga">Manga</label>
<section class="content full-width media-wrap">
<?php foreach($favorites['manga'] as $manga): ?> <?php foreach($favorites['manga'] as $manga): ?>
<article class="media"> <article class="media">
<?php <?php
@ -150,8 +151,10 @@ use Aviat\AnimeClient\API\Kitsu;
</article> </article>
<?php endforeach ?> <?php endforeach ?>
</section> </section>
<?php $i++; ?>
<?php endif ?> <?php endif ?>
</div>
<?php endif ?> <?php endif ?>
</div> </article>
</section> </section>
</main> </main>