mirror of
https://github.com/jorgev259/soc_site-astro.git
synced 2025-06-29 07:57:41 +00:00
Compare commits
2 commits
aef06c6737
...
3a6fe133da
| Author | SHA1 | Date | |
|---|---|---|---|
| 3a6fe133da | |||
| 99d10f92cd |
1 changed files with 21 additions and 3 deletions
|
|
@ -35,7 +35,7 @@ const album = await prismaClient.albums.findUnique({
|
|||
categories: { select: { categoryName: true } },
|
||||
classifications: { select: { classificationName: true } },
|
||||
platforms: { select: { platform: { select: { id: true, name: true } } } },
|
||||
games: { select: { game: { select: { slug: true, name: true } } } },
|
||||
games: { select: { game: { select: { slug: true, name: true,series: {select: {series: {select: {slug: true, name: true}}}} } } } },
|
||||
animations: { select: { animation: { select: { id: true, title: true } } } },
|
||||
stores: { select: { url: true, provider: true }, where: { NOT: { provider: 'SOON' } } },
|
||||
discs: { select: { number: true, body: true } },
|
||||
|
|
@ -51,6 +51,7 @@ const album = await prismaClient.albums.findUnique({
|
|||
|
||||
if (!album) return Astro.redirect("/404");
|
||||
|
||||
const series = album.games.map(g => g.game.series).flat().map(s => s.series)
|
||||
const { currentLocale } = Astro
|
||||
const coverImage = await getImage({
|
||||
src: `https://cdn.sittingonclouds.net/album/${album?.id}.png`,
|
||||
|
|
@ -186,7 +187,7 @@ const coverImage = await getImage({
|
|||
{platform.name}
|
||||
</span>
|
||||
) : (
|
||||
<a class='btn btn-link p-0' href={`/platform/${id}`}>
|
||||
<a class='btn btn-link p-0' href={`/platform/${platform.id}`}>
|
||||
{platform.name}
|
||||
</a>
|
||||
)}
|
||||
|
|
@ -197,6 +198,23 @@ const coverImage = await getImage({
|
|||
</tr>
|
||||
)
|
||||
}
|
||||
{
|
||||
series.length > 0 && (
|
||||
<tr>
|
||||
<th class='mr-2'>{m.series()}</th>
|
||||
<td>
|
||||
{series.map((s, i) => (
|
||||
<Fragment key={s.slug}>
|
||||
<a class='btn btn-link p-0' href={`/series/${s.slug}`}>
|
||||
{s.name}
|
||||
</a>
|
||||
{i !== series.length - 1 && ', '}
|
||||
</Fragment>
|
||||
))}
|
||||
</td>
|
||||
</tr>
|
||||
)
|
||||
}
|
||||
{
|
||||
(album?.games.length ?? 0) > 0 && (
|
||||
<tr>
|
||||
|
|
@ -221,7 +239,7 @@ const coverImage = await getImage({
|
|||
<td>
|
||||
{album?.animations.map(({ animation }, i) => (
|
||||
<Fragment key={id}>
|
||||
<a class='btn btn-link p-0' href={`/anim/${id}`}>
|
||||
<a class='btn btn-link p-0' href={`/anim/${animation.id}`}>
|
||||
{animation.title}
|
||||
</a>
|
||||
{i !== album?.animations.length - 1 && ', '}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue