feat(artists): change albums table to grid on artist pages
This commit is contained in:
parent
80b0499550
commit
9b4baad5fb
14 changed files with 180 additions and 88 deletions
|
@ -368,7 +368,9 @@ article {
|
|||
}
|
||||
|
||||
h3 {
|
||||
margin-top: 0;
|
||||
&:not(:has(svg)) {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
&:has(+ .tags) {
|
||||
margin-bottom: 0;
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
require __DIR__ . "/../../vendor/autoload.php";
|
||||
require __DIR__ . "/../../server/utils/init.php";
|
||||
|
||||
use App\Classes\GlobalsFetcher;
|
||||
use App\Classes\ArtistFetcher;
|
||||
use voku\helper\HtmlMin;
|
||||
|
||||
|
@ -11,8 +12,8 @@
|
|||
|
||||
if (strpos($url, "music/artists/") !== 0) redirectTo404();
|
||||
|
||||
$fetcher = new ArtistFetcher();
|
||||
$artist = $fetcher->fetch($url);
|
||||
$globals = (new GlobalsFetcher())->fetch();
|
||||
$artist = (new ArtistFetcher())->fetch($url);
|
||||
|
||||
if (!$artist) redirectTo404();
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
if (!preg_match('/^reading\/books\/([\dXx-]+)$/', $url)) redirectTo404();
|
||||
|
||||
$fetcher = new BookFetcher();
|
||||
$book = $fetcher->fetch($url);
|
||||
$book = (new BookFetcher())->fetch($url);
|
||||
|
||||
if (!$book) redirectTo404();
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
if (!preg_match('/^music\/genres\/[\w-]+$/', $url)) redirectTo404();
|
||||
|
||||
$fetcher = new GenreFetcher();
|
||||
$genre = $fetcher->fetch($url);
|
||||
$genre = (new GenreFetcher())->fetch($url);
|
||||
|
||||
if (!$genre) redirectTo404();
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
if (!preg_match('/^watching\/movies\/[\w-]+$/', $url)) redirectTo404();
|
||||
|
||||
$fetcher = new MovieFetcher();
|
||||
$movie = $fetcher->fetch($url);
|
||||
$movie = (new MovieFetcher())->fetch($url);
|
||||
|
||||
if (!$movie) redirectTo404();
|
||||
|
||||
|
|
|
@ -11,8 +11,7 @@
|
|||
|
||||
if (!preg_match('/^watching\/shows\/[\w-]+$/', $url)) redirectTo404();
|
||||
|
||||
$fetcher = new ShowFetcher();
|
||||
$show = $fetcher->fetch($url);
|
||||
$show = (new ShowFetcher())->fetch($url);
|
||||
|
||||
if (!$show) redirectTo404();
|
||||
|
||||
|
|
|
@ -27,8 +27,7 @@
|
|||
|
||||
$page = isset($matches[2]) ? max(1, (int)$matches[2]) : 1;
|
||||
$pageSize = 20;
|
||||
$fetcher = new TagFetcher();
|
||||
$tagged = $fetcher->fetch($tag, $page, $pageSize);
|
||||
$tagged = (new TagFetcher())->fetch($tag, $page, $pageSize);
|
||||
|
||||
if (!$tagged || count($tagged) === 0) {
|
||||
header("Location: /404/", true, 302);
|
||||
|
|
|
@ -103,20 +103,13 @@ schema: artist
|
|||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<table>
|
||||
<tr>
|
||||
<th>Album</th>
|
||||
<th>Plays</th>
|
||||
<th>Year</th>
|
||||
</tr>
|
||||
<?php foreach ($artist["albums"] as $album): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($album["name"]) ?></td>
|
||||
<td><?= $album["total_plays"] > 0 ? $album["total_plays"] : "-" ?></td>
|
||||
<td><?= $album["release_year"] ?></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</table>
|
||||
<?php if (!empty($artist["albums"])): ?>
|
||||
<h3>
|
||||
<?= getTablerIcon('vinyl') ?>
|
||||
Albums
|
||||
</h3>
|
||||
<?php renderMediaGrid($artist["albums"], $globals["cdn_url"]); ?>
|
||||
<?php endif; ?>
|
||||
</article>
|
||||
<?php
|
||||
$html = ob_get_clean();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue