Update templates to consistently use {% static %} instead of hard coding paths
[htsworkflow.git] / htsworkflow / frontend / templates / samples / library_detail.html
1 {% extends "base_site.html" %}
2 {% load staticfiles %}
3 {% load humanize i18n %}
4 {% block extrahead %}
5     <!-- App Stuff -->
6     <link type="text/css" rel="stylesheet" href="{% static "css/app.css" %}"/>
7     <script type="text/javascript" src="{% static "js/jquery.min.js" %}"></script>
8
9     {% block additional_javascript %}
10     {% endblock %}
11 {% endblock %}
12
13 {% block content %}
14   {% include "sample_header.html" %}
15   <hr/>
16   <div class="library_statistics">
17   <h2>Raw Result Files</h2>
18   <table>
19   <thead>
20     <tr>
21       <td>Run Start Date</td>
22       <td>Cycle</td>
23       <td>Flowcell</td>
24       <td>Lane</td>
25       <td>Summary</td>
26       <td>Eland</td>
27       <td>Bed</td>
28       <td>Archived</td>
29     </tr>
30   </thead>
31   <tbody>
32   {% if eland_results %}
33     {% for result in eland_results %}
34     <tr about="{{result.flowcell.get_absolute_url}}">
35       <td property="libns:date" content="{{result.run_date|date:'Y-m-d\TH:i:s'}}" datatype="xsd:dateTime">{{ result.run_date|date}}</td>
36       <td>{{ result.cycle }}</td>
37       <td><a href="{{result.flowcell.get_absolute_url}}"><span property="libns:flowcell_id">{{ result.flowcell_id }}</span></a>{% if user.is_staff %}<a href="{{result.flowcell.get_admin_url}}"><img class="icon_button" src="{% static "admin/img/icon_changelink.gif" %}" alt="Edit"/></a>{% endif%}</td>
38       <td>{{ result.lane.lane_number }}</td>
39       <td><a href="{{ result.summary_url }}">Summary</a></td>
40       <td><a href="{{ result.result_url }}">{{ result.result_label }}</a></td>
41       <td>
42       {% if result.bed_url %}
43         <a href="{{ result.bed_url }}">Bed</a>
44       {% endif %}
45       </td>
46       <td>
47         {% if result.storage_ids %}
48           {{ result.storage_ids|safe }}
49         {% endif %}
50       </td>
51     </tr>
52     {% endfor %}
53   {% else %}
54     <tr><td colspan="8">No data</td></tr>
55   {% endif %}
56   </tbody>
57   </table>
58
59   <h2>Lane Summary Statistics</h2>
60   {% block summary_stats %}
61   <table>
62     <thead>
63       <tr>
64         <td colspan="7"></td>
65         <td colspan="2">No Match</td>
66         <td colspan="2">QC Failed</td>
67         <td colspan="4">Unique</td>
68         <td colspan="4">Repeat</td>
69       </tr>
70       <tr>
71       <td>Cycles</td>
72       <td>Flowcell</td>
73       <td>Lane</td>
74       <td>End</td>
75       <td>Cluster / Tile</td>
76       <td>pM</td>
77       <td>Raw Reads</td>
78       <td>total</td>
79       <td>%</td>
80       <td>total</td>
81       <td>%</td>
82       <td>0 mismatch</td>
83       <td>1 mismatch</td>
84       <td>2 mismatch</td>
85       <td>Total</td>
86       <td>0 mismatch</td>
87       <td>1 mismatch</td>
88       <td>2 mismatch</td>
89       <td>Total</td>
90       </tr>
91     </thead>
92     <tbody>
93     {% if lane_summary_list %}
94       {# ls short for lane summary #}
95       {% for ls in lane_summary_list %}
96       <tr about="{{ls.lane.get_absolute_url}}">
97         <td>{{ ls.cycle_width }}</td>
98         <td><a href="{{ls.flowcell.get_absolute_url}}">{{ ls.flowcell_id }}</a>
99         </td>
100         <td><a href="{{ls.lane.get_absolute_url}}">{{ ls.lane_id }}</a></td>
101         <td>{% if ls.end %}{{ ls.end }}{% endif %}</td>
102         <td>{{ ls.clusters.0|intcomma }}</td>
103         <td>{{ ls.successful_pm }}</td>
104         <td>{{ ls.reads|intcomma }}</td>
105         <td>{{ ls.no_match|intcomma }}</td>
106         <td>{{ ls.no_match_percent|stringformat:".2f" }}</td>
107         <td>{{ ls.qc_failed|intcomma }}</td>
108         <td>{{ ls.qc_failed_percent|stringformat:".2f" }}</td>
109         <td>{{ ls.match_codes.U0|intcomma }}</td>
110         <td>{{ ls.match_codes.U1|intcomma }}</td>
111         <td>{{ ls.match_codes.U2|intcomma }}</td>
112         <td {% if ls.unique_reads %}property="libns:total_unique_locations" content="{{ls.unique_reads}}" datatype="xsd:decimal"{% endif %}>{{ ls.unique_reads|intcomma }}</td>
113         <td>{{ ls.match_codes.R0|intcomma }}</td>
114         <td>{{ ls.match_codes.R1|intcomma }}</td>
115         <td>{{ ls.match_codes.R2|intcomma }}</td>
116         <td>{{ ls.repeat_reads|intcomma }}</td>
117       </tr>
118       {% endfor %}
119       {% else %}
120        <tr><td colspan="20">No data</td></tr>
121     {% endif %}
122   </tbody>
123     </table>
124
125   <h2>Flowcell Notes</h2>
126   <table>
127     <thead>
128       <tr>
129         <td>Flowcell ID</td>
130         <td>Lane</td>
131         <td>Comment</td>
132       </tr>
133     </thead>
134     {% if lib.lane_set.all %}
135     <tbody>
136       {% for lane in lib.lane_set.all %}
137       <tr rel="libns:has_lane" 
138           about="{{lib.get_absolute_url}}"
139           resource="{{lane.get_absolute_url}}">
140         <td>
141           <a typeof="libns:IlluminaFlowcell" href="{{lane.flowcell.get_absolute_url}}">
142             <span property="libns:flowcell_id"
143                   >{{lane.flowcell.flowcell_id}}</span></a>
144           {% if user.is_staff %}
145             <a href="{{lane.flowcell.get_admin_url}}">
146                <img class="icon_button"
147                     src="{% static "admin/img/icon_changelink.gif" %}" alt="Edit"/>
148             </a>
149           {% endif%}
150         </td>
151         <td typeof="libns:IlluminaLane" about="{{lane.get_absolute_url}}">
152           <span rel="libns:flowcell" resource="{{lane.flowcell.get_absolute_url}}"></span>
153           <a href="{{lane.get_absolute_url}}">
154             <span property="libns:lane_number"
155                >{{ lane.lane_number }}</span>
156             </a></td>
157         <td>{{ lane.comment }}</td>
158       </tr>
159           {% endfor %}
160     </tbody>
161     {% endif %}
162   </table>
163   <br/>
164   <hr/>
165   <h2>Count of multi-reads</h2>
166   {% for eland_lane in lane_summary_list %}
167     {% if eland_lane.summarized_reads %}
168     <h3>{{eland_lane.cycle_width}} {{ eland_lane.flowcell_id }} lane {{ eland_lane.lane_id }}
169       {% if eland_lane.end %} end {{ eland_lane.end }}{% endif %}
170     </h3>
171     <ul about="{{eland_lane.lane.get_absolute_url}}">
172       {% for name, counts in eland_lane.summarized_reads.items %}
173       <li rel="libns:has_mappings">
174          <b property="libns:mapped_to">{{ name }}</b>:
175          <span property="libns:reads" content="{{counts}}" datatype="xsd:integer">{{ counts|intcomma }}</span></li>
176       {% endfor %}
177     </ul>
178     {% endif %}
179   {% endfor %}
180   {% endblock %}
181   </div>
182 {% endblock %}