update
This commit is contained in:
74
templates/inventory/item_detail.html
Normal file
74
templates/inventory/item_detail.html
Normal file
@@ -0,0 +1,74 @@
|
||||
{% extends "base.html" %}
|
||||
{% block title %}{{ object.title }} | Arbit{% endblock %}
|
||||
{% block content %}
|
||||
<section class="grid grid-2">
|
||||
<div class="card">
|
||||
<div class="spaced">
|
||||
<div>
|
||||
<h1>{{ object.title }}</h1>
|
||||
<div class="muted">Added by {{ object.created_by.username }} on {{ object.created_at }}</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<a href="{% url 'item-edit' object.pk %}">Edit</a>
|
||||
<a href="{% url 'item-mark-sold' object.pk %}">Mark sold</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<dl class="grid grid-2">
|
||||
<div><dt class="muted">Category</dt><dd>{{ object.category }}</dd></div>
|
||||
<div><dt class="muted">Status</dt><dd>{{ object.get_status_display }}</dd></div>
|
||||
<div><dt class="muted">Purchase price</dt><dd>${{ object.purchase_price }}</dd></div>
|
||||
<div><dt class="muted">Estimated resale</dt><dd>{% if object.estimated_resale_price %}${{ object.estimated_resale_price }}{% else %}<span class="muted">Not set</span>{% endif %}</dd></div>
|
||||
<div><dt class="muted">Sold price</dt><dd>{% if object.sold_price %}${{ object.sold_price }}{% else %}<span class="muted">Not sold</span>{% endif %}</dd></div>
|
||||
<div><dt class="muted">Profit</dt><dd>{% if object.profit is not None %}${{ object.profit }}{% else %}<span class="muted">Pending sale</span>{% endif %}</dd></div>
|
||||
</dl>
|
||||
|
||||
<p>{{ object.notes|linebreaksbr }}</p>
|
||||
</div>
|
||||
|
||||
<div class="grid">
|
||||
<div class="card">
|
||||
<h2>Sold details</h2>
|
||||
<div class="muted">Suggested price: ${{ pricing_suggestion.price }} from {{ pricing_suggestion.source }}</div>
|
||||
<p class="muted">{{ pricing_suggestion.notes }}</p>
|
||||
<form method="post" action="{% url 'item-mark-sold' object.pk %}" class="grid">
|
||||
{% csrf_token %}
|
||||
{{ sold_form.as_p }}
|
||||
<button type="submit">Save sold details</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<h2>Add note</h2>
|
||||
<form method="post" action="{% url 'item-note-create' object.pk %}" class="grid">
|
||||
{% csrf_token %}
|
||||
{{ note_form.as_p }}
|
||||
<button type="submit">Save note</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="grid grid-2" style="margin-top: 1rem;">
|
||||
<div class="card">
|
||||
<h2>Price history</h2>
|
||||
<ul>
|
||||
{% for estimate in price_estimates %}
|
||||
<li>{{ estimate.source }}: ${{ estimate.estimated_price }} on {{ estimate.retrieved_at }}</li>
|
||||
{% empty %}
|
||||
<li class="muted">No price estimates yet.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card">
|
||||
<h2>Notes</h2>
|
||||
<ul>
|
||||
{% for note in notes %}
|
||||
<li><strong>{{ note.created_by.username }}</strong> - {{ note.body }} <span class="muted">({{ note.created_at }})</span></li>
|
||||
{% empty %}
|
||||
<li class="muted">No notes yet.</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
</div>
|
||||
</section>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user