Browse Source

preparing stock module

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
module/stock.v2
Stephan Richter 3 weeks ago
parent
commit
fea21872e3
  1. 2
      frontend/src/App.svelte
  2. 1
      frontend/src/Components/Menu.svelte
  3. 66
      frontend/src/routes/stock/Index.svelte
  4. 14
      frontend/src/routes/stock/ItemList.svelte
  5. 5
      frontend/src/routes/stock/ItemProps.svelte
  6. 12
      frontend/src/routes/stock/Locations.svelte
  7. 1
      translations/src/main/resources/de.json

2
frontend/src/App.svelte

@ -28,6 +28,7 @@ @@ -28,6 +28,7 @@
import ResetPw from "./routes/user/ResetPw.svelte";
import Search from "./routes/search/Search.svelte";
import SendDoc from "./routes/document/Send.svelte";
import Stock from './routes/stock/Index.svelte';
import TagUses from "./routes/tags/TagUses.svelte";
import TaskList from "./routes/task/Index.svelte";
import Times from "./routes/time/Index.svelte";
@ -96,6 +97,7 @@ @@ -96,6 +97,7 @@
<Route path="/project/:id/kanban" component={Kanban} />
<Route path="/project/:id/view" component={ViewPrj} />
<Route path="/search" component={Search} />
<Route path="/stock" component={Stock} />
<Route path="/tags/use/:tag" component={TagUses} />
<Route path="/task" component={TaskList} />
<Route path="/task/:parent_task_id/add_subtask" component={AddTask} />

1
frontend/src/Components/Menu.svelte

@ -63,6 +63,7 @@ onMount(fetchModules); @@ -63,6 +63,7 @@ onMount(fetchModules);
<a href="/time" {onclick}>{t('timetracking')}</a>
<a href="/wiki" {onclick}>{t('wiki')}</a>
<a href="/contact" {onclick}>{t('contacts')}</a>
<a href="/stock" {onclick}>{t('stock')}</a>
{#if user.id == 2}
<a href="https://svelte.dev/tutorial/svelte/state" target="_blank">{t('tutorial')}</a>
{/if}

66
frontend/src/routes/stock/Index.svelte

@ -0,0 +1,66 @@ @@ -0,0 +1,66 @@
<script>
import Locations from './Locations.svelte';
import ItemList from './ItemList.svelte';
import ItemProps from './ItemProps.svelte';
import { t } from '../../translations.svelte';
let companies = [
{
id: 1,
name: 'SRSoftware',
locations:{
Langenorla:{
Hauptgebäude:{
Obergeschoss:{
},
Untergeschoss:{
Einliegerwohnung:{
Bad:{
},
Küche:{
},
Wohnzimmer:{
}
},
Flur:{
},
Küche:{
},
Studio:{
}
},
Werkstatt:{
}
},
Nebengebäude:{
},
Grundstück:{
}
}
}
},
{ id: 2, name: 'Alrauna', locations: {} }
]
</script>
<h2>{t('Stock')}</h2>
<table>
<tbody>
<tr>
<td class="locations">
{#each companies as company}
<h3>{company.name}</h3>
<Locations locations={company.locations} />
{/each}
</td>
<td class="items">
<ItemList />
</td>
<td class="properties">
<ItemProps />
</td>
</tr>
</tbody>
</table>

14
frontend/src/routes/stock/ItemList.svelte

@ -0,0 +1,14 @@ @@ -0,0 +1,14 @@
<script>
import { t } from '../../translations.svelte';
</script>
<ul>
<li>
<button>
<span></span>
{t('add_object',{object:'item'})}
</button>
</li>
<li>Item 1</li>
<li>Item 2</li>
<li>Item 3</li>
</ul>

5
frontend/src/routes/stock/ItemProps.svelte

@ -0,0 +1,5 @@ @@ -0,0 +1,5 @@
<ul>
<li>Prop 1</li>
<li>Prop 2</li>
<li>Prop 3</li>
</ul>

12
frontend/src/routes/stock/Locations.svelte

@ -0,0 +1,12 @@ @@ -0,0 +1,12 @@
<script>
let { locations } = $props();
</script>
<ul>
{#each Object.entries(locations) as [k,v]}
<li>
{k}
<svelte:self locations={v} />
</li>
{/each}
</ul>

1
translations/src/main/resources/de.json

@ -116,6 +116,7 @@ @@ -116,6 +116,7 @@
"IMPERSONATE": "Nutzer wechseln",
"index_page": "Aufgabenübersicht",
"invoice": "Rechnung",
"item": "Artikel",
"items": "Artikel",
"join_objects" : "{objects} zusammenführen",

Loading…
Cancel
Save