Update templates to consistently use {% static %} instead of hard coding paths
[htsworkflow.git] / htsworkflow / frontend / templates / samples / library_index.html
index cb91b691a2951d9c42545596861a7649177468f9..6ee9750cd8e0bc282fe57202596fd803cdd4f2f6 100644 (file)
-{% load i18n %}
-{% load admin_list %}
+{% extends "base_site.html" %}
+{% load admin_list i18n %}
+{% load staticfiles %}
+{% block extrahead %}
+    <!-- App Stuff -->
+    <link type="text/css" rel="stylesheet" href="{% static "css/app.css" %}"/>
 
-<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 additional_javascript %}
+    <script type="text/javascript" src="{% static "js/jquery.min.js" %}"></script>
+    <script type="text/javascript" src="{% static "js/htsw.js" %}"></script>
+    <script type="text/javascript">
+      $(document).ready(function() {
+        $(window).resize(function() {
+           var window_height = $(window).height();
+           var position = $("#changelist table").position();
+           height = window_height - position.top;
+           $("#changelist table.filtered").height(height);
+           $("#changelist-filter").height(height);
+        });
+        $(window).resize();
+      });
+    </script>
+    {% endblock %}
+{% endblock %}
+{% block bodyclass %}change-list{% endblock %}
+{% block coltype %}flex{% endblock %}
 
-<div id="content" class="flex>
-  <form action="" method="get">
+{% block content %}
+<div id="library_header_link">
+{% if todo_only %}<a href="..">All</a>{% else %}<a href="not_run/">Not run</a>
+{% endif %}
+</div>
+<div id="library-index-div" >
+  <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 %}
+
+    {% 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 summary_stats %}
+  <table class="{% if cl.has_filters %} filtered{% endif %}">
+    <thead >
+      <tr >
+        <td >Parent</td>
+        <td >Library ID</td>
+        <td >Species</td>
+        <td >Library Name</td>
+        <td colspan="3" >Single</td>
+        <td colspan="3" >Paired</td>
+        <td >HD</td>
+      </tr>
+      <tr >
+        <td colspan="4"></td>
+        <td>&lt;40</td>
+        <td>&lt;100</td>
+        <td>100+</td>
+        <td>&lt;40</td>
+        <td>&lt;100</td>
+        <td>100+</td>
+        <td></td>
+      </tr>
+    </thead>
+    <tbody >
+      {% for lib in library_list %}
+      <tr typeof="libns:Library" about="{{lib.library.get_absolute_url}}">
+        <td ><a href="{{lib.library.get_absolute_url}}">{{ lib.amplified_from }}</a></td>
+        <td ><a href="{{lib.library.get_absolute_url}}"><span property="libns:library_id">{{ lib.library_id }}</span></a></td>
+        <td rel="libns:species">
+          <a typeof="libns:Species"
+             href="{{lib.library.library_species.get_absolute_url}}">
+            <span property="libns:species_name">{{ lib.species_name }}</span>
+          </a>
+        </td>
+        <td >
+          <a href="{{ lib.library.get_absolute_url }}">
+            <span property="libns:name">{{ lib.library_name }}</span>
+          </a>
+        </td>
+        <td  bgcolor="#00BFFF">{{ lib.lanes_run.0.0 }}</td>
+        <td  bgcolor="#00BFFF">{{ lib.lanes_run.0.1 }}</td>
+        <td  bgcolor="#00BFFF">{{ lib.lanes_run.0.2 }}</td>
+        <td  bgcolor="#66CDAA">{{ lib.lanes_run.1.0 }}</td>
+        <td  bgcolor="#66CDAA">{{ lib.lanes_run.1.1 }}</td>
+        <td  bgcolor="#66CDAA">{{ lib.lanes_run.1.2 }}</td>
+        {% if lib.is_archived %}
+          <td ><img src="{% static "img/hdd_unmount.png" %}" alt="Archived" /></td>
+        {% else %}
+          <td ></td>
+        {% endif %}
+      </tr>
+      {% endfor %}
+    </tbody>
+  </table>
   </div>
-  {% endif %}
   {% endblock %}
-
-{% block summary_stats %}
-<table>
-  <thead>
-    <tr>
-    <td>Library ID</td>
-    <td>Species</td>
-    <td>Library Name</td>
-    <td>Total Lanes</td>
-    </tr>
-  </thead>
-  <tbody>
-    {% for lib in library_list%}
-    <tr>
-      <td><a href="/library/{{ lib.library_id }}">{{ lib.library_id }}</a></td>
-      <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>
-    </tr>
-    {% endfor %}
-  </tbody>
-</table>
 </div>
 {% endblock %}