preparing editing of stock items

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-10-14 08:49:50 +02:00
parent a52df2b434
commit 6e7cb813d3
3 changed files with 47 additions and 17 deletions

View File

@@ -41,10 +41,8 @@
</script> </script>
<h2>{t('Stock')}</h2> <h2>{t('Stock')}</h2>
<table> <div class="grid3">
<tbody> <div class="locations">
<tr>
<td class="locations">
{#if top_level} {#if top_level}
{#each top_level as realm,idx} {#each top_level as realm,idx}
<h3>{realm.name}</h3> <h3>{realm.name}</h3>
@@ -53,19 +51,31 @@
{/if} {/if}
{/each} {/each}
{/if} {/if}
</td> </div>
<td class="items"> <div class="items">
{#await items} {#await items}
<span>loading…</span> <span>loading…</span>
{:then data} {:then data}
{#if location} {#if location}
<h3>{location.name}</h3> <h3>{location.name}</h3>
{/if} {/if}
<ItemList items={data.sort((a,b) => a.code.localeCompare(b.code))} bind:selected={item} /> <ItemList items={data?.sort((a,b) => a.code.localeCompare(b.code))} bind:selected={item} />
{/await} {/await}
</div>
<div class="properties">
<ItemProps {item} />
</div>
</div>
<table>
<tbody>
<tr>
<td class="locations">
</td>
<td class="items">
</td> </td>
<td class="properties"> <td class="properties">
<ItemProps {item} />
</td> </td>
</tr> </tr>
</tbody> </tbody>

View File

@@ -1,4 +1,5 @@
<script> <script>
import { t} from '../../translations.svelte';
let { item } = $props(); let { item } = $props();
</script> </script>
@@ -17,6 +18,20 @@
</td> </td>
</tr> </tr>
{/each} {/each}
<tr>
<td>
<select>
<option>this is an existing property</option>
<option>B</option>
<option>C</option>
</select><br/>
<input type="text" placeholder="new prop"/>
</td>
<td>
<input type="text" />
<button>{t('save')}</button>
</td>
</tr>
</tbody> </tbody>
</table> </table>
{/if} {/if}

View File

@@ -377,6 +377,11 @@ a.wikilink{
padding-right: 5px; padding-right: 5px;
} }
.grid3{
display: flex;
flex-flow: wrap;
}
@media screen and (max-width: 600px) { @media screen and (max-width: 600px) {
.grid2{ .grid2{
display: grid; display: grid;