update
This commit is contained in:
62
templates/inventory/dashboard.html
Normal file
62
templates/inventory/dashboard.html
Normal file
@@ -0,0 +1,62 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}Dashboard | Arbit{% endblock %}
|
||||
{% block content %}
|
||||
<section class="grid grid-3">
|
||||
<div class="card"><div class="muted">Items</div><h2>{{ stats.item_count }}</h2></div>
|
||||
<div class="card"><div class="muted">Sold</div><h2>{{ stats.sold_count }}</h2></div>
|
||||
<div class="card"><div class="muted">Inventory cost</div><h2>${{ stats.inventory_value }}</h2></div>
|
||||
</section>
|
||||
|
||||
<section style="margin-top: 1rem; display:flex; justify-content:space-between; align-items:center; gap:1rem;">
|
||||
<div style="flex:1">
|
||||
<h2>Current items</h2>
|
||||
<div class="muted">Focus on inventory, suggested resale pricing, and quick actions.</div>
|
||||
</div>
|
||||
<div>
|
||||
<a href="{% url 'item-create' %}" style="background:var(--accent); color:white; padding:0.6rem 1rem; border-radius:10px;">Add item</a>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="card" style="margin-top: 1rem;">
|
||||
<h3>Search inventory</h3>
|
||||
<form method="get" class="grid grid-3">
|
||||
{{ item_filter.query.label_tag }}{{ item_filter.query }}
|
||||
{{ item_filter.status.label_tag }}{{ item_filter.status }}
|
||||
{{ item_filter.category.label_tag }}{{ item_filter.category }}
|
||||
{{ item_filter.created_by.label_tag }}{{ item_filter.created_by }}
|
||||
{{ item_filter.min_purchase_price.label_tag }}{{ item_filter.min_purchase_price }}
|
||||
{{ item_filter.max_purchase_price.label_tag }}{{ item_filter.max_purchase_price }}
|
||||
{{ item_filter.min_profit.label_tag }}{{ item_filter.min_profit }}
|
||||
<div style="grid-column: 1 / -1;"><button type="submit">Filter</button></div>
|
||||
</form>
|
||||
</section>
|
||||
|
||||
<section class="card" style="margin-top: 1rem; overflow-x: auto;">
|
||||
<h3>Latest items</h3>
|
||||
<table>
|
||||
<thead>
|
||||
<tr><th>Title</th><th>Category</th><th>Status</th><th>Cost</th><th>Creator</th><th>Profit</th></tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in items %}
|
||||
<tr>
|
||||
<td><a href="{{ item.get_absolute_url }}">{{ item.title }}</a></td>
|
||||
<td>{{ item.category }}</td>
|
||||
<td>{{ item.get_status_display }}</td>
|
||||
<td>${{ item.purchase_price }}</td>
|
||||
<td>{{ item.created_by.username }}</td>
|
||||
<td>{% if item.profit is not None %}${{ item.profit }}{% else %}<span class="muted">Pending sale</span>{% endif %}</td>
|
||||
</tr>
|
||||
{% empty %}
|
||||
<tr><td colspan="6" class="muted">No items yet.</td></tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</section>
|
||||
|
||||
<section class="grid grid-3" style="margin-top: 1rem;">
|
||||
<div class="card"><div class="muted">Inventory cost</div><h2>${{ stats.inventory_value }}</h2></div>
|
||||
<div class="card"><div class="muted">Profit total</div><h2>${{ stats.profit_total }}</h2></div>
|
||||
<div class="card"><div class="muted">Sold count</div><h2>{{ stats.sold_count }}</h2></div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user