Initial commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{{ project.name }} - Inventar
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Packartikel hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Artikel zur Packliste hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% load django_tables2 %}
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
<form method="post">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="overflow-x-auto rounded-xl">
|
||||
{% render_table table %}
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn mt-4 btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,37 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Inventar
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Inventarartikel hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Neuen Artikel zum globalen Inventar hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
|
||||
|
||||
<form method="post" class="space-y-4">
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="grid grid-cols-1 gap-4">
|
||||
{{ form.as_p }}
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn mt-4 btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,46 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
Inventar
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Inventar
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Globale Inventarverwaltung
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% load django_tables2 %}
|
||||
<div class="mb-8">
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4">
|
||||
<div>
|
||||
<h2 class="text-xl font-bold">Aktionen</h2>
|
||||
<p class="text-slate-400 text-sm mt-1">Inventarartikel hinzufügen</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col sm:flex-row gap-2">
|
||||
<a href="{% url 'inventory_global:add' %}" class="btn btn-add">+ Artikel</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
|
||||
<div class="mb-6">
|
||||
<h2 class="text-xl font-bold">Inventarliste</h2>
|
||||
<p class="text-slate-400 text-sm mt-1">Gelagerte und verfügbare Artikel</p>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl">
|
||||
{% render_table table %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,73 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{{ project.name }} - Inventar
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Pack-/Einkaufsliste
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Vorhandenen & benötigtes Material
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% load django_tables2 %}
|
||||
<div class="mb-8">
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
<div class="flex flex-col sm:flex-row sm:justify-between sm:items-center gap-4">
|
||||
<div>
|
||||
<h2 class="text-xl font-bold">Aktionen</h2>
|
||||
<p class="text-slate-400 text-sm mt-1">Artikel zur Packliste oder Einkaufsliste hinzufügen</p>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col sm:flex-row gap-2">
|
||||
<a href="{% url 'inventory:add' project.id %}" class="btn btn-add">+ Packliste</a>
|
||||
<a href="{% url 'inventory:shopping_add' project.id %}" class="btn btn-add">+ Einkaufsliste</a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
|
||||
<div class="mb-6">
|
||||
<h2 class="text-xl font-bold">Packliste</h2>
|
||||
<p class="text-slate-400 text-sm mt-1">Vorhandene und benötigte Artikel</p>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl">
|
||||
{% render_table table %}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors mt-8">
|
||||
|
||||
<div class="flex flex-wrap justify-between items-center mb-6">
|
||||
|
||||
<div>
|
||||
<h2 class="text-xl font-bold">
|
||||
Einkaufsliste
|
||||
</h2>
|
||||
|
||||
<p class="text-slate-400 text-sm mt-1">
|
||||
Nicht-Vorhandene und benötigte Artikel
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="overflow-x-auto rounded-xl">
|
||||
|
||||
{% render_table shopping_table %}
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,40 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}
|
||||
{{ project.name }} - Inventar
|
||||
{% endblock %}
|
||||
|
||||
{% block header_title %}
|
||||
Einkaufsartikel hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block header_description %}
|
||||
Artikel zur Einkaufsliste hinzufügen
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<div class="p-6 rounded-xl shadow bg-white dark:bg-slate-800 text-slate-900 dark:text-white transition-colors">
|
||||
<form method="post" class="space-y-4">
|
||||
|
||||
{% csrf_token %}
|
||||
|
||||
<div class="space-y-4">
|
||||
|
||||
{{ form.as_p }}
|
||||
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn mt-4 btn-save">
|
||||
|
||||
Speichern
|
||||
|
||||
</button>
|
||||
|
||||
</form>
|
||||
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,29 @@
|
||||
<form
|
||||
id="save-form-{{ record.id }}"
|
||||
method="post"
|
||||
action="{% url 'inventory:edit' project.id record.id %}">
|
||||
|
||||
{% csrf_token %}
|
||||
|
||||
<input
|
||||
type="hidden"
|
||||
name="item_id"
|
||||
value="{{ record.id }}"
|
||||
form="save-form-{{ record.id }}">
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
form="save-form-{{ record.id }}"
|
||||
class="btn btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
form="save-form-{{ record.id }}"
|
||||
formaction="{% url 'inventory:delete' project.id record.id %}"
|
||||
class="btn btn-delete">
|
||||
Löschen
|
||||
</button>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,7 @@
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
max="{{ record.available }}"
|
||||
value="0"
|
||||
name="item_{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-24">
|
||||
@@ -0,0 +1,10 @@
|
||||
{% if record.available_quantity > 0 %}
|
||||
<span class="text-green-600 font-semibold">
|
||||
{{ record.available_quantity }}
|
||||
</span>
|
||||
{% elif record.available_quantity == 0 %}
|
||||
<span class="text-orange-600 font-semibold">
|
||||
0
|
||||
</span>
|
||||
{% endif %}
|
||||
/ {{ record.quantity }}
|
||||
@@ -0,0 +1,155 @@
|
||||
<form method="post" action="{% url 'inventory_global:edit' item.id %}">
|
||||
{% csrf_token %}
|
||||
|
||||
<input type="hidden" name="item_id" value="{{ item.id }}">
|
||||
|
||||
<div class="grid md:grid-cols-2 xl:grid-cols-3 gap-4">
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Name
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="name"
|
||||
value="{{ item.name }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Beschreibung
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="description"
|
||||
value="{{ item.description }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Anzahl
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="number"
|
||||
name="quantity"
|
||||
value="{{ item.quantity }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Kategorie
|
||||
</label>
|
||||
|
||||
<select
|
||||
name="category"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
|
||||
<option value="">
|
||||
---
|
||||
</option>
|
||||
|
||||
{% for c in categories %}
|
||||
<option
|
||||
value="{{ c.id }}"
|
||||
{% if item.category_id == c.id %}selected{% endif %}>
|
||||
{{ c.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Standort
|
||||
</label>
|
||||
|
||||
<select
|
||||
name="location"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
|
||||
<option value="">
|
||||
---
|
||||
</option>
|
||||
|
||||
{% for l in locations %}
|
||||
<option
|
||||
value="{{ l.id }}"
|
||||
{% if item.location_id == l.id %}selected{% endif %}>
|
||||
{{ l.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Artikelnummer
|
||||
</label>
|
||||
|
||||
<input
|
||||
type="text"
|
||||
name="article_number"
|
||||
value="{{ item.article_number }}"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
</div>
|
||||
|
||||
|
||||
<div>
|
||||
<label class="block text-sm mb-1">
|
||||
Verantwortlicher
|
||||
</label>
|
||||
|
||||
<select
|
||||
name="responsible"
|
||||
class="border rounded px-3 py-2 w-full">
|
||||
|
||||
<option value="">
|
||||
---
|
||||
</option>
|
||||
|
||||
{% for u in users %}
|
||||
<option
|
||||
value="{{ u.id }}"
|
||||
{% if item.responsible_id == u.id %}selected{% endif %}>
|
||||
{{ u.get_full_name|default:u.username }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<div class="mt-5 flex gap-2">
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
class="btn btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
formaction="{% url 'inventory_global:delete' item.id %}"
|
||||
class="btn btn-delete">
|
||||
Löschen
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,6 @@
|
||||
<button
|
||||
type="button"
|
||||
onclick="toggleItem('{{ record.id }}')"
|
||||
class="font-bold">
|
||||
▼
|
||||
</button>
|
||||
@@ -0,0 +1,7 @@
|
||||
<input
|
||||
type="number"
|
||||
name="quantity"
|
||||
min="0"
|
||||
value="{{ record.quantity }}"
|
||||
form="save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-24">
|
||||
@@ -0,0 +1,32 @@
|
||||
<form
|
||||
id="shopping-save-form-{{ record.id }}"
|
||||
method="post"
|
||||
action="{% url 'inventory:shopping_edit' table.project.id record.id %}">
|
||||
|
||||
{% csrf_token %}
|
||||
|
||||
<input
|
||||
type="hidden"
|
||||
name="shopping_item_id"
|
||||
value="{{ record.id }}">
|
||||
|
||||
<div class="flex gap-2">
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
class="btn btn-save">
|
||||
Speichern
|
||||
</button>
|
||||
|
||||
<button
|
||||
type="submit"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
formaction="{% url 'inventory:shopping_delete' table.project.id record.id %}"
|
||||
class="btn btn-delete">
|
||||
Löschen
|
||||
</button>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@@ -0,0 +1,15 @@
|
||||
<select
|
||||
name="category"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-full">
|
||||
|
||||
<option value="">---</option>
|
||||
|
||||
{% for c in table.categories %}
|
||||
<option value="{{ c.id }}"
|
||||
{% if record.category_id == c.id %}selected{% endif %}>
|
||||
{{ c.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
@@ -0,0 +1,6 @@
|
||||
<input
|
||||
type="text"
|
||||
name="description"
|
||||
value="{{ record.description }}"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-full">
|
||||
@@ -0,0 +1,6 @@
|
||||
<input
|
||||
type="text"
|
||||
name="name"
|
||||
value="{{ record.name }}"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-full">
|
||||
@@ -0,0 +1,7 @@
|
||||
<input
|
||||
type="number"
|
||||
step="0.01"
|
||||
name="price"
|
||||
value="{{ record.price }}"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-28">
|
||||
@@ -0,0 +1,6 @@
|
||||
<input
|
||||
type="number"
|
||||
name="quantity"
|
||||
value="{{ record.quantity }}"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-24">
|
||||
@@ -0,0 +1,15 @@
|
||||
<select
|
||||
name="supplier"
|
||||
form="shopping-save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1 w-full">
|
||||
|
||||
<option value="">---</option>
|
||||
|
||||
{% for s in table.suppliers %}
|
||||
<option value="{{ s.id }}"
|
||||
{% if record.supplier_id == s.id %}selected{% endif %}>
|
||||
{{ s.name }}
|
||||
</option>
|
||||
{% endfor %}
|
||||
|
||||
</select>
|
||||
@@ -0,0 +1,21 @@
|
||||
<select
|
||||
name="status"
|
||||
form="save-form-{{ record.id }}"
|
||||
class="border rounded px-2 py-1">
|
||||
|
||||
<option value="open"
|
||||
{% if record.status == "open" %}selected{% endif %}>
|
||||
Offen
|
||||
</option>
|
||||
|
||||
<option value="packed"
|
||||
{% if record.status == "packed" %}selected{% endif %}>
|
||||
Eingepackt
|
||||
</option>
|
||||
|
||||
<option value="on_site"
|
||||
{% if record.status == "on_site" %}selected{% endif %}>
|
||||
Vor Ort
|
||||
</option>
|
||||
|
||||
</select>
|
||||
Reference in New Issue
Block a user