From: Diane Trout Date: Tue, 11 Oct 2011 21:44:46 +0000 (-0700) Subject: Add a todo view that shows only libraries that have no X-Git-Tag: v0.5.5~83^2~4 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=b498cc64051ffd8f9db81300796792d15e7f9790 Add a todo view that shows only libraries that have no lanes. --- diff --git a/htsworkflow/frontend/samples/views.py b/htsworkflow/frontend/samples/views.py index 4703cd3..e3d15b7 100644 --- a/htsworkflow/frontend/samples/views.py +++ b/htsworkflow/frontend/samples/views.py @@ -89,21 +89,26 @@ def create_library_context(cl): cl.result_count = unicode(cl.paginator._count) return {'library_list': records } -def library(request): +def library(request, todo_only=False): + queryset = Library.objects.filter(hidden__exact=0) + if todo_only: + queryset = queryset.filter(lane=None) # build changelist fcl = ChangeList(request, Library, list_filter=['affiliations', 'library_species'], search_fields=['id', 'library_name', 'amplified_from_sample__id'], list_per_page=200, - queryset=Library.objects.filter(hidden__exact=0) + queryset=queryset ) - context = { 'cl': fcl, 'title': 'Library Index'} + context = { 'cl': fcl, 'title': 'Library Index', 'todo_only': todo_only} context.update(create_library_context(fcl)) t = get_template('samples/library_index.html') c = RequestContext(request, context) return HttpResponse( t.render(c) ) +def library_todo(request): + return library(request, todo_only=True) def library_to_flowcells(request, lib_id): """ diff --git a/htsworkflow/frontend/templates/samples/library_index.html b/htsworkflow/frontend/templates/samples/library_index.html index 024a83d..511f7b4 100644 --- a/htsworkflow/frontend/templates/samples/library_index.html +++ b/htsworkflow/frontend/templates/samples/library_index.html @@ -3,8 +3,8 @@ {% block extrahead %} - - {% block additional_javascript %} + + {% block additional_javascript %}