diff --git a/media/html/public_browse_table.html b/media/html/public_browse_table.html index 6fcc3fa..3bb79b7 100644 --- a/media/html/public_browse_table.html +++ b/media/html/public_browse_table.html @@ -173,6 +173,8 @@ <h2 style="font-size: 24px; margin-bottom: 24px;"> // Create input element let input = document.createElement('input'); + // Populate element with search from URL querystring if present + input.value = new URLSearchParams(window.location.search).get(`${this.dataSrc()}`) ?? '' input.placeholder = title; column.header().replaceChildren(input); @@ -182,6 +184,9 @@ <h2 style="font-size: 24px; margin-bottom: 24px;"> column.search(input.value).draw(); } }); + + // Search and draw column with query populated search term + column.search(input.value).draw(); }); // Force redraw to address responsive column width issue diff --git a/media/html/public_detail.html b/media/html/public_detail.html index 7c61b43..dae48b4 100644 --- a/media/html/public_detail.html +++ b/media/html/public_detail.html @@ -448,7 +448,9 @@ <h3 class="panel-title"><b>Citation</b></h3> {{ pubmed_info|citation_format }} {% endautoescape %} </p> - + <button> + <a id="link_relatedEntries" href="/browse/table">View related RMDB entries for this publication</a> + </button> <p><span class="lead" id="show_description"><span class="label label-brown">Description</span></span></p> <p id="tag_description"></p> <p style="padding-top:5px;" id="show_pdb"> diff --git a/media/js/public/view_tags.js b/media/js/public/view_tags.js index 24c18dc..99f6552 100644 --- a/media/js/public/view_tags.js +++ b/media/js/public/view_tags.js @@ -72,6 +72,7 @@ function fill_tags() { if(/^\d+$/.test(tags.pubmed_id)) { $("#tag_pubmed").text(tags.pubmed_id); $("#link_pubmed").attr("href", "http://www.ncbi.nlm.nih.gov/pubmed/" + tags.pubmed_id); + $("#link_relatedEntries").attr("href", "/browse/table?pubmed_id=" + tags.pubmed_id); }else{ $("#link_pubmed").css("display", "none"); $("#show_publication").css("display", "none");