diff --git a/query.py b/query.py index 89fabf1d6023b683b677739fb2737e3c16428f22..bf02a9142dfc5af3961d398795d845697a8a0527 100644 --- a/query.py +++ b/query.py @@ -12,7 +12,8 @@ for paper in paper_list: paper.title = paper.title[0] # Create a dictionary of cards -my_list = dict({"cards": paper_list}) +my_list = dict({"num_papers": query_data.num_found, + "cards": paper_list}) # Silence the yaml object naming def noop(self, *args, **kw): diff --git a/templates/pubs.html b/templates/pubs.html index 8a1c842ddb477f1b0176d63ac4a95b45d3587101..6f90e1709f1e982d34998c9dd27a20cda10c16af 100644 --- a/templates/pubs.html +++ b/templates/pubs.html @@ -9,19 +9,24 @@ <div class="container"> {{ helper.navbar(navbar, link) }} - <div class="text"> - <h2>Publications using SWIFT</h2> - </div> + <br/> + <div class="text"> + <h2>Publications using SWIFT</h2> + </div> + + <div> The following {{ num_papers }} have made use of SWIFT for their results:</div> + + {% set count = num_papers %} {% for card in cards|sort_cards %} - <div class="card-text"> - <h4>{{ loop.index }}) <a href="https://ui.adsabs.harvard.edu/abs/{{ card.bibcode }}/abstract">{{ card.title }}</h4></a> - {% if card.author_count > 1 %} - <p>{{ card.first_author_norm }} et al., {{ card.year }}</p> - {% else %} - <p>{{ card.first_author_norm }}, {{ card.year }}</p> - {% endif %} - </div> - {% endfor %} + <div class="card-text"> + <h4>{{ count + 1 - loop.index }}) <a href="https://ui.adsabs.harvard.edu/abs/{{ card.bibcode }}/abstract">{{ card.title }}</h4></a> + {% if card.author_count > 1 %} + <p>{{ card.first_author_norm }} et al., {{ card.year }}</p> + {% else %} + <p>{{ card.first_author_norm }}, {{ card.year }}</p> + {% endif %} + </div> + {% endfor %} </div> {% endblock %}