Commit ae811bae authored by Albert Hornos Vidal's avatar Albert Hornos Vidal
Browse files

feat(#18): add host sequences table

parent 3da79b49
......@@ -282,3 +282,6 @@ other = "Molecule type"
[taxon]
other = "TAXON"
[region]
other = "Region"
......@@ -29,7 +29,7 @@
</div>
<div class="tab-pane fade" id="host-sequences-content" role="tabpanel" aria-labelledby="host-sequences-tab">
<article>
<div style="text-align:center"><img src="/images/banners/coming-soon-banner.png" style="margin-top: 2rem;" width="200"></div>
{{ partial "genomics/host-sequences-table.html" . }}
</article>
</div>
<div class="tab-pane fade" id="genomic-resources-content" role="tabpanel" aria-labelledby="genomic-resources-tab">
......
<table class="table table-hover table-sm table-responsive" id="host-sequences-table" style="display: table;">
<thead class="thead-light">
<tr>
<th scope="col">{{ i18n "accession_id" }}</th>
<th scope="col">{{ i18n "description" }}</th>
<th scope="col">{{ i18n "country" }}</th>
<th scope="col">{{ i18n "region" }}</th>
</tr>
</thead>
<tbody>
{{ range $index, $entry := $.Site.Data.c19pes_host_sequences.host_sequences }}
<tr>
<td><a target="_blank" href='{{print "https://www.ebi.ac.uk/ena/browser/view/" .accession_id}}'>{{ .accession_id }}</a></td>
<td>{{ .description }}</td>
<td>{{ .country }}</td>
<td>{{ .region }}</td>
</tr>
{{ end }}
</tbody>
</table>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.22/js/jquery.dataTables.js"></script>
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.22/js/dataTables.bootstrap4.min.js"></script>
<script>
$(document).ready(() => {
const covicatTable = $('#host-sequences-table').DataTable({
dom: `
<".container-fluid"
<".row"
<".mr-auto"i>
<"#search-2.mr-2"f>
>
<".row"t>
<".row"
<".mr-auto"l>
<".ml-auto"p>
>
>
`,
ordering: false,
});
// Move download button next to filter search box.
const downloadButtonHostSequences = document.querySelector('#download-button-2');
const searchHostSequences = document.querySelector('#search-2');
searchHostSequences.insertAdjacentElement('afterend', downloadButtonHostSequences);
});
</script>
......@@ -47,8 +47,8 @@
});
// Move download button next to filter search box.
const downloadButtonCovicat = document.querySelector('#download-button-2');
const searchCovicat = document.querySelector('#search-2');
searchCovicat.insertAdjacentElement('afterend', downloadButtonViralSequences);
const downloadButtonViralSequences = document.querySelector('#download-button-2');
const searchViralSequences = document.querySelector('#search-2');
searchViralSequences.insertAdjacentElement('afterend', downloadButtonViralSequences);
});
</script>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment