diff --git a/query.py b/query.py index 94085f3c448f245a157a10e82314077199060f30..8e7ea8699a8085dbdffb7abb4343d5f7a354436c 100644 --- a/query.py +++ b/query.py @@ -4,13 +4,15 @@ import sys # Query papers citing the two SWIFT ADS entries query = ADSQueryWrapper(sys.argv[1]) -query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S)", fl="title,bibcode,first_author_norm,date,year,doi,author_count,pub_raw,bibstem", rows=1000) +query_data = query.get("citations(2016pasc.conf....2S) or citations(2018ascl.soft05020S)", fl="title,bibcode,first_author_norm,date,year,author_count,bibstem,abstract", rows=1000) paper_list = query_data.papers # Process the data to make the title a string and not an array of strings for paper in paper_list: paper.title = paper.title[0] paper.bibstem = paper.bibstem[0] + if hasattr(paper, "abstract"): + paper.abstract = paper.abstract.replace("<P />", "") # Create a dictionary of cards my_list = dict({"num_papers": query_data.num_found, diff --git a/templates/pubs.html b/templates/pubs.html index 5f517dc590e6d1dee00436926c0e1fd7b9dfabf0..2a2972e2538aa8e8ec983800e887ea4f1bc13035 100644 --- a/templates/pubs.html +++ b/templates/pubs.html @@ -14,18 +14,25 @@ <h2>Publications using SWIFT</h2> </div> - <div> The following {{ num_papers }} have made use of SWIFT for their results:</div> + <div> The following {{ num_papers }} publications have made use of SWIFT obtain their results:</div> {% set count = num_papers %} {% for card in cards|sort_cards %} <div class="card-text"> <h4>{{ count + 1 - loop.index }}) <a href="https://ui.adsabs.harvard.edu/abs/{{ card.bibcode }}/abstract">{{ card.title }}</h4></a> + <p> {% if card.author_count > 1 %} - <p>{{ card.first_author_norm }} et al., {{ card.bibstem }}, {{ card.year }}</p> + {{ card.first_author_norm }} et al., {% else %} - <p>{{ card.first_author_norm }}, {{ card.bibstem }}, {{ card.year }}</p> - {% endif %} + {{ card.first_author_norm }}, + {% endif %} + <i>{{ card.bibstem }}</i>, {{ card.year }} + {% if card.abstract %} + <p class="hideshow">Abstract <i class="fa fa-chevron-right" aria-hidden="true"></i></p> + <p class="abstract card">{{ card.abstract }}</p> + {% endif %} + </p> </div> {% endfor %} </div>