✨ Finished new Editor
This commit is contained in:
@@ -72,7 +72,11 @@
|
||||
<div class="col-span-5 flex flex-col">
|
||||
<div class="h-10 w-full bg-white mb-10 flex align-middle justify-center rounded-br-lg">
|
||||
{#if schemaInvalid}
|
||||
<p class="text-center w-full text-red-600 h-full">{yupErrorMessage}</p>
|
||||
<p class="text-center w-full text-red-600 h-full mt-0.5 font-semibold">
|
||||
{yupErrorMessage}
|
||||
</p>
|
||||
{:else}
|
||||
<p class="text-center w-full text-black h-full align-bottom mt-0.5">{data.title}</p>
|
||||
{/if}
|
||||
<button
|
||||
class="pr-2 align-middle bg-purple-400 pl-2 ml-auto whitespace-nowrap disabled:opacity-60 rounded-br-lg"
|
||||
|
||||
@@ -75,12 +75,13 @@
|
||||
class="bg-transparent resize-none w-full rounded text-sm"
|
||||
/>
|
||||
</div>
|
||||
<div class="w-full flex justify-center">
|
||||
<button
|
||||
type="button"
|
||||
on:click={() => {
|
||||
data.public = !data.public;
|
||||
}}
|
||||
class="text-center w-full"
|
||||
class="text-center"
|
||||
>
|
||||
{#if data.public}
|
||||
<svg
|
||||
@@ -117,6 +118,7 @@
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
{#each data.questions as question, index}
|
||||
<div
|
||||
class="bg-white shadow rounded-lg h-40 p-2 mb-6 hover:cursor-pointer drop-shadow-2xl border border-gray-500"
|
||||
|
||||
@@ -2,17 +2,18 @@
|
||||
import { signedIn } from '$lib/stores';
|
||||
|
||||
export async function load({ url, session }) {
|
||||
const quiz_id = url.searchParams.get('quiz_id');
|
||||
if (!session.authenticated) {
|
||||
return {
|
||||
status: 302,
|
||||
redirect: '/account/login?returnTo=/edit'
|
||||
redirect: `/account/login?returnTo=/edit?quiz_id=${quiz_id}`
|
||||
};
|
||||
}
|
||||
|
||||
if (session.authenticated) {
|
||||
signedIn.set(true);
|
||||
}
|
||||
const quiz_id = url.searchParams.get('quiz_id');
|
||||
|
||||
if (quiz_id === null) {
|
||||
return {
|
||||
status: 404
|
||||
|
||||
Reference in New Issue
Block a user