From: Brandon King Date: Tue, 16 Jun 2009 22:54:43 +0000 (+0000) Subject: Updated Library view to show an icon if a record exists showing that the library... X-Git-Tag: 0.2.2~2 X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=htsworkflow.git;a=commitdiff_plain;h=7f19ccf892f4b4f62302ac1356651953dd6b14b2 Updated Library view to show an icon if a record exists showing that the library has been archived. --- diff --git a/htsworkflow/frontend/samples/models.py b/htsworkflow/frontend/samples/models.py index 7199fbf..f51d250 100644 --- a/htsworkflow/frontend/samples/models.py +++ b/htsworkflow/frontend/samples/models.py @@ -183,6 +183,15 @@ class Library(models.Model): for t in affs: ar.append(t.__unicode__()) return '%s' % (", ".join(ar)) + + def is_archived(self): + """ + returns True if archived else False + """ + if self.longtermstorage_set.count() > 0: + return True + else: + return False def libtags(self): affs = self.tags.all().order_by('tag_name') diff --git a/htsworkflow/frontend/samples/views.py b/htsworkflow/frontend/samples/views.py index 4b6b377..b8956d5 100644 --- a/htsworkflow/frontend/samples/views.py +++ b/htsworkflow/frontend/samples/views.py @@ -41,6 +41,7 @@ def create_library_context(cl): lane = getattr(lib, 'lane_%d_library' % (lane_id,)) lanes_run += len( lane.all() ) summary['lanes_run'] = lanes_run + summary['is_archived'] = lib.is_archived() records.append(summary) cl.result_count = unicode(cl.paginator._count) + u" libraries" return {'library_list': records } diff --git a/htsworkflow/frontend/static/img/hdd_unmount.png b/htsworkflow/frontend/static/img/hdd_unmount.png index ea4f672..4972e55 100755 Binary files a/htsworkflow/frontend/static/img/hdd_unmount.png and b/htsworkflow/frontend/static/img/hdd_unmount.png differ diff --git a/htsworkflow/frontend/templates/samples/library_index.html b/htsworkflow/frontend/templates/samples/library_index.html index afae22b..c0a37e6 100644 --- a/htsworkflow/frontend/templates/samples/library_index.html +++ b/htsworkflow/frontend/templates/samples/library_index.html @@ -34,6 +34,7 @@ Species Library Name Total Lanes + HD @@ -44,6 +45,11 @@ {{ lib.species_name }} {{ lib.library_name }} {{ lib.lanes_run }} + {% if lib.is_archived %} + Archived + {% else %} + + {% endif %} {% endfor %}