simplify item info

master
radex 2020-05-20 22:48:23 +02:00 committed by Piotr Dobrowolski
parent 7ac99dd44b
commit 0c883bed2f
1 changed files with 35 additions and 43 deletions

View File

@ -16,6 +16,24 @@
</h2> </h2>
<div class="row"> <div class="row">
<div class="col-md-4"> <div class="col-md-4">
<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>&nbsp;&nbsp;PRINT&nbsp;x&nbsp;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 %}
<table class="table table-hover table-striped"> <table class="table table-hover table-striped">
{% if item.owner %} {% if item.owner %}
<tr><td>owner</td><td>{{ item.owner }}</td></tr> <tr><td>owner</td><td>{{ item.owner }}</td></tr>
@ -38,58 +56,32 @@
<!-- no one cares, except for dev? --> <!-- no one cares, except for dev? -->
<!-- <tr><td>pk</td><td><small>{{ item.pk }}</small></td></tr> --> <!-- <tr><td>pk</td><td><small>{{ item.pk }}</small></td></tr> -->
</table> <!-- <tr><td>short_id</td><td><small>{{ item.short_id }}</small></td></tr> -->
{% 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>&nbsp;&nbsp;PRINT&nbsp;x&nbsp;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 %} {% for category in categories %}
<tr> <tr>
<td style="padding: 0px 8px; width: 2rem;"> <td>
{% include "widgets/categoryicon.html" with category=category %} category
</td> </td>
<td> <td>
{{ category.name }} {% include "widgets/categoryicon.html" with category=category %}
<span style="padding-top: 1rem; padding-left: 10px">{{ category.name }}</span>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
{% for k, v in item.props.items %}
<tr><td>{{ k }}</td><td>{{ v|urlize }}</td></tr>
{% endfor %}
{% if labels %}
<tr><td>a.k.a.</td><td>
{% for label in labels %}
<code>{{ label.id }}</code>,
{% endfor %}
</td></tr>
{% endif %}
</table> </table>
{% endif %}
{% if images %} {% if images %}
<h3>Photos</h3> <h3>Photos</h3>