Skip to content

Commit

Permalink
style: improve table layout
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohamed-Hacene committed Dec 20, 2024
1 parent d97f224 commit caf1a76
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
8 changes: 5 additions & 3 deletions frontend/src/lib/components/ModelTable/ModelTable.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
export let regionHead: CssClasses = '';
export let regionHeadCell: CssClasses = 'uppercase bg-white text-gray-700';
export let regionBody: CssClasses = 'bg-white';
export let regionCell: CssClasses = '';
export let regionCell: CssClasses = 'text-center';
export let regionFoot: CssClasses = '';
export let regionFootCell: CssClasses = '';
Expand Down Expand Up @@ -311,9 +311,11 @@
{@const component = field_component_map[key]}
<td class={regionCell} role="gridcell">
{#if component}
<svelte:component this={component} {meta} cell={value} />
<div class="flex justify-center items-center">
<svelte:component this={component} {meta} cell={value} />
</div>
{:else}
<span class="font-token whitespace-pre-line break-words">
<span class="flex font-token whitespace-pre-line break-words justify-center items-center">
{#if Array.isArray(value)}
<ul class="list-disc pl-4 whitespace-normal">
{#each value as val}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/lib/components/ModelTable/Th.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class={_class}
data-testid="tableheader"
>
<div class="flex items-center h-full">
<div class="flex items-center h-full justify-center">
<slot />
<span
class="pl-2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@
ws4: [
{
title: safeTranslate(m.ebiosWs4_1()),
status: 'to_do',
status: data.data.meta.workshops[3].steps[0].status,
href: `${$page.url.pathname}/workshop-4/operational-scenario?activity=one&next=${$page.url.pathname}`
},
{
title: safeTranslate(m.ebiosWs4_2()),
status: 'to_do',
status: data.data.meta.workshops[3].steps[1].status,
href: `${$page.url.pathname}/workshop-4/operational-scenario?activity=two&next=${$page.url.pathname}`
}
],
Expand Down Expand Up @@ -177,11 +177,19 @@
>
<div slot="addRiskAnalysis">
<button class="flex flex-col text-left hover:text-purple-800" on:click={modalCreateForm}>
<span
class="absolute flex items-center justify-center w-8 h-8 bg-gray-100 rounded-full -start-4 ring-4 ring-white"
>
<i class="fa-solid fa-clipboard-check"></i>
</span>
{#if data.data.meta.workshops[4].steps[0].status == 'done'}
<span
class="absolute flex items-center justify-center w-8 h-8 bg-success-200 rounded-full -start-4 ring-4 ring-white"
>
<i class="fa-solid fa-check" />
</span>
{:else}
<span
class="absolute flex items-center justify-center w-8 h-8 bg-surface-200 rounded-full -start-4 ring-4 ring-white"
>
<i class="fa-solid fa-clipboard-check" />
</span>
{/if}
<h3 class="font-medium leading-tight">{m.activity()} 1</h3>
<p class="text-sm">{safeTranslate(m.ebiosWs5_1())}</p>
</button>
Expand Down

0 comments on commit caf1a76

Please sign in to comment.