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