diff --git a/inventory/static/inventory/css/cell.css b/inventory/static/inventory/css/cell.css index 7464327..7b90163 100644 --- a/inventory/static/inventory/css/cell.css +++ b/inventory/static/inventory/css/cell.css @@ -46,6 +46,10 @@ td.disabled { align-items: center; } +.search-hilight { + background-color: #ffa0a0; +} + .cell:nth-child(2n) { background-color: #f8f8f8; } diff --git a/inventory/templates/inventory/box-generic.html b/inventory/templates/inventory/box-generic.html index 06df8a7..995ea02 100644 --- a/inventory/templates/inventory/box-generic.html +++ b/inventory/templates/inventory/box-generic.html @@ -15,7 +15,7 @@

Items

{% endif %} diff --git a/inventory/templates/inventory/box-ikea-glis.html b/inventory/templates/inventory/box-ikea-glis.html index 61a2940..2dd489e 100644 --- a/inventory/templates/inventory/box-ikea-glis.html +++ b/inventory/templates/inventory/box-ikea-glis.html @@ -9,7 +9,7 @@
{% for compartment in layouted.0.0 %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -17,7 +17,7 @@
{% for compartment in layouted.0.1 %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -27,7 +27,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-ikea-samla.html b/inventory/templates/inventory/box-ikea-samla.html index 99eec55..2ed455b 100644 --- a/inventory/templates/inventory/box-ikea-samla.html +++ b/inventory/templates/inventory/box-ikea-samla.html @@ -9,7 +9,7 @@
{% for compartment in layouted.0 %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-pollin-sorter.html b/inventory/templates/inventory/box-pollin-sorter.html index 79283cc..7a7f1f3 100644 --- a/inventory/templates/inventory/box-pollin-sorter.html +++ b/inventory/templates/inventory/box-pollin-sorter.html @@ -10,7 +10,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -20,7 +20,7 @@
{% for compartment in layouted.1.0 %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -29,7 +29,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -40,7 +40,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-raaco-1240-123.html b/inventory/templates/inventory/box-raaco-1240-123.html index b4bad95..ea49f3b 100644 --- a/inventory/templates/inventory/box-raaco-1240-123.html +++ b/inventory/templates/inventory/box-raaco-1240-123.html @@ -11,7 +11,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -27,7 +27,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -42,7 +42,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-raaco-616-123.html b/inventory/templates/inventory/box-raaco-616-123.html index 14fd110..7f70e7a 100644 --- a/inventory/templates/inventory/box-raaco-616-123.html +++ b/inventory/templates/inventory/box-raaco-616-123.html @@ -11,7 +11,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -27,7 +27,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -42,7 +42,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-raaco-928-123.html b/inventory/templates/inventory/box-raaco-928-123.html index b922e01..cb09638 100644 --- a/inventory/templates/inventory/box-raaco-928-123.html +++ b/inventory/templates/inventory/box-raaco-928-123.html @@ -11,7 +11,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -27,7 +27,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -42,7 +42,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-raaco-even.html b/inventory/templates/inventory/box-raaco-even.html index ad8e507..dbae836 100644 --- a/inventory/templates/inventory/box-raaco-even.html +++ b/inventory/templates/inventory/box-raaco-even.html @@ -11,7 +11,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-raaco-simple.html b/inventory/templates/inventory/box-raaco-simple.html index 4de6321..963ef90 100644 --- a/inventory/templates/inventory/box-raaco-simple.html +++ b/inventory/templates/inventory/box-raaco-simple.html @@ -10,7 +10,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-smd-box-all.html b/inventory/templates/inventory/box-smd-box-all.html index c912bbb..a9125d7 100644 --- a/inventory/templates/inventory/box-smd-box-all.html +++ b/inventory/templates/inventory/box-smd-box-all.html @@ -21,7 +21,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-stanley-sorter-1.html b/inventory/templates/inventory/box-stanley-sorter-1.html index 28ef575..b1f763b 100644 --- a/inventory/templates/inventory/box-stanley-sorter-1.html +++ b/inventory/templates/inventory/box-stanley-sorter-1.html @@ -10,7 +10,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -21,7 +21,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -32,7 +32,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -45,7 +45,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/box-stanley-sorter-2.html b/inventory/templates/inventory/box-stanley-sorter-2.html index eb2c6b3..42cb1ab 100644 --- a/inventory/templates/inventory/box-stanley-sorter-2.html +++ b/inventory/templates/inventory/box-stanley-sorter-2.html @@ -10,7 +10,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -21,7 +21,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -32,7 +32,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
@@ -45,7 +45,7 @@
{% for compartment in item %} - {% include "inventory/cell.html" with item=compartment %} + {% include "inventory/cell.html" with item=compartment hilight=hilight %} {% endfor %}
diff --git a/inventory/templates/inventory/cell.html b/inventory/templates/inventory/cell.html index 80730b6..66434c1 100644 --- a/inventory/templates/inventory/cell.html +++ b/inventory/templates/inventory/cell.html @@ -1,7 +1,6 @@ {% load static %} {% load admin_urls %} - -
+
{% if item.name %} {% if item.metadata.package %}
{{ item.metadata.package }}
diff --git a/inventory/views/box.py b/inventory/views/box.py index eb02142..5f7c7a6 100644 --- a/inventory/views/box.py +++ b/inventory/views/box.py @@ -49,9 +49,11 @@ class BoxView(CanBeIndexMixin, DetailView): return result, idx def get(self, request, *args, **kwargs): + hilighted = int(request.GET.get('hilight', "0")) self.object = cast(Box, self.get_object()) context = self.get_context_data(object=self.object) context['layouted'], _ = self.layout(self.object.item_related.all().order_by('index'), self.object.layout.data) + context['hilight'] = hilighted return self.render_to_response(context)