edit form refactor

This commit is contained in:
2024-03-26 01:58:05 +02:00
parent 02224eb580
commit 2e95fca8ad
7 changed files with 72 additions and 55 deletions
+54 -41
View File
@@ -32,55 +32,68 @@
}
</script>
<div class="d-flex gap-2">
{#if editable}
<div
class="card mb-2 bg-light w-50 "
style="border-color:{schema.color ?? '#ccc'}; border-width: 1px;"
>
<div class="card-body">
Edge Data
<div class="position-absolute d-flex end-0" style="top:5px">
<button
class="trash-button text-dark btn btn-sm btn-link"
on:click={edit}
>
<Icon icon="pencil"/>
</button>
</div>
</div>
</div>
<div
<EdgeData bind:this={edgeData} {field} {edge}/>
{/if}
class="card mb-2 bg-light {classes}"
style="border-color:{schema.color ?? '#ccc'}; border-width: 1px;"
>
<div class="card-body">
<Preview {record} type="card"/>
{#if editable}
<EdgeData bind:this={edgeData} {field} {edge}/>
{/if}
<!-- <div class="overflow-hidden">-->
<!-- <a-->
<!-- class="title-link m-0 fs-5 text-decoration-none text-dark d-block"-->
<!-- href="{channel.lucentUrl}/records/{record.id}"-->
<!-- title={cardTitle}-->
<!-- >-->
<!-- {cardTitle}-->
<!-- </a>-->
<!-- <small class="text-muted">-->
<!-- {schema.label}-->
<!-- </small>-->
<!-- <small class="text-muted">-->
<!-- {#if record.status === "draft"}-->
<!-- <Status status={record.status} />-->
<!-- {/if}-->
<!-- </small>-->
<!-- </div>-->
</div>
<div
class="card mb-2 bg-light w-100 {classes}"
style="border-color:{schema.color ?? '#ccc'}; border-width: 1px;"
>
<div class="card-body">
<Preview {record} type="card"/>
<!-- <div class="overflow-hidden">-->
<!-- <a-->
<!-- class="title-link m-0 fs-5 text-decoration-none text-dark d-block"-->
<!-- href="{channel.lucentUrl}/records/{record.id}"-->
<!-- title={cardTitle}-->
<!-- >-->
<!-- {cardTitle}-->
<!-- </a>-->
<!-- <small class="text-muted">-->
<!-- {schema.label}-->
<!-- </small>-->
<!-- <small class="text-muted">-->
<!-- {#if record.status === "draft"}-->
<!-- <Status status={record.status} />-->
<!-- {/if}-->
<!-- </small>-->
<!-- </div>-->
</div>
{#if hasDelete}
<div class="position-absolute d-flex end-0" style="top:5px">
{#if hasDelete}
<div class="position-absolute d-flex end-0" style="top:5px">
{#if editable}
<button
class="trash-button text-dark btn btn-sm btn-link"
on:click={edit}
on:click={remove}
>
<Icon icon="pencil"/>
<Icon icon="trash-can"/>
</button>
{/if}
<button
class="trash-button text-dark btn btn-sm btn-link"
on:click={remove}
>
<Icon icon="trash-can"/>
</button>
</div>
{/if}
</div>
{/if}
</div>
</div>
<style>