Compare commits
4 Commits
4582306dc8
...
9d72a99626
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d72a99626 | |||
| 320f6d6c8b | |||
| ac79f10153 | |||
| dac1c57c98 |
@@ -58,26 +58,53 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div data-testid="test-nameItemEditor">
|
<div data-testid="test-nameItemEditor" class="flex flex-col gap-1">
|
||||||
{#if isEditing}
|
{#if isEditing}
|
||||||
|
<div class="flex items-center gap-1">
|
||||||
<input
|
<input
|
||||||
data-testid="test-input"
|
data-testid="test-input"
|
||||||
bind:this={inputRef}
|
bind:this={inputRef}
|
||||||
bind:value={localName}
|
bind:value={localName}
|
||||||
onkeydown={handleKeydown}
|
onkeydown={handleKeydown}
|
||||||
|
class="flex-1 border border-gray-300 rounded px-1.5 py-0.5 text-sm focus:outline-none focus:ring-1 focus:ring-blue-500"
|
||||||
/>
|
/>
|
||||||
<button
|
<button
|
||||||
data-testid="commit-button"
|
data-testid="commit-button"
|
||||||
disabled={!!error || localName === currentName}
|
disabled={!!error || localName === currentName}
|
||||||
onclick={commitEdit}><Check /></button
|
onclick={commitEdit}
|
||||||
|
class="text-gray-500 hover:text-green-600 transition disabled:opacity-40"
|
||||||
>
|
>
|
||||||
<button data-testid="cancel-button" onclick={cancelEdit}><X /></button>
|
<Check class="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
data-testid="cancel-button"
|
||||||
|
onclick={cancelEdit}
|
||||||
|
class="text-gray-500 hover:text-red-600 transition"
|
||||||
|
>
|
||||||
|
<X class="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
{:else}
|
{:else}
|
||||||
<span>{localName}</span>
|
<div class="flex items-center gap-1">
|
||||||
<button data-testid="edit-button" onclick={startEdit}><Edit /></button>
|
<span class="text-sm font-medium text-gray-900 truncate">{localName}</span>
|
||||||
<button data-testid="delete-button" onclick={handleDeleteClick}><Trash /></button>
|
<button
|
||||||
|
data-testid="edit-button"
|
||||||
|
onclick={startEdit}
|
||||||
|
class="text-gray-500 hover:text-blue-600 transition"
|
||||||
|
>
|
||||||
|
<Edit class="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
data-testid="delete-button"
|
||||||
|
onclick={handleDeleteClick}
|
||||||
|
class="text-gray-500 hover:text-red-600 transition"
|
||||||
|
>
|
||||||
|
<Trash class="w-4 h-4" />
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
{#if error}
|
{#if error}
|
||||||
<p class="text-red-500">{error}</p>
|
<p class="text-xs text-red-500 mt-1">{error}</p>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -102,27 +102,24 @@
|
|||||||
<li data-testid="test-list-item">
|
<li data-testid="test-list-item">
|
||||||
<a
|
<a
|
||||||
href="{ROUTE_NAMES.VORGANG(vorgangItem.vorgangToken)}"
|
href="{ROUTE_NAMES.VORGANG(vorgangItem.vorgangToken)}"
|
||||||
class="flex justify-between gap-x-6 py-5"
|
class="flex flex-col items-center justify-center gap-2 py-4 px-4 rounded-lg hover:bg-gray-50 transition text-center"
|
||||||
>
|
|
||||||
<div class="flex gap-x-4">
|
|
||||||
<Folder />
|
|
||||||
<div class="min-w-0 flex-auto">
|
|
||||||
<span class="text-sm font-semibold leading-6 text-gray-900"
|
|
||||||
>{vorgangItem.vorgangName}</span
|
|
||||||
>
|
>
|
||||||
|
<div class="flex items-center justify-center gap-3">
|
||||||
|
<Folder class="w-6 h-6 text-gray-600" />
|
||||||
|
|
||||||
|
<span class="text-sm font-semibold leading-6 text-gray-900">
|
||||||
|
{vorgangItem.vorgangName}
|
||||||
|
</span>
|
||||||
|
|
||||||
<button
|
<button
|
||||||
style="padding: 2px"
|
|
||||||
id="del__{vorgangItem.vorgangToken}"
|
id="del__{vorgangItem.vorgangToken}"
|
||||||
on:click|preventDefault={delete_item}
|
on:click|preventDefault={delete_item}
|
||||||
aria-label="Vorgang {vorgangItem.name} löschen"
|
aria-label="Vorgang {vorgangItem.name} löschen"
|
||||||
|
class="p-1.5 rounded-full text-gray-500 hover:text-red-600 hover:bg-red-50 transition"
|
||||||
>
|
>
|
||||||
<Trash />
|
<Trash class="w-4 h-4" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="hidden sm:flex sm:flex-col sm:items-end">
|
|
||||||
<p class="text-sm leading-6 text-gray-900">Vorgang</p>
|
|
||||||
</div>
|
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
@@ -198,3 +195,4 @@
|
|||||||
min-width: 24rem;
|
min-width: 24rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
|||||||
@@ -248,7 +248,7 @@ Mit freundlichen Grüßen,
|
|||||||
{#if data.vorgang && crimesList}
|
{#if data.vorgang && crimesList}
|
||||||
<div class="-z-10 bg-white">
|
<div class="-z-10 bg-white">
|
||||||
<div class="flex flex-col items-center justify-center w-full">
|
<div class="flex flex-col items-center justify-center w-full">
|
||||||
<h1 class="text-xl">Vorgang {vorgangName}</h1>
|
<h1 class="text-xl">{vorgangName}</h1>
|
||||||
|
|
||||||
{#if admin}
|
{#if admin}
|
||||||
Zugangs-PIN: {vorgangPIN}
|
Zugangs-PIN: {vorgangPIN}
|
||||||
@@ -263,50 +263,56 @@ Mit freundlichen Grüßen,
|
|||||||
<EmptyList></EmptyList>
|
<EmptyList></EmptyList>
|
||||||
{:else}
|
{:else}
|
||||||
{#each crimesList as item (item.name)}
|
{#each crimesList as item (item.name)}
|
||||||
<li data-testid="test-list-item">
|
<li
|
||||||
<div class=" flex gap-x-4">
|
data-testid="test-list-item"
|
||||||
|
class="flex items-center justify-between gap-6 py-4 px-2 hover:bg-gray-50 rounded-lg transition"
|
||||||
|
>
|
||||||
|
<div class="flex items-center gap-4 flex-1">
|
||||||
<a
|
<a
|
||||||
data-testid="crime-link"
|
data-testid="crime-link"
|
||||||
href="{ROUTE_NAMES.CRIME(vorgangToken, item.name, vorgangPIN)}"
|
href="{ROUTE_NAMES.CRIME(vorgangToken, item.name, vorgangPIN)}"
|
||||||
class=" flex justify-between gap-x-6 py-5"
|
class="flex items-center justify-center w-8 h-8 text-gray-600 hover:text-blue-600 transition"
|
||||||
aria-label="{ROUTE_NAMES.CRIME(vorgangToken, item.name, vorgangPIN)}"
|
aria-label="{ROUTE_NAMES.CRIME(vorgangToken, item.name, vorgangPIN)}"
|
||||||
title={item.name}
|
title={item.name}
|
||||||
>
|
>
|
||||||
<Cube />
|
<Cube class="w-5 h-5" />
|
||||||
</a>
|
</a>
|
||||||
<div class="min-w-0 flex-auto">
|
|
||||||
|
<div class="flex flex-col flex-1 min-w-0">
|
||||||
{#if admin}
|
{#if admin}
|
||||||
<NameItemEditor
|
<NameItemEditor
|
||||||
list={crimesList}
|
list={crimesList}
|
||||||
currentName={item.name}
|
currentName={item.name}
|
||||||
onSave={handleSave}
|
onSave={handleSave}
|
||||||
onDelete={handleDelete}
|
onDelete={handleDelete}
|
||||||
></NameItemEditor>
|
/>
|
||||||
{:else}
|
{:else}
|
||||||
<p
|
<p
|
||||||
data-testid="test-nameItem-p"
|
data-testid="test-nameItem-p"
|
||||||
class="text-sm font-semibold leading-6 text-gray-900 inline-block min-w-1"
|
class="text-sm font-semibold leading-6 text-gray-900 truncate"
|
||||||
>
|
>
|
||||||
{item.name}
|
{item.name}
|
||||||
</p>
|
</p>
|
||||||
{/if}
|
{/if}
|
||||||
|
|
||||||
|
<!-- size left, last modified right -->
|
||||||
|
<div class="flex items-center justify-between mt-1 text-xs leading-5 text-gray-500">
|
||||||
{#if item.size}
|
{#if item.size}
|
||||||
<p class="mt-1 truncate text-xs leading-5 text-gray-500">
|
<span>{shortenFileSize(item.size)}</span>
|
||||||
{shortenFileSize(item.size)}
|
{:else}
|
||||||
</p>
|
<span></span>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="hidden sm:flex sm:flex-col sm:items-end">
|
|
||||||
<p class="text-sm leading-6 text-gray-900">3D Tatort</p>
|
|
||||||
{#if item.lastModified}
|
{#if item.lastModified}
|
||||||
<p class="mt-1 text-xs leading-5 text-gray-500">
|
<span>
|
||||||
Zuletzt geändert <time datetime="2023-01-23T13:23Z"
|
Zuletzt geändert
|
||||||
>{timeElapsed(new Date(item.lastModified))}</time
|
<time datetime={item.lastModified}>
|
||||||
>
|
{timeElapsed(new Date(item.lastModified))}
|
||||||
</p>
|
</time>
|
||||||
|
</span>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{/each}
|
{/each}
|
||||||
{/if}
|
{/if}
|
||||||
|
|||||||
Reference in New Issue
Block a user