Updated Library view to show an icon if a record exists showing that the library...
authorBrandon King <kingb@caltech.edu>
Tue, 16 Jun 2009 22:54:43 +0000 (22:54 +0000)
committerBrandon King <kingb@caltech.edu>
Tue, 16 Jun 2009 22:54:43 +0000 (22:54 +0000)
htsworkflow/frontend/samples/models.py
htsworkflow/frontend/samples/views.py
htsworkflow/frontend/static/img/hdd_unmount.png
htsworkflow/frontend/templates/samples/library_index.html

index 7199fbf8ea10eb547d56dd27a1955a127cc864b0..f51d250a8e862f7d562080adf0e0857f7f857e44 100644 (file)
@@ -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')
index 4b6b3775f78c7546866d8121e5ac16224383a2c9..b8956d5b20342f6d24e6b802ac6e48a9601187cf 100644 (file)
@@ -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 }
index ea4f672ea5e0c53ccfb7a81cbae90a422a92d151..4972e55031ed426dd1b979b843cae7de985f4f8f 100755 (executable)
Binary files a/htsworkflow/frontend/static/img/hdd_unmount.png and b/htsworkflow/frontend/static/img/hdd_unmount.png differ
index afae22b85ce1e5806c079ab6d270026f948d5671..c0a37e6a9438f4ce7a16becc87f86f6a44e979e4 100644 (file)
@@ -34,6 +34,7 @@
     <td>Species</td>
     <td>Library Name</td>
     <td>Total Lanes</td>
+    <td>HD</td>
     </tr>
   </thead>
   <tbody>
       <td><a href="/library/{{ lib.library_id }}">{{ lib.species_name }}</a></td>
       <td><a href="/library/{{ lib.library_id }}">{{ lib.library_name }}</a></td>
       <td>{{ lib.lanes_run }}</td>
+      {% if lib.is_archived %}
+        <td><img src="/static/img/hdd_unmount.png" alt="Archived" /></td>
+      {% else %}
+        <td></td>
+      {% endif %}
     </tr>
     {% endfor %}
   </tbody>