def __unicode__(self):
return u"%s" % (self.name)
+ class Meta:
+ ordering = ('name',)
+
class ItemStatus(models.Model):
name = models.CharField(max_length=64, unique=True)
notes = models.TextField(blank=True, null=True)
(r'^lts/link/(?P<flowcell>.+)/(?P<serial>.+)/$', 'htsworkflow.frontend.inventory.views.link_flowcell_and_device'),
# INDEX
- (r'^(?P<uuid>[a-fA-F0-9]{32})/$', 'htsworkflow.frontend.inventory.views.item_summary_by_uuid'),
- (r'^(?P<uuid>[a-fA-F0-9]{32})/print/$', 'htsworkflow.frontend.inventory.views.item_print'),
- (r'^(?P<barcode_id>.+)/$', 'htsworkflow.frontend.inventory.views.item_summary_by_barcode'),
- (r'^$', 'htsworkflow.frontend.inventory.views.index')
+ #(r'^(?P<uuid>[a-fA-F0-9]{32})/$', 'htsworkflow.frontend.inventory.views.item_summary_by_uuid'),
+ #(r'^(?P<uuid>[a-fA-F0-9]{32})/print/$', 'htsworkflow.frontend.inventory.views.item_print'),
+ #(r'^(?P<barcode_id>.+)/$', 'htsworkflow.frontend.inventory.views.item_summary_by_barcode'),
+ (r'^$', 'htsworkflow.frontend.inventory.views.category_index')
)
return HttpResponse(json.dumps(d), content_type="application/javascript")
+@login_required
+def category_index(request):
+ """
+ List various object types
+ """
+ # build changelist
+ item_changelist = ChangeList(request, ItemType,
+ list_filter=[],
+ search_fields=[],
+ list_per_page=200,
+ queryset=ItemType.objects.all()
+ )
+
+ context_dict = {
+ 'item_changelist': item_changelist,
+ 'page_name': 'Inventory Objects'
+ }
+ context_dict.update(INVENTORY_CONTEXT_DEFAULTS)
+
+ return render_to_response('inventory/inventory_category.html',
+ context_dict,
+ context_instance=RequestContext(request))
+
@login_required
def index(request):
"""
/* CHANGELISTS */
#changelist { margin-bottom: 0pm; }
#changelist table { display: block; }
-#changelist table.filtered { margin-right: 21em; overflow-y: scroll; }
+#changelist table.filtered { margin-right: 21em; overflow-y: scroll; width: auto;}
.change-list .filtered table { border-right:1px solid #ddd; }
.change-list .filtered { min-height:400px; }
.change-list .filtered { background:white url(../img/changelist-bg.gif) top right repeat-y !important; }
--- /dev/null
+{% extends "base_site.html" %}
+{% load adminmedia admin_list i18n %}
+{% block bodyclass %}change-list{% endblock %}
+{% block coltype %}flex{% endblock %}
+{% block content %}
+<div id="inventory-index-div" >
+ <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
+ {% block search %}{% search_form item_changelist %}{% endblock %}
+
+ {% block pagination %}{% pagination item_changelist %}{% endblock %}
+
+ {% block filters %}
+ {% if item_changelist.has_filters %}
+ <div id="changelist-filter">
+ <h2 >{% trans 'Filter' %}</h2>
+ {% for spec in item_changelist.filter_specs %}
+ {% admin_list_filter cl spec %}
+ {% endfor %}
+ </div>
+ {% endif %}
+ {% endblock %}
+ {% block summary_stats %}
+ <table class="{% if cl.has_filters %} filtered{% endif %}">
+ <thead >
+ <tr >
+ <td >Object Type</td>
+ </tr>
+ </thead>
+ <tbody >
+ {% for item in item_changelist.get_query_set %}
+ <tr >
+ <td >{{ item.name }}</td>
+ </tr>
+ {% endfor %}
+ </tbody>
+ </table>
+ {% endblock %}
+</div>
+{% endblock %}
{% extends "base_site.html" %}
{% load adminmedia admin_list i18n %}
-{% block extrahead %}
- <script type="text/javascript">
- $(document).ready(function() {
- $(window).resize(function() {
- var window_height = $(window).height();
- var position = $("#changelist table").position();
- height = window_height - position.top;
- $("#changelist table.filtered").height(height);
- $("#changelist-filter").height(height);
- });
- $(window).resize();
- });
- </script>
-{% endblock %}
{% block bodyclass %}change-list{% endblock %}
{% block coltype %}flex{% endblock %}
{% block content %}