Skip to content
This repository has been archived by the owner on Dec 9, 2022. It is now read-only.

Commit

Permalink
closes #6
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkEEaton committed Oct 10, 2020
1 parent b20fab0 commit a973254
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 2 additions & 4 deletions compare.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def add_security_headers(resp):
resp.headers["X-Frame-Options"] = "SAMEORIGIN"
resp.headers["X-XSS-Protection"] = "1; mode=block"
resp.headers["Strict-Transport-Security"] = "max-age=31536000; includeSubDomains"
resp.headers["Content-Security-Policy"] = "script-src 'self'; style-src 'self'; object-src 'none'"
resp.headers["Content-Security-Policy"] = "script-src 'self'; style-src 'self'; default-src 'none'"
return resp


Expand Down Expand Up @@ -173,11 +173,9 @@ async def titles(idx, item, unordered_scores):
title = journal_json["results"][0]["bibjson"]["title"]
if title[-1:] == " ":
title = title[:-1]
url = "https://doaj.org/toc/" + issn
except:
title = "Title lookup failed. Try finding this item by ISSN instead.."
try:
url = journal_json["results"][0]["bibjson"]["link"][0]["url"]
except:
url = ""
score = float(item[1]) * 100
unordered_scores[score] = (title, issn, url)
Expand Down
7 changes: 6 additions & 1 deletion templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,12 @@ <h2 class="head2">Your results...</h2>
{% for item in output %}
<li>
<strong>{{ "{0:.2f}".format(item) }}</strong> :
{{ output[item][0] }}. {{ output[item][1] }}
{% if output[item][2] %}
<a href="{{ output[item][2] }}">{{ output[item][0] }}</a>.
{% else %}
{{ output[item][0] }}.
{% endif %}
{{ output[item][1] }}
</li>
{% endfor %}
{% if errors.get('webabstract')[0] %}
Expand Down

0 comments on commit a973254

Please sign in to comment.