Report no data found when collections empty
authorDiane Trout <diane@ghic.org>
Thu, 15 Sep 2016 00:00:31 +0000 (17:00 -0700)
committerDiane Trout <diane@ghic.org>
Thu, 15 Sep 2016 00:00:31 +0000 (17:00 -0700)
The xhtml validator caught a few cases where empty data generated
some invalid html because some table or list bodies were missing. I
thought it reasonable to include a message that nothing was found
instead of leaving the table blank.

htsworkflow/templates/sample_header.html
htsworkflow/templates/samples/library_detail.html
htsworkflow/templates/samples/library_index.html

index 651349f01b88dafff3f762c60edaf0f2840c0c86..ed9f8b12184ae4996a7533f76f4f5b0902cae116 100644 (file)
@@ -17,6 +17,8 @@
         <li property="libns:affiliation" content="{{individual.name}}">
           {{ individual.name }} ( {{ individual.contact }} )
         </li>
+        {% empty %}
+        <li>None</li>
       {% endfor %}
     </ul>
     {% if lib.libraryaccession_set %}
index 65747dcac5194ca6d73191a3ad419d6c9f500fe1..49663931006ce70aabe6b563342144227913606d 100644 (file)
        <td>Comment</td>
       </tr>
     </thead>
-    {% if lib.lane_set.all %}
     <tbody>
       {% for lane in lib.lane_set.all %}
       <tr rel="libns:has_lane" 
             </a></td>
         <td>{{ lane.comment }}</td>
       </tr>
-         {% endfor %}
+      {% empty %}
+      <tr><td colspan="0">No data</td></tr>
+      {% endfor %}
     </tbody>
-    {% endif %}
   </table>
   <br/>
   <hr/>
index 4491a09d11cc253b3a7044c1168103348d184a6e..9884483eae38ea86bb2b6ae70ebc846c161a2ad4 100644 (file)
           <td ></td>
         {% endif %}
       </tr>
+      {% empty %}
+      <tr><td colspan="0">No results found</td></tr>
       {% endfor %}
     </tbody>
   </table>