Fix revival links and show un-reviewed revivals as such on their review pages

This commit is contained in:
Lewin Kelly 2023-07-19 17:24:33 +01:00
parent c096f59913
commit e368722b9f
No known key found for this signature in database
GPG Key ID: C103AD9C84014FD7
3 changed files with 32 additions and 26 deletions

View File

@ -43,30 +43,38 @@
<hr class="mb-4 mt-3" />
<div class="content pt-0.01 text-justify">
<div class="post mb-10">
<svelte:component this={data.content} />
{#if data.rating}
<div class="content pt-0.01 text-justify">
<div class="post mb-10">
<svelte:component this={data.content} />
</div>
<h1>Rating</h1>
<table>
{#each Object.keys(ratingCategories) as category}
<tr>
<td
class:pt-4={category == "overall"}
class="pe-6">
{category.charAt(0).toUpperCase() +
category.slice(1)}
</td>
<td class:pt-4={category == "overall"}>
<Stars
rating={ratingCategories[
category
]} />
</td>
</tr>
{/each}
</table>
</div>
<h1>Rating</h1>
<table>
{#each Object.keys(ratingCategories) as category}
<tr>
<td
class:pt-4={category == "overall"}
class="pe-6">
{category.charAt(0).toUpperCase() +
category.slice(1)}
</td>
<td class:pt-4={category == "overall"}>
<Stars
rating={ratingCategories[category]} />
</td>
</tr>
{/each}
</table>
</div>
{:else}
<h2 class="font-300 text-center tracking-wide">
This revival has not yet been reviewed. Watch this space!
</h2>
{/if}
</div>
</div>
</article>

View File

@ -10,8 +10,6 @@ export async function load({ params }) {
throw error(404, "Revival not found")
}
if (!data.metadata.rating) throw error(404, "Revival not found")
let revivals = await (await loadParent()).revivals
// remove the current revival from the list

View File

@ -36,7 +36,7 @@
<div class="grid gap-4 md:grid-cols-2 xl:grid-cols-3">
{#each revivals as revival}
<a
href={revival.rating ? `/revival/${revival.path}` : "/"}
href="/revival/{revival.path}"
class="txt bg-#1f1c1d @light:bg-white rounded-2
@light:text-black box-border flex flex-col p-5 text-white
{revival?.rating ? 'card transition hover:shadow-xl' : 'pointer-events-none'}">