<!DOCTYPE html>


<html>
<head>
{% load static %}
{% load static %}
{% get_static_prefix as STATIC_PREFIX %}
{% include "chlamdb/header.html" %}
</head>

<body>
  <div class="container-fluid" id="main_container">
    <div class="row">
      <div id="wrapper">
          <div id="page-content-wrapper">
            <div class="row">

                  <div class="col-lg-12">
                    {% include "chlamdb/menu.html" %}

                  </div>
                  <b> Subcategory:  {{subcat_name}} </b>
                  <div class="panel panel-success" style="width:100%; top: 200px; margin-top: 2em;">
                    <div class="panel-heading" style="width:100%">
                        <h3 class="panel-title">Help</h3>
                    </div>
                    <p style="margin: 10px 10px 10px 10px">  
                        Two outpus are generated:
                        <br>-<strong>Maps</strong>: list of Kegg modules, their description and frequency in all the genomes.
                        <br>-<strong>Profile</strong>: annotated phylogenetic tree to visualize the distribution of the enzymes of each Kegg module among the genomes in the annotated phylogenetic tree.
                </div>

                    <ul id="tabs" class="nav nav-tabs" data-tabs="tabs">
                        <li class="active"><a href="#tab1" data-toggle="tab">Maps</a></li>
                        <li><a href="#tab2" data-toggle="tab">Profile</a></li>
                    </ul>

                    <div id="my-tab-content" class="tab-content" style="margin-top: 1em;">
                        <div class="tab-pane active" id="tab1">
                            <table class="display" id="module_category">
                                <thead>
                                    <tr>
                                        <th>Module</th>
                                        <th>Description</th>
                                        <th># occurences</th>
                                    </tr>
                                </thead>
                                <tbody>
                                    {% for line in data %}
                                        <tr>
                                        {% for value in line %}
                                            <td>{{value|safe}}</td>
                                        {% endfor %}
                                        </tr>
                                    {% endfor %}
                                </tbody>
                            </table>
                        </div>

                        <div class="tab-pane" id="tab2">
                    <div class="tab-pane active" id="tab2" style="height:1000px; margin-top: 2em;">
                      <object type="image/svg+xml" data="{% static asset_path %}" id="metabo_tree"></object>
					  <a download="profile.svg" class="btn" href="{% static asset_path %}"><i class="fa fa-download"></i> Download SVG</a>
                    </div>
                  </div>
              </div>
           </div>
      </div>
    </div>
  </div>


</body>

<script>

  $(document).ready(function() {
  $('#module_category').DataTable( {
          dom: 'Bfrtip',
          "order": [[2, "desc" ]],
          "pageLength": 15,
          "paging":   true,
          "ordering": true,
          "info":     false,
          buttons: [
          {
              extend: 'excel',
              title: 'module_category'
          },
          {
              extend: 'csv',
              title: 'module_category'
          }
          ],
      } );
  } );
  
  </script>
</html>
