Display the pM on the public library detail page.
authorDiane Trout <diane@caltech.edu>
Sat, 7 Mar 2009 00:58:48 +0000 (00:58 +0000)
committerDiane Trout <diane@caltech.edu>
Sat, 7 Mar 2009 00:58:48 +0000 (00:58 +0000)
Also I was getting tired of our ugly pages so I ripped large chunks of the
django css and more of their templates to make our library index page look
nicer.

I started working on the public library detail page but that started
involving too many alterations to the code for friday.

htsworkflow/frontend/samples/views.py
htsworkflow/frontend/static/css/data-browse-index.css [new file with mode: 0644]
htsworkflow/frontend/templates/base.html [new file with mode: 0644]
htsworkflow/frontend/templates/base_site.html [new file with mode: 0644]
htsworkflow/frontend/templates/samples/library_detail.html
htsworkflow/frontend/templates/samples/library_index.html
htsworkflow/frontend/templates/search_form.html [new file with mode: 0644]

index a6a996cb7c42a2084b5e169a491f2df4543ea872..58bef9133b21d7d70f5dda5c7091e51fc202e884 100644 (file)
@@ -1,4 +1,5 @@
 # Create your views here.
+from htsworkflow.frontend.experiments.models import FlowCell
 from htsworkflow.frontend.samples.changelist import ChangeList
 from htsworkflow.frontend.samples.models import Library
 from htsworkflow.frontend.samples.results import get_flowcell_result_dict, parse_flowcell_id
@@ -43,11 +44,11 @@ def library(request):
     fcl = ChangeList(request, Library,
         list_filter=['library_species','affiliations'],
         search_fields=['library_id', 'library_name'],
-        list_per_page=25,
+        list_per_page=200,
         queryset=Library.objects.filter(hidden__exact=0)
     )
 
-    context = { 'cl': fcl}
+    context = { 'cl': fcl, 'title': 'Library Index'}
     context.update(create_library_context(fcl))
     t = get_template('samples/library_index.html')
     c = RequestContext(request, context)
@@ -243,6 +244,12 @@ def _summary_stats(flowcell_id, lane_id):
                 eland_summary.clusters = gerald_summary[end][lane_id].cluster
                 eland_summary.cycle_width = cycle_width
                 eland_summary.summarized_reads = runfolder.summarize_mapped_reads(eland_summary.mapped_reads)
+
+                # grab some more information out of the flowcell db
+                flowcell = FlowCell.objects.get(flowcell_id=fc_id)
+                pm_field = 'lane_%d_pM' % (lane_id)
+                eland_summary.successful_pm = getattr(flowcell, pm_field)
+
                 summary_list.append(eland_summary)
 
         except Exception, e:
diff --git a/htsworkflow/frontend/static/css/data-browse-index.css b/htsworkflow/frontend/static/css/data-browse-index.css
new file mode 100644 (file)
index 0000000..59119bf
--- /dev/null
@@ -0,0 +1,2 @@
+@import url('changelists.css');
+@import url('click-table.css');
diff --git a/htsworkflow/frontend/templates/base.html b/htsworkflow/frontend/templates/base.html
new file mode 100644 (file)
index 0000000..5899e59
--- /dev/null
@@ -0,0 +1,56 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="{{ LANGUAGE_CODE }}" xml:lang="{{ LANGUAGE_CODE }}" {% if LANGUAGE_BIDI %}dir="rtl"{% endif %}>
+<head>
+<title>{% block title %}{% endblock %}</title>
+<link rel="stylesheet" type="text/css" href="{% block stylesheet %}{% load adminmedia %}{% admin_media_prefix %}css/base.css{% endblock %}" />
+{% if LANGUAGE_BIDI %}<link rel="stylesheet" type="text/css" href="{% block stylesheet_rtl %}{% admin_media_prefix %}css/rtl.css{% endblock %}" />{% endif %}
+{% block extrastyle %}{% endblock %}
+{% block extrahead %}{% endblock %}
+{% block blockbots %}<meta name="robots" content="NONE,NOARCHIVE" />{% endblock %}
+</head>
+{% load i18n %}
+
+<body class="{% if is_popup %}popup {% endif %}{% block bodyclass %}{% endblock %}">
+
+<!-- Container -->
+<div id="container">
+
+    {% if not is_popup %}
+    <!-- Header -->
+    <div id="header">
+        <div id="branding">
+        {% block branding %}{% endblock %}
+        </div>
+        {% if user.is_authenticated and user.is_staff %}
+        <div id="user-tools">{% trans 'Welcome,' %} <strong>{% firstof user.first_name user.username %}</strong>. {% block userlinks %}{% url django-admindocs-docroot as docsroot %}{% if docsroot %}<a href="{{ docsroot }}">{% trans 'Documentation' %}</a> / {% endif %}<a href="{{ root_path }}password_change/">{% trans 'Change password' %}</a> / <a href="{{ root_path }}logout/">{% trans 'Log out' %}</a>{% endblock %} 
+        </div>
+        {% endif %}
+        {% block nav-global %}{% endblock %}
+    </div>
+    <!-- END Header -->
+    {% block breadcrumbs %}<div class="breadcrumbs"><a href="/">{% trans 'Home' %}</a>{% if title %} &rsaquo; {{ title }}{% endif %}</div>{% endblock %}
+    {% endif %}
+
+        {% if messages %}
+        <ul class="messagelist">{% for message in messages %}<li>{{ message }}</li>{% endfor %}</ul>
+        {% endif %}
+
+    <!-- Content -->
+    <div id="content" class="{% block coltype %}colM{% endblock %}">
+        {% block pretitle %}{% endblock %}
+        {% block content_title %}{% if title %}<h1>{{ title }}</h1>{% endif %}{% endblock %}
+        {% block content %}
+        {% block object-tools %}{% endblock %}
+        {{ content }}
+        {% endblock %}
+        {% block sidebar %}{% endblock %}
+        <br class="clear" />
+    </div>
+    <!-- END Content -->
+
+    {% block footer %}<div id="footer"></div>{% endblock %}
+</div>
+<!-- END Container -->
+
+</body>
+</html>
diff --git a/htsworkflow/frontend/templates/base_site.html b/htsworkflow/frontend/templates/base_site.html
new file mode 100644 (file)
index 0000000..3cf8738
--- /dev/null
@@ -0,0 +1,10 @@
+{% extends "admin/base.html" %}
+{% load i18n %}
+
+{% block title %}{{ sitename }}{% endblock %}
+
+{% block branding %}
+<h1 id="site-name">HTS Workflow</h1>
+{% endblock %}
+
+{% block nav-global %}{% endblock %}
index 3533477506e6420e87387d5891923129e50a0419..56c937f5d58e54477648a396867d50c7de894f92 100644 (file)
@@ -30,7 +30,7 @@
 <table>
   <thead>
     <tr>
