- {% if labels %}
-
Labels
-
- {% for label in labels %}
-
-
-
-
- {% endfor %}
- {% endif %}
-
-
Details
{% if item.owner %}
owner | {{ item.owner }} |
{% endif %}
+ {% if item.state != "present" %}
state | {{ item.state }} |
+ {% endif %}
{% if item.taken_by %}
taken by | {{ item.taken_by }} |
{% endif %}
@@ -53,9 +36,30 @@
taken until | {{ item.taken_until }} |
{% endif %}
- pk | {{ item.pk }} |
+
+
+ {% if labels and not has_one_label %}
+
Labels
+ {% endif %}
+
+ {% for label in labels %}
+
+
+
+
+ {% endfor %}
+
{% if item.props.items %}
Properties
diff --git a/storage/views.py b/storage/views.py
index 674e2b2..ccc3172 100644
--- a/storage/views.py
+++ b/storage/views.py
@@ -80,12 +80,16 @@ def item_display(request, pk):
})
item = get_object_or_404(Item, pk=pk)
+ labels = item.labels.all()
+ has_one_label = len(labels) == 1
+
return render(request, 'item.html', {
'item': item,
'categories': item.categories.all(),
'props': sorted(item.props.items()),
'images': item.images.all(),
- 'labels': item.labels.all(),
+ 'labels': labels,
+ 'has_one_label': has_one_label,
'history': LogEntry.objects.filter(object_id=item.pk),
'ancestors': item.get_ancestors(),
'children': item.get_children().prefetch_related('categories'),
diff --git a/templates/base.html b/templates/base.html
index 6e5eef6..d322ab2 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -20,14 +20,14 @@
- spejstore
+ Hackerspace Storage System