Add a way to browse the list of entered antibody/antigene
authorDiane Trout <diane@caltech.edu>
Thu, 4 Aug 2011 19:59:07 +0000 (12:59 -0700)
committerDiane Trout <diane@caltech.edu>
Thu, 4 Aug 2011 19:59:07 +0000 (12:59 -0700)
htsworkflow/frontend/samples/urls.py
htsworkflow/frontend/samples/views.py
htsworkflow/frontend/templates/samples/antibody_index.html [new file with mode: 0644]

index eb3fa467aa13dd1b96814696e4846ef3f436d8ba..fea937c69e52fa1117d4d78c2342eb17b9c7f467 100644 (file)
@@ -4,4 +4,5 @@ urlpatterns = patterns('',
     (r"^library/(?P<library_id>\w+)/json", 'htsworkflow.frontend.samples.views.library_json'),
     (r"^species/(?P<species_id>\w+)/json", 'htsworkflow.frontend.samples.views.species_json'),
     (r"^species/(?P<species_id>\w+)", 'htsworkflow.frontend.samples.views.species'),
+    (r"^antibody/$", 'htsworkflow.frontend.samples.views.antibodies'),                   
 )
index 95270d8c99493d23f8c6ea01c368f5286cac5ae7..12bb79288b7b978f3bf65a84bb0fd4b3108ceaee 100644 (file)
@@ -12,7 +12,7 @@ except ImportError, e:
 from htsworkflow.frontend.auth import require_api_key
 from htsworkflow.frontend.experiments.models import FlowCell, Lane, LANE_STATUS_MAP
 from htsworkflow.frontend.samples.changelist import ChangeList
-from htsworkflow.frontend.samples.models import Library, Species, HTSUser
+from htsworkflow.frontend.samples.models import Antibody, Library, Species, HTSUser
 from htsworkflow.frontend.samples.results import get_flowcell_result_dict
 from htsworkflow.frontend.bcmagic.forms import BarcodeMagicForm
 from htsworkflow.pipelines.runfolder import load_pipeline_run_xml
@@ -518,6 +518,11 @@ def species(request, species_id):
 
     return render_to_response("samples/species_detail.html", context)
 
+def antibodies(request):
+    context = RequestContext(request,
+                             {'antibodies': Antibody.objects.order_by('antigene')})
+    return render_to_response("samples/antibody_index.html", context)
+    
 @login_required
 def user_profile(request):
     """
@@ -533,3 +538,4 @@ def user_profile(request):
     return render_to_response('registration/profile.html', context,
                               context_instance=RequestContext(request))
 
+
diff --git a/htsworkflow/frontend/templates/samples/antibody_index.html b/htsworkflow/frontend/templates/samples/antibody_index.html
new file mode 100644 (file)
index 0000000..9d2982c
--- /dev/null
@@ -0,0 +1,44 @@
+{% extends "base_site.html" %}
+{% load adminmedia admin_list i18n %}
+
+{% block bodyclass %}change-list{% endblock %}
+{% block coltype %}flex{% endblock %}
+
+{% block content %}
+<div id="antibody-index-div">
+{% block body %}
+<table >
+  <thead >
+    <tr >
+      <td >Antigene</td>
+      <td >Nickname</td>
+      <td >Antibodies</td>
+      <td >Catalog</td>
+      <td >Source</td>
+  </tr>
+  </thead>
+  <tbody >
+    {% for antibody in antibodies %}
+    <tr >
+      <td >
+        {{ antibody.antigene }}
+      </td>
+      <td >
+        {{ antibody.nickname }}
+      </td>
+      <td >
+        {{ antibody.antibodies }}
+      </td>
+      <td >
+        {{ antibody.catalog }}
+      </td>
+      <td >
+        {{ antibody.source }}
+      </td>
+   </tr>
+    {% endfor %}
+  </tbody>
+</table>
+</div>
+{% endblock %}
+{% endblock %}