-      <td colspan="6"></td>
+      <td colspan="7"></td>
       <td colspan="2">No Match</td>
       <td colspan="2">QC Failed</td>
       <td colspan="4">Unique</td>
@@ -42,6 +42,7 @@
     <td>Lane</td>
     <td>End</td>
     <td>Cluster / Tile</td>
+    <td>pM</td>
     <td>Raw Reads</td>
     <td>total</td>
     <td>%</td>
@@ -66,6 +67,7 @@
       <td>{{ lane.lane_id }}</td>
       <td>{% if lane.end %}{{ lane.end }}{% endif %}</td>
       <td>{{ lane.clusters.0|intcomma }}</td>
+      <td>{{ lane.successful_pm }}</td>
       <td>{{ lane.reads|intcomma }}</td>
       <td>{{ lane.no_match|intcomma }}</td>
       <td>{{ lane.no_match_percent|stringformat:".2f" }}</td>
index cb91b691a2951d9c42545596861a7649177468f9..4263846c9c3574366c32b722d6072e8077c1f9f0 100644 (file)
@@ -1,24 +1,29 @@
-{% load i18n %}
-{% load admin_list %}
+{% extends "base_site.html" %}
+{% load adminmedia admin_list i18n %}
 
-<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL}}css/changelists.css" />
-<link rel="stylesheet" type="text/css" href="{{ MEDIA_URL}}css/click-table.css" />
+{% block stylesheet %}{{ MEDIA_URL }}css/data-browse-index.css{% endblock %}
 
-<div id="content" class="flex>
-  <form action="" method="get">
+{% block bodyclass %}change-list{% endblock %}
+{% block coltype %}flex{% endblock %}
+
+{% block content %}
+<div id="content-main">
+  <div class="module{% if cl.has_filters %} filtered{% endif %}" id="changelist">
     {% block search %}{% search_form cl %}{% endblock %}
-    {% block pagination %}{% pagination cl %}{% endblock %}
-  </form>
-  {% block filters %}
-  {% if cl.has_filters %}
-  <div id="changelist-filter">
-    <h2>{% trans 'Filter' %}</h2>
-    {% for spec in cl.filter_specs %}
-       {% admin_list_filter cl spec %}
-    {% endfor %}
-  </div>
-  {% endif %}
-  {% endblock %}
+
+    {% block filters %}
+    {% if cl.has_filters %}
+    <div id="changelist-filter">
+      <h2>{% trans 'Filter' %}</h2>
+      {% for spec in cl.filter_specs %}
+         {% admin_list_filter cl spec %}
+         {% endfor %}
+       </div>
+       {% endif %}
+       {% endblock %}
+
+  
+ {% block pagination %}{% pagination cl %}{% endblock %}
 
 {% block summary_stats %}
 <table>
@@ -43,3 +48,4 @@
 </table>
 </div>
 {% endblock %}
+{% endblock %}
diff --git a/htsworkflow/frontend/templates/search_form.html b/htsworkflow/frontend/templates/search_form.html
new file mode 100644 (file)
index 0000000..97ef8f1
--- /dev/null
@@ -0,0 +1,18 @@
+{% load adminmedia %}
+{% load i18n %}
+{% if cl.search_fields %}
+<div id="toolbar"><form id="changelist-search" action="" method="get">
+<div><!-- DIV needed for valid HTML -->
+<label for="searchbar"><img src="{% admin_media_prefix %}img/admin/icon_searchbox.png" alt="Search" /></label>
+<input type="text" size="40" name="{{ search_var }}" value="{{ cl.query }}" id="searchbar" />
+<input type="submit" value="{% trans 'Go' %}" />
+{% if show_result_count %}
+    <span class="small quiet">{% blocktrans count cl.result_count as counter %}1 result{% plural %}{{ counter }} results{% endblocktrans %} (<a href="?{% if cl.is_popup %}pop=1{% endif %}">{% blocktrans with cl.full_result_count as full_result_count %}{{ full_result_count }} total{% endblocktrans %}</a>)</span>
+{% endif %}
+{% for pair in cl.params.items %}
+    {% ifnotequal pair.0 search_var %}<input type="hidden" name="{{ pair.0 }}" value="{{ pair.1 }}"/>{% endifnotequal %}
+{% endfor %}
+</div>
+</form></div>
+<script type="text/javascript">document.getElementById("searchbar").focus();</script>
+{% endif %}