diff options
Diffstat (limited to 'uploader/templates/publications/index.html')
| -rw-r--r-- | uploader/templates/publications/index.html | 69 |
1 files changed, 43 insertions, 26 deletions
diff --git a/uploader/templates/publications/index.html b/uploader/templates/publications/index.html index f846d54..54d3fc0 100644 --- a/uploader/templates/publications/index.html +++ b/uploader/templates/publications/index.html @@ -3,16 +3,22 @@ {%block title%}Publications{%endblock%} -{%block pagetitle%}Publications{%endblock%} - {%block contents%} {{flash_all_messages()}} <div class="row" style="padding-bottom: 1em;"> - <a href="{{url_for('publications.create_publication')}}" - class="btn btn-primary"> - add new publication</a> + <div class="col"> + <a href="{{url_for('publications.create_publication')}}" + class="btn btn-primary" + title="Create a new publication."> + add new publication</a> + </div> +</div> + +<div class="row"> + <p>Click on title to view more details and to edit details for that + publication.</p> </div> <div class="row"> @@ -33,6 +39,8 @@ {%block javascript%} +<script type="text/javascript" src="/static/js/urls.js"></script> + <script type="text/javascript"> $(function() { var publicationsDataTable = buildDataTable( @@ -41,50 +49,59 @@ [ {data: "index"}, { + searchable: true, data: (pub) => { - if(pub.PubMed_ID) { - return `<a href="https://pubmed.ncbi.nlm.nih.gov/` + - `${pub.PubMed_ID}/" target="_blank" ` + - `title="Link to publication on NCBI.">` + - `${pub.PubMed_ID}</a>`; - } - return ""; + if(pub.PubMed_ID) { + return `<a href="https://pubmed.ncbi.nlm.nih.gov/` + + `${pub.PubMed_ID}/" target="_blank" ` + + `title="Link to publication on NCBI.">` + + `${pub.PubMed_ID}</a>`; + } + return ""; } }, { + searchable: true, data: (pub) => { - var title = "⸻"; - if(pub.Title) { - title = pub.Title - } - return `<a href="/publications/view/${pub.Id}" ` + - `target="_blank" ` + + var title = "⸻"; + if(pub.Title) { + title = pub.Title + } + url=buildURLFromCurrentURL( + `/publications/view/${pub.Id}`); + return `<a href="${url}" target="_blank" ` + `title="Link to view publication details">` + `${title}</a>`; } }, { + searchable: true, data: (pub) => { - authors = pub.Authors.split(",").map( - (item) => {return item.trim();}); - if(authors.length > 1) { - return authors[0] + ", et. al."; - } - return authors[0]; + authors = pub.Authors.split(",").map( + (item) => {return item.trim();}); + if(authors.length > 1) { + return authors[0] + ", et. al."; + } + return authors[0]; } } ], { + serverSide: true, ajax: { url: "/publications/list", dataSrc: "publications" }, scrollY: 700, - paging: false, + scroller: true, + scrollCollapse: true, + paging: true, deferRender: true, layout: { topStart: "info", - topEnd: "search" + topEnd: "search", + bottomStart: "pageLength", + bottomEnd: false } }); }); |
