UX improvements
This commit is contained in:
parent
16ff203aaa
commit
5a70e382b8
|
@ -16,31 +16,14 @@
|
||||||
</h2>
|
</h2>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4">
|
<div class="col-md-4">
|
||||||
{% if labels %}
|
|
||||||
<h3>Labels</h3>
|
|
||||||
<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-sm 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-sm"><i class="glyphicon glyphicon-print"></i></button>
|
|
||||||
<code>{{ label.id }}</code>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<h3>Details</h3>
|
|
||||||
<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>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
{% if item.state != "present" %}
|
||||||
<tr><td>state</td><td>{{ item.state }}</td></tr>
|
<tr><td>state</td><td>{{ item.state }}</td></tr>
|
||||||
|
{% endif %}
|
||||||
{% if item.taken_by %}
|
{% if item.taken_by %}
|
||||||
<tr><td>taken by</td><td>{{ item.taken_by }}</td></tr>
|
<tr><td>taken by</td><td>{{ item.taken_by }}</td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
@ -53,9 +36,30 @@
|
||||||
<tr><td>taken until</td><td>{{ item.taken_until }}</td></tr>
|
<tr><td>taken until</td><td>{{ item.taken_until }}</td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
<tr><td>pk</td><td><small>{{ item.pk }}</small></td></tr>
|
<!-- no one cares, except for dev? -->
|
||||||
|
<!-- <tr><td>pk</td><td><small>{{ item.pk }}</small></td></tr> -->
|
||||||
</table>
|
</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 %}
|
{% if item.props.items %}
|
||||||
<h3>Properties</h3>
|
<h3>Properties</h3>
|
||||||
<table class="table table-hover table-striped">
|
<table class="table table-hover table-striped">
|
||||||
|
|
|
@ -80,12 +80,16 @@ def item_display(request, pk):
|
||||||
})
|
})
|
||||||
item = get_object_or_404(Item, pk=pk)
|
item = get_object_or_404(Item, pk=pk)
|
||||||
|
|
||||||
|
labels = item.labels.all()
|
||||||
|
has_one_label = len(labels) == 1
|
||||||
|
|
||||||
return render(request, 'item.html', {
|
return render(request, 'item.html', {
|
||||||
'item': item,
|
'item': item,
|
||||||
'categories': item.categories.all(),
|
'categories': item.categories.all(),
|
||||||
'props': sorted(item.props.items()),
|
'props': sorted(item.props.items()),
|
||||||
'images': item.images.all(),
|
'images': item.images.all(),
|
||||||
'labels': item.labels.all(),
|
'labels': labels,
|
||||||
|
'has_one_label': has_one_label,
|
||||||
'history': LogEntry.objects.filter(object_id=item.pk),
|
'history': LogEntry.objects.filter(object_id=item.pk),
|
||||||
'ancestors': item.get_ancestors(),
|
'ancestors': item.get_ancestors(),
|
||||||
'children': item.get_children().prefetch_related('categories'),
|
'children': item.get_children().prefetch_related('categories'),
|
||||||
|
|
|
@ -20,14 +20,14 @@
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
<span class="icon-bar"></span>
|
<span class="icon-bar"></span>
|
||||||
</button>
|
</button>
|
||||||
<a class="navbar-brand" href="/">spejstore</a>
|
<a class="navbar-brand" href="/">Hackerspace Storage System</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||||
<ul class="nav navbar-nav">
|
<ul class="nav navbar-nav">
|
||||||
<li><a href="/item/">Items</a></li>
|
<li><a href="/item/">Things</a></li>
|
||||||
<li><a href="/admin/">Add</a></li>
|
<li><a href="/admin/">Add thing</a></li>
|
||||||
<li><a href="https://wiki.hackerspace.pl/members:services:inventory">How to use Spejstore</a></li>
|
<li><a href="https://wiki.hackerspace.pl/members:services:inventory">How to use</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<form class="navbar-form navbar-right" role="search" action="/search">
|
<form class="navbar-form navbar-right" role="search" action="/search">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
|
|
|
@ -1,4 +1,14 @@
|
||||||
<table class="table table-striped table-hover">
|
<table class="table table-striped table-hover">
|
||||||
|
|
||||||
|
{% if item %}
|
||||||
|
<tr><td colspan=2 class="placeholder">
|
||||||
|
<a href="/admin/storage/item/add?parent={{ item.uuid }}">
|
||||||
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
|
Add child
|
||||||
|
</a>
|
||||||
|
</td></tr>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% for item in list %}
|
{% for item in list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td style="padding: 0px 8px; width: 2rem;">
|
<td style="padding: 0px 8px; width: 2rem;">
|
||||||
|
@ -29,10 +39,10 @@
|
||||||
|
|
||||||
{% if item %}
|
{% if item %}
|
||||||
<tr><td colspan=2 class="placeholder">
|
<tr><td colspan=2 class="placeholder">
|
||||||
<a href="/admin/storage/item/add?parent={{ item.uuid }}">
|
<a href="/admin/storage/item/add?parent={{ item.uuid }}">
|
||||||
<span class="glyphicon glyphicon-plus"></span>
|
<span class="glyphicon glyphicon-plus"></span>
|
||||||
Add child
|
Add child
|
||||||
</a>
|
</a>
|
||||||
</td></tr>
|
</td></tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue