From: Diane Trout Date: Sun, 7 Nov 2010 23:54:22 +0000 (-0800) Subject: Very basic non-ExtJS version of the inventory page X-Git-Tag: 0.5.0~13 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=e6b0fe8d3e83598f6dfe9ec3e8ffd64221e96d20 Very basic non-ExtJS version of the inventory page It needs to group by object type. Possible with an index of types followed by index of objects before getting to the detail page. The component where it forces you to login before viewing the inventory page is broken. It shows a super-plain form, but fails on submit with some kind of cross site forgery prevention cookie fails --- diff --git a/htsworkflow/frontend/inventory/views.py b/htsworkflow/frontend/inventory/views.py index 7ff5b40..dfb92a9 100644 --- a/htsworkflow/frontend/inventory/views.py +++ b/htsworkflow/frontend/inventory/views.py @@ -1,3 +1,4 @@ +from htsworkflow.frontend.samples.changelist import ChangeList from htsworkflow.frontend.inventory.models import Item, LongTermStorage, ItemType from htsworkflow.frontend.inventory.bcmagic import item_search from htsworkflow.frontend.bcmagic.plugin import register_search_plugin @@ -137,7 +138,16 @@ def index(request): """ Inventory Index View """ + # build changelist + item_changelist = ChangeList(request, Item, + list_filter=[], + search_fields=[], + list_per_page=200, + queryset=Item.objects.all() + ) + context_dict = { + 'item_changelist': item_changelist, 'page_name': 'Inventory Index' } context_dict.update(INVENTORY_CONTEXT_DEFAULTS) diff --git a/htsworkflow/frontend/templates/inventory/inventory_index.html b/htsworkflow/frontend/templates/inventory/inventory_index.html index 1a1e32b..399dae1 100644 --- a/htsworkflow/frontend/templates/inventory/inventory_index.html +++ b/htsworkflow/frontend/templates/inventory/inventory_index.html @@ -1,10 +1,69 @@ -{% extends "inventory/inventory_app.html" %} - -{% block additional_javascript %} - +{% extends "base_site.html" %} +{% load adminmedia admin_list i18n %} +{% block extrahead %} + {% endblock %} - +{% block bodyclass %}change-list{% endblock %} +{% block coltype %}flex{% endblock %} {% block content %} -
+
+
+ {% block search %}{% search_form item_changelist %}{% endblock %} + + {% block pagination %}{% pagination item_changelist %}{% endblock %} + + {% block filters %} + {% if item_changelist.has_filters %} +
+

{% trans 'Filter' %}

+ {% for spec in item_changelist.filter_specs %} + {% admin_list_filter cl spec %} + {% endfor %} +
+ {% endif %} + {% endblock %} + {% block summary_stats %} + + + + + + + + + + + + + + {% for item in item_changelist.get_query_set %} + + + + + + + + + + {% endfor %} + +
UUIDBarcode IDLocationModelVendorCreatedContains
{{ item.uuid }}{{ item.barcode_id}}{{ item.location }}{{ item.item_type }}{{ item.creation_date }} + {% for content in item.longtermstorage_set.all %} + {{ content.flowcell }} + {% endfor %} +
+ {% endblock %} +
{% endblock %} - \ No newline at end of file diff --git a/htsworkflow/frontend/templates/inventory/inventory_summary.html b/htsworkflow/frontend/templates/inventory/inventory_summary.html index d057ec9..3d462dd 100644 --- a/htsworkflow/frontend/templates/inventory/inventory_summary.html +++ b/htsworkflow/frontend/templates/inventory/inventory_summary.html @@ -40,51 +40,6 @@


- {% else %}

Item with UUID of {{ uuid }} not found.