update inventory status template to use new field name for samples_library library id
[htsworkflow.git] / htsworkflow / frontend / templates / inventory / inventory_summary.html
index 0f184881d0e07802564c82d6ae2d09c8143d8e25..d057ec9f1703fbd29fd3b52afc4dba01bd313086 100644 (file)
@@ -1,9 +1,92 @@
 {% extends "inventory/inventory_app.html" %}
 
 {% block content %}
-        {% if item %}
-                <h3>Item: {{item.uuid}}</h3>
-        {% else %}
-                <h3>Item with UUID of {{ uuid }} not found.</h3>
+{% if item %}
+        <h2>Item Summary:</h2>
+        <a href="{% url htsworkflow.frontend.inventory.views.index %}{{item.uuid}}/print/">Print</a><br />
+        <br />
+        <b>UUID:</b> {{item.uuid}}<br />
+        <b>Barcode ID:</b> {{ item.barcode_id }}<br />
+        <b>Type:</b> {{ item.item_type.name }}<br />
+        <br />
+        <b>Location:</b> {{ item.location.name }}<br />
+        <b>Status: </b> {% if item.status %}{{ item.status.name }}{% else %}N/A{% endif %}<br />
+        <br />
+        {% if item.item_info.model_id %}
+        <b>Model ID:</b> {{ item.item_info.model_id }}<br />
         {% endif %}
+        {% if item.item_info.part_number %}
+        <b>Part Number:</b> {{ item.item_info.part_number }}<br />
+        {% endif %}
+        {% if item.item_info.lot_number %}
+        <b>Lot Number:</b> {{ item.item_info.lot_number }}<br />
+        {% endif %}
+        <br />
+        {% if item.item_info.url %}
+        <b>Item Website:</b> <a href="{{ item.item_info.url }}">Link</a><br />
+        {% endif %}
+        <b>Vendor:</b> {% if item.item_info.vendor.url %}<a href="{{ item.item_info.vendor.url }}">{% endif %}{{ item.item_info.vendor.name }}{% if item.item_info.vendor.url %}</a>{% endif %}<br />
+        <b>Purchase Date:</b>{% if item.item_info.purchase_date %}{{ item.item_info.purchase_date }}{% else %}N/A{% endif %}<br />
+        <b>Warenty (Months):</b>{% if item.item_info.warenty_months %}{{item.item_info.warenty_months}}{% else %}N/A{% endif %}<br />
+        <br />
+        <b>Item Info Notes:</b>
+        <p>
+                {% if item.item_info.notes %}{{ item.item_info.notes }}{% else %}No notes found{% endif %}
+        </p>
+        <br />
+        <b>Item Specific Notes:</b>
+        <p>
+                {% if item.notes %}{{ item.notes }}{% else %}No notes found{% endif %}
+        </p>
+        <br />
+        <center><div id="lts-grid"></div></center>
+        <script>
+                var lts_data = [
+                {% for lts in item.longtermstorage_set.all %}
+                        {% for lib in lts.libraries.iterator %}[ "{{ lts.flowcell.flowcell_id }}","{{ lib.id }}","{% for sd in lts.storage_devices.iterator %}{{ sd }}{% if forloop.last %}"{% else %}|{% endif %}{% endfor %}{% if forloop.parentloop.last %}{% if forloop.last %}]{% else %}],{% endif %}{% else %}],{% endif %}
+                        {% endfor %}
+                {% endfor %}
+                ];
+                
+                var lts_reader = new Ext.data.ArrayReader({}, [
+                        {name: 'flowcell'},
+                        {name: 'library'},
+                        {name: 'storage_devices'}
+                ]);
+                
+                var lts_grid = new Ext.grid.GridPanel({
+                        store: new Ext.data.GroupingStore({
+                                reader: lts_reader,
+                                data: lts_data,
+                                sortInfo: {'field': 'flowcell', 'direction': 'DESC'},
+                                groupField: 'flowcell'
+                        }),
+                        
+                        columns: [
+                                {id: 'flowcell', header: 'Flowcell', width: 30, sortable: true, dataIndex: 'flowcell', hidden: true},
+                                {header: 'Library', width: 30, sortable: true, dataIndex: 'library'},
+                                {header: 'Storage Devices', width: 60, sortable: true, dataIndex: 'storage_devices'}
+                        ],
+                        
+                        view: new Ext.grid.GroupingView({
+                                forceFit: true,
+                                groupTextTpl: '{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'
+                        }),
+                        
+                        frame: true,
+                        width: 700,
+                        autoHeight: true,
+                        collapisble: true,
+                        animCollapisble: true,
+                        stateful: true,
+                        stateId: 'inventory-item-lts-storage-grid',
+                        title: 'Long Term Storage Info',
+                        iconCls: 'icon-grid',
+                        renderTo: 'lts-grid'
+                })
+        </script>
+        
+{% else %}
+        <h3>Item with UUID of {{ uuid }} not found.</h3>
+{% endif %}
 {% endblock %}