133 lines
5.1 KiB
HTML
133 lines
5.1 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block content %}
|
|
<ol class="breadcrumb">
|
|
<li><a href="/item/">All</a></li>
|
|
{% for ancestor in ancestors %}
|
|
<li><a href="{{ ancestor.get_absolute_url }}">{{ ancestor.name }}</a></li>
|
|
{% endfor %}
|
|
<li class="active">{{ item.name }}</li>
|
|
</ol>
|
|
<h2>
|
|
<small class="pull-right"><a href="{% url 'admin:storage_item_change' item.pk %}"><span class="glyphicon glyphicon-pencil"></span></a></small>
|
|
|
|
{% include "widgets/categoryicon.html" with category=item.primary_category %}
|
|
{{ item.name }}
|
|
</h2>
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<table class="table table-hover table-striped">
|
|
{% if item.owner %}
|
|
<tr><td>owner</td><td>{{ item.owner }}</td></tr>
|
|
{% endif %}
|
|
|
|
{% if item.state != "present" %}
|
|
<tr><td>state</td><td>{{ item.state }}</td></tr>
|
|
{% endif %}
|
|
{% if item.taken_by %}
|
|
<tr><td>taken by</td><td>{{ item.taken_by }}</td></tr>
|
|
{% endif %}
|
|
|
|
{% if item.taken_on %}
|
|
<tr><td>taken on</td><td>{{ item.taken_on }}</td></tr>
|
|
{% endif %}
|
|
|
|
{% if item.taken_until %}
|
|
<tr><td>taken until</td><td>{{ item.taken_until }}</td></tr>
|
|
{% endif %}
|
|
|
|
<!-- no one cares, except for dev? -->
|
|
<!-- <tr><td>pk</td><td><small>{{ item.pk }}</small></td></tr> -->
|
|
</table>
|
|
|
|
{% if labels and not has_one_label %}
|
|
<h3>Labels</h3>
|
|
{% endif %}
|
|
<iframe name="printframe" style="display: none"></iframe>
|
|
{% for label in labels %}
|
|
<div class="label-item">
|
|
<form action="/api/1/labels/{{ label.id }}/print/?quantity=2" method="POST" target="printframe" onsubmit="return confirm('Want to print 2 labels?')" style="display:inline-block">
|
|
{% csrf_token %}
|
|
<button class="btn btn-default btn-lg btn-primary"><i class="glyphicon glyphicon-print"></i> PRINT x 2</button>
|
|
</form>
|
|
<form action="/api/1/labels/{{ label.id }}/print" method="POST" target="printframe" onsubmit="return confirm('Want to print this labels?')" style="display:inline-block">
|
|
{% csrf_token %}
|
|
<button class="btn btn-default btn-lg"><i class="glyphicon glyphicon-print"></i></button>
|
|
{% if not has_one_label %}
|
|
<code>{{ label.id }}</code>
|
|
{% endif %}
|
|
</form>
|
|
</div>
|
|
{% endfor %}
|
|
|
|
{% if item.props.items %}
|
|
<h3>Properties</h3>
|
|
<table class="table table-hover table-striped">
|
|
<thead>
|
|
<tr>
|
|
<th>key</th>
|
|
<th>value</th>
|
|
</tr>
|
|
</thead>
|
|
{% for k, v in item.props.items %}
|
|
<tr><td>{{ k }}</td><td>{{ v|urlize }}</td></tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
|
|
{% if categories %}
|
|
<h3>Categories</h3>
|
|
<table class="table table-hover table-striped">
|
|
{% for category in categories %}
|
|
<tr>
|
|
<td style="padding: 0px 8px; width: 2rem;">
|
|
{% include "widgets/categoryicon.html" with category=category %}
|
|
</td>
|
|
<td>
|
|
{{ category.name }}
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
|
|
{% if images %}
|
|
<h3>Photos</h3>
|
|
<div class="row">
|
|
{% for image in images %}
|
|
<div class="col-md-6">
|
|
<a href="{{ image.image.url }}">
|
|
<img src="{{ image.image.url }}" class="img-responsive img-thumbnail" />
|
|
</a>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if history %}
|
|
<h3>Changes</h3>
|
|
<table class="table table-striped table-hover">
|
|
{% for entry in history %}
|
|
<tr>
|
|
<td class="{% if entry.is_addition %}text-success{% endif %}">
|
|
<b>{{ entry.user }}</b>
|
|
<small>@ {{ entry.action_time }}</small><br />
|
|
{{ entry.get_change_message }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</table>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-md-8">
|
|
{% if item.description %}
|
|
{% load md2 %}
|
|
{{ item.description|markdown:"code-color" }}
|
|
{% endif %}
|
|
|
|
<h3>Children</h3>
|
|
{% include "widgets/itemlist.html" with list=children|dictsort:"name" item=item %}
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|