From 43ffd61aebd74a9b2cbd41156b36ceb74ecbbdf6 Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Mon, 18 Nov 2024 06:02:14 -0800 Subject: [PATCH] refac: model workspace styling --- src/lib/components/workspace/Models.svelte | 234 ++++++++++----------- 1 file changed, 113 insertions(+), 121 deletions(-) diff --git a/src/lib/components/workspace/Models.svelte b/src/lib/components/workspace/Models.svelte index 678bdb86f..7c0612b0d 100644 --- a/src/lib/components/workspace/Models.svelte +++ b/src/lib/components/workspace/Models.svelte @@ -230,40 +230,14 @@ - -
-
- - - -
-
- -
-
{$i18n.t('Create a model')}
-
- {$i18n.t('Customize models for a specific purpose')} -
-
-
- -
+
{#each filteredModels as model}
- -
+
+
- -
{model.name}
-
+
+
+ +
{model.name}
+
-
- -
- {$i18n.t('By {{name}}', { - name: capitalizeFirstLetter(model?.user?.name ?? model?.user?.email) - })} +
+
+ {#if model?.meta?.description.trim()} + {model?.meta?.description} + {:else} + {model.id} + {/if}
- +
-
-
-
- {#if shiftKey} - - + +
+ +
+
+ +
+ {$i18n.t('By {{name}}', { + name: capitalizeFirstLetter(model?.user?.name ?? model?.user?.email) + })} +
- {:else} - {#if $user?.role === 'admin' || model.user_id === $user?.id} - - - - - - {/if} +
- { - shareModelHandler(model); - }} - cloneHandler={() => { - cloneModelHandler(model); - }} - exportHandler={() => { - exportModelHandler(model); - }} - hideHandler={() => { - hideModelHandler(model); - }} - deleteHandler={() => { - selectedModel = model; - showModelDeleteConfirm = true; - }} - onClose={() => {}} - > - - - -
- - { - toggleModelById(localStorage.token, model.id); - _models.set(await getModels(localStorage.token)); +
+ {#if shiftKey} + + -
- {/if} + {:else} + {#if $user?.role === 'admin' || model.user_id === $user?.id} + + + + + + {/if} + + { + shareModelHandler(model); + }} + cloneHandler={() => { + cloneModelHandler(model); + }} + exportHandler={() => { + exportModelHandler(model); + }} + hideHandler={() => { + hideModelHandler(model); + }} + deleteHandler={() => { + selectedModel = model; + showModelDeleteConfirm = true; + }} + onClose={() => {}} + > + + + +
+ + { + toggleModelById(localStorage.token, model.id); + _models.set(await getModels(localStorage.token)); + }} + /> + +
+ {/if} +
{/each